Skip to content

[codex] Preserve app rule migration metadata - #26

Merged
ygsgdbd merged 1 commit into
mainfrom
codex/preserve-migration-metadata
Jul 21, 2026
Merged

[codex] Preserve app rule migration metadata#26
ygsgdbd merged 1 commit into
mainfrom
codex/preserve-migration-metadata

Conversation

@ygsgdbd

@ygsgdbd ygsgdbd commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Problem

PR #24 introduced migration version 2 to recover legacy per-application input method mappings. When a current .none placeholder already contained a valid application path and display name, the merge replaced the entire record with the legacy record.

If the targeted legacy application scan did not find that bundle identifier, the legacy record contained no path and used the bundle identifier as its display name. The replacement therefore discarded metadata that was already available in app-rules.json.

User impact

An installed but non-running application could be moved into the unavailable applications section after migration. The recovered fixed input method strategy remained present, but the user could see the application as missing and remove its rule through the clear-unavailable action.

Root cause

AppRulesStoreMigration.merge treated a .none collision by returning the complete legacy record. The migration only needed the legacy strategy to be authoritative; legacy application metadata is authoritative only when the migration scan actually matched the application.

Fix

The merge now starts from the current .none record, restores the legacy strategy, and records the migration update timestamp. When the legacy scan supplies a path, its current path and display name are adopted. When the legacy path is absent, the existing path and display name are preserved. The original creation timestamp remains unchanged, while existing .fixed, .followLast, and .ignored rules remain fully authoritative.

Migration version 2 and the existing save-before-completion flow are unchanged because the migration has not yet shipped in a release.

Validation

  • rtk just check
  • rtk git diff --check
  • Added coverage for inserting missing legacy rules without overwriting explicit strategies
  • Added coverage for refreshing metadata when the legacy scan succeeds
  • Added coverage for preserving current metadata and availability when the legacy scan misses an installed application
  • Verified merge idempotency
  • Updated the reducer migration test to verify metadata preservation and save-before-completion ordering

@ygsgdbd
ygsgdbd force-pushed the codex/preserve-migration-metadata branch from 2b5206b to 59ed9fc Compare July 21, 2026 10:08
@ygsgdbd
ygsgdbd marked this pull request as ready for review July 21, 2026 10:22
@ygsgdbd
ygsgdbd merged commit f93d8be into main Jul 21, 2026
2 checks passed
@ygsgdbd
ygsgdbd deleted the codex/preserve-migration-metadata branch July 21, 2026 10:22
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