Skip to content

fix(ios): Shortcuts Add Row rejects any CSV with CRLF line endings - #3224

Open
datlechin wants to merge 5 commits into
mainfrom
fix/ios-shortcuts-and-connection-info
Open

datlechin wants to merge 5 commits into
mainfrom
fix/ios-shortcuts-and-connection-info

Conversation

@datlechin

Copy link
Copy Markdown
Member

Summary

  • Shortcuts Add Row and Add Rows rejected any CSV with CRLF or lone CR line endings as having no data. The iOS CSV parser walked Swift Characters, and "\r\n" is one grapheme cluster equal to neither "\n" nor "\r", so the whole file read as one record.
  • The iOS Info tab showed a DuckDB file connection as a server at 127.0.0.1:3306. ConnectionInfoView picked the section with its own type != .sqlite check, written before DuckDB existed.
  • The iOS SELECT * FROM template wrote LIMIT 100 on SQL Server, Oracle and Redis, and left out the selected schema. QueryEditorView built the SQL string itself instead of calling SQLBuilder.buildSelect, the builder the data browser uses.
  • Deleting a connection on iOS kept its query history, and a connection deleted on another device also kept its saved editor state and Keychain secrets. Each delete path cleaned only what its author remembered, and neither touched query-history.json.
  • The iOS history list showed a repeated query twice until the connection was reopened. ConnectionCoordinator.addHistoryItem appended the item after saving it, whatever the store actually kept after its dedupe and 200-entry cap.

Tests

All run on an iOS 27.1 simulator in the TableProMobile scheme. The 17 covering suites ran 162 tests, all passing.

  • RowPayloadTests: "parses CSV with CRLF line endings", "keeps a CRLF inside a quoted CSV field", "parses CSV with carriage return line endings" and "splits a CSV field that starts with a combining mark". All four fail without the fix: the first three with emptyPayload, the last with the wrong split.
  • ConnectionInfoContentTests (new): "A DuckDB file connection gets the File section with its name and path" and "An in-memory DuckDB connection says In Memory instead of a path" fail without the fix, returning .server. The SQLite and server cases pass either way and guard against the fix overreaching. "Only SQLite and DuckDB are local file engines" covers the new predicate.
  • QueryTemplateTests (new): the SQL Server, Oracle, MySQL, PostgreSQL and Redis cases all fail without the fix. "Every iOS engine on the shared non-SQL list gets no SELECT template" passes either way; it ties the template to SQLDDLFallbackPolicy so a new non-SQL engine on iOS cannot get a SELECT template unnoticed.
  • DeletedConnectionPurgeTests (new): "Deleting a connection forgets its query history and keeps the others'" and "A connection deleted on another device loses its history and secrets here" fail without the fix. "The purge removes the connection's saved tab, database, schema and query, and no other connection's" covers the purge itself on a test defaults suite. "A sync merge that deletes nothing leaves every history alone" and "The saved-state keys keep the names already stored on the device" pass either way and guard against purging too much or renaming stored keys.
  • ConnectionCoordinatorHistoryTests (new): "Running the same query twice in a row lists it once, as the store keeps it" and "A query past the store's cap drops the oldest entry from the list too" fail without the fix. "A history file that cannot be read or written leaves the listed history in place" fails when the list is reloaded after a write that did not happen (the list went to []). "The same query failing after it succeeded is listed twice" passes either way.

Docs

The docs rewrite branch covers the user-facing text for these changes.

This branch has not been deployed

No deployments
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.

1 participant