Skip to content

fix: decode a server warning, and keep the one a login raises - #15

Merged
datlechin merged 4 commits into
tablepro-mainfrom
fix/warning-message-decoding
Oct 13, 2026
Merged

datlechin merged 4 commits into
tablepro-mainfrom
fix/warning-message-decoding

Conversation

@datlechin

@datlechin datlechin commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

A login whose password is in its grace period hung until the login deadline. Oracle answers it with ORA-28002 (ORA-28098 on 26ai), sent as a warning message, twice, ahead of the authentication reply. Measured on Oracle 23.26 Free, reported on 19c (TableProApp/TablePro#3401).

  • A warning message carries its number, length and flags as UB2, then its text with its own length prefix. decodeWarning read fixed 2-byte integers and a raw string of that length, so the read ran past the packet and the decoder waited for bytes the server never sends. Upstream fixed this in Fix decoding error when receiving a warning packet lovetodream/oracle-nio#121 (closes Connect hangs at auth phase two for accounts in EXPIRED(GRACE) — decodeWarning uses raw UInt16 instead of UB2 lovetodream/oracle-nio#113), which tablepro-main did not have; it is cherry-picked here with its integration test, keeping this branch's BackendError hardening. The new unit test fixture is the warning captured off the wire.
  • The authentication state machine keeps a warning that arrives during the login, ignores an empty one, and hands it out with .authenticated. OracleConnection.loginWarning (a new OracleWarning with the number and the server's text) exposes it, because the login still succeeds and the user needs to read it. A warning that arrives with a statement is logged as before.
  • ProtocolMessageTests did not compile on Swift 6.4, which reads OracleBackendMessage.Protocol.decode as the metatype.

Tests: the new unit tests fail on the old decoder and pass here. 505 unit tests and 93 integration tests against 23.26, including upstream's warning(), give the same result as tablepro-main: oobCheckWorks hangs, two OracleNetworkSecurityTests and customType fail on both.

TableProApp/TablePro#3407 pins the head of this branch, so merge it with a merge commit.

datlechin and others added 4 commits October 13, 2026 18:40
Swift 6.4 resolves `OracleBackendMessage.`Protocol`.decode` in an expression
to the metatype and refuses it, so the test target did not compile. A type
annotation names the nested type instead.
A warning message carries its number, length and flags as UB2 and its text
with its own length prefix. They were read as fixed 2-byte integers and a raw
string of that length, so the read ran past the packet and the decoder waited
for bytes the server never sends. A password in its grace period (ORA-28002,
ORA-28098 on 23ai) sends two such warnings ahead of the authentication reply,
so the login hung until its deadline.

The warning a login raises is now kept by the authentication state machine
and exposed as OracleConnection.loginWarning, since the login still succeeds.
This is a follow up on lovetodream#114, since that was too specific to the
auth/connection process. And required setup work outside of the test.
This implementation does all the setup inside tests and handles warnings
the same way as errors. Closes lovetodream#113

---------

Signed-off-by: Timo <38291523+lovetodream@users.noreply.github.com>
(cherry picked from commit 08bcddc)
A warning message with no number or text reports nothing, so it no longer
replaces the warning an earlier message in the same login carried.
@datlechin
datlechin merged commit e763b1d into tablepro-main Oct 13, 2026
@datlechin
datlechin deleted the fix/warning-message-decoding branch October 13, 2026 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants