Skip to content

Fix imported two-thumb settings and gesture dictionary state staying stale #153

Description

@AsafMah

Describe the bug
The v4.2.0 integration review confirmed retained restore and dictionary-cache defects. This includes the reported case where importing normal-keyboard settings into EXP did not update two-thumb behavior. Restore blocks the main thread, can finalize while its worker is still running, and does not explicitly refresh already-loaded SettingsValues. Fallback gesture indices and spelling-validity caches also survive mutations or accept stale background builds.

To Reproduce

  • Initialize runtime settings, then import a same-version backup changing combining grace/manual spacing. Compare persisted preferences with the active cached settings without restarting the IME.
  • Use a delayed document stream: restore must not block Main or finalize before the worker completes.
  • Restore an archive containing an escaping path: validate before any target deletion and preserve files outside the selected restore directory.
  • Build fallback gesture and spelling caches, then block/promote a word; observe stale results without changing fields.
  • Complete two layout-index builds in reverse order after invalidation; an obsolete result can overwrite the newer index.

Expected behavior

  • Backup/restore never waits synchronously on Main; completion, migration and listener restoration happen exactly once in the correct order.
  • Successful import immediately refreshes runtime two-thumb settings, preserving subtype/theme/toolbar state.
  • Archive destinations are validated before destructive operations; errors leave listeners usable and never report success.
  • Blocking/promoting words invalidates fallback snapshots after actual mutation completion.
  • Stale build success, failure and cleanup cannot overwrite a newer gesture index.
  • Spelling-validity caches reflect block/remove/reload/promotion immediately after mutation.
    Each fix requires a failing-before production-path regression. No new decoder algorithm or recognition-quality claim is part of this issue.

Screenshots
N/A — deterministic state, archive and executor fixtures.

App version & Flavor
Retained defects reviewed at stabilized dev 07ef7536f and the v4.2.0 integration. Correction branch starts at b376f5a17. Settings apply to all flavors; fallback-index issues apply when the Java fallback is selected.

Device Info

  • Model: reporter uses SM-S936B; new review reproductions use isolated JVM/Robolectric fixtures.
  • OS version: not asserted for this review.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions