Repository navigation
fix(ios): stop MySQL timeouts and Stop leaving statements running, and keep synced passwords - #4177
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes from the 2026-11-10 code audit (wave 2) for the iOS app.
MySQL
IOSDriverFactorynow passes the connection's query timeout, enforced on the server withmax_execution_time(MySQL, TiDB),max_statement_time(MariaDB) orob_query_timeout(OceanBase). A statement that outlasts the socket timeout is killed on the server.KILL QUERY <thread id>(KILL TIDB QUERYon TiDB) over a second connection with the same TLS and sign-in, for the caller's own statement only. A reader that leaves sends no kill on TiDB, where a late kill drops the session. An IAM kill reuses the session's token for 10 minutes, then mints a fresh one for the real endpoint (behind an SSH tunnel too, throughDriverFactory.createDriver(for:password:preTunnelHost:refreshPassword:)), and mints once more on a 1045.PostgreSQL
__darwin__, sokeepalives_idlein the connection string was ignored.Sessions and Keychain
KeychainSecureStore.storeupdates in place and writes only the copy the Sync Passwords setting selects; it no longer deletes the synced copy other devices use.CertificateMaterialStorehad the same delete-then-add and is fixed the same way.kSecAttrModificationDate; with it off, this device's own copy first.Test plan
verify.sh ioson an iPhone simulator, 28 suites covering every MySQL and PostgreSQL driver path, the connection coordinator, the transaction monitor and the Keychain stores: 302 passed. New suites:MySQLStopTests,MySQLQueryTimeoutTests,MySQLSessionSocketTests,MySQLKillTokenTests,MySQLKillSignInTests,PostgreSQLSessionSocketTests,ConnectionCoordinatorBackgroundTests,KeychainSecureStoreTests. Each new test is written to fail onmain; that was traced, not run.swift testfor TableProCore: 4,944 passed, including the newConnectionManagerSignInTestscases.