Skip to content

fix(ios): publish CIN imports from requested table (#242) - #243

Draft
limeimetw wants to merge 4 commits into
masterfrom
fix/242-ios-tricode-cin-import
Draft

limeimetw wants to merge 4 commits into
masterfrom
fix/242-ios-tricode-cin-import

Conversation

@limeimetw

@limeimetw limeimetw commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • carry an explicit staging mapping/metadata source for CIN and text imports
  • publish mappings and metadata from the requested destination table instead of selecting the always-present empty custom table
  • preserve Android-compatible database-backup behavior: custom mappings first, requested-table fallback, destination-table metadata
  • validate destination and explicit source table names before SQL identifier interpolation
  • add regression coverage for exact 0805/0816 tricode fixtures, named/custom tables, backup compatibility, metadata, publication lifecycle, and invalid identifiers

Root cause

The staging database always contains a custom table. For a named CIN import such as tricode, the parser correctly populated staging.tricode, but publication selected the empty staging.custom table first and rejected the staging database. The released behavior therefore produced zero live rows despite successfully parsing the source file.

Android imports CIN/text data directly into the explicitly requested table. This change preserves that observable contract while retaining the separate custom-first mapping behavior used for Android-compatible .limedb/ZIP backups.

Verification

Evidence completed for executable head a4c7b5869c678c5adedff98493e70b7382f28fd7:

  • Differential RED: exact 0805 and 0816 fixtures parse but pre-fix named-table publication leaves zero live rows
  • Focused native iOS release suite: 111 passed, 0 failed, 0 skipped
  • Complete native suite exercised, with all iphone 17 無法匯入三碼輸入法新版的CIN編碼檔? #242 tests passing
  • Linux regression suite: 59 passed
  • Xcode Cloud run 60: required TEST and ARCHIVE actions succeeded

Current head 0559afb621840e2405f735ae099b634703058e89 is not ready:

  • git diff --check origin/master...0559afb6 currently fails on three trailing-whitespace lines in the pinned CIN fixtures
  • The backup-compatibility path still decodes mixed-storage im.disable with row["disable"] as Int? ?? 0. Add a TEXT-valued fixture and decode through DatabaseValue and the established parseBoolFlag contract
  • Rerun focused tests, native gates, git diff --check, and independent review on the corrected exact head
  • Verify the exact 0816 CIN import through the Settings UI on a physical iPhone

Scope

This PR intentionally excludes the unrelated pinyin.zip test-fixture resolver defect found while auditing the historical 6.1.38 full suite. That infrastructure work will remain separate from Issue #242.

Refs #242

Carry explicit staging source intent for CIN/text imports so named tables are published instead of falling back to the empty custom table. Preserve Android-compatible custom-first backup mapping semantics, validate SQL table identifiers, and add exact tricode plus lifecycle regression coverage.
…-cin-import

# Conflicts:
#	docs/#242_ISSUE.md
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