Skip to content

Preserve the correct history limits while editing Favorites - #17

Open
MiMoHo wants to merge 2 commits into
haad:masterfrom
MiMoHo:correct-favorites-remember-limit
Open

MiMoHo wants to merge 2 commits into
haad:masterfrom
MiMoHo:correct-favorites-remember-limit

Conversation

@MiMoHo

@MiMoHo MiMoHo commented Aug 31, 2026

Copy link
Copy Markdown

Problem

Two coupled Favorites retention paths can corrupt history state:

  1. checkRememberNumPref:forPrimaryStore: always forwards YES, even while editing Favorites. Cancelling a Favorites shrink can therefore overwrite the main rememberNum, leave favoritesRememberNum at the rejected value, and cause later trimming despite the cancellation.
  2. checkFavoritesRememberNumPref: always switches to Favorites and restores afterward. If Favorites is already selected in the bezel, that second switch overwrites the stashed reference to the main history; a later save can serialize Favorites as both histories.

Change

  • forward the actual isPrimaryStore argument
  • return the effective retention limit as declared
  • switch to Favorites temporarily only when the main store was active
  • restore the main store only after such a temporary switch

Verification

  • native regression harness compiles the real AppController with 19 application sources plus a fixture
  • first RED: exit 11, favorite limit was forwarded as primary
  • second RED after the first fix: exit 15, already-selected favorites store was switched re-entrantly
  • final focused test: 1/1 passed, covering primary/favorite forwarding and return values, already-selected Favorites, and temporary switch/restore
  • native arm64 link comparison: base and candidate each linked the same 20 PBX sources with 0 errors; no new warning signature and the existing missing-return warning was removed
  • Clang analyzer comparison: 13 identical existing diagnostics, 0 errors
  • independent pre-commit review of diff SHA-256 0787d5e8d71fc70b527b647b57a38562984226beda0e5e0ead6f84737591c4f1: PASS, no findings
  • consolidated-repository integration exposed and reproduced a duplicate-main test-inventory failure; the test now excludes Tests/*.m
  • the corrected test passed both in the PR worktree and against the consolidated repository
  • independent review of the one-file integration diff SHA-256 9cba2a8440063093aae1f75d0f4733becd7e3966128558f9d8fc00e7de69ad2a: PASS, no findings

Limitation

A full signed Xcode release build and visible UI test were unavailable in this Command Line Tools environment. The native fixture executes the real controller methods and the complete target source-link comparison verifies the app target.

@MiMoHo
MiMoHo force-pushed the correct-favorites-remember-limit branch from e327583 to 8239f43 Compare September 9, 2026 15: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