Skip to content

fix(migration): App Store to direct build loses nothing on macOS 27 - #541

Merged
tieubao merged 6 commits into
developfrom
fix/appstore-migration
Nov 18, 2026
Merged

tieubao merged 6 commits into
developfrom
fix/appstore-migration

Conversation

@tieubao

@tieubao tieubao commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

What

A live run in hb-macos2701 (macOS 27.0.1) found that switching from the App Store build to the direct build could lose settings and "Open at login". This fixes every issue that run found.

# Issue Fix
1 Import skipped when the App Store copy runs at launch: the first collapse writes areSeparatorsHidden (and the macOS 27 engine writes pinnedSections), which read as the direct build's own settings AppStoreSettingsImport.keysWrittenAtLaunch are ignored in shouldOffer; the decision also reads a snapshot taken first thing in applicationDidFinishLaunching
2 Launch unregistered the App Store copy's login item before the offer was answered LaunchLoginItem.shouldApply: while the offer is pending and the App Store build opened at login, launch leaves the item alone. Import, and also "Not now", keep Open at login (applyDecline copies only isAutoStart) and AutoStart.takeOver unregisters then registers so the item opens this copy
3 A failed move of the App Store copy to the Trash was silent explainTrashFailure: the error plus the paths to drag to the Trash in Finder
4 brew install --cask hiddenbar refuses while the App Store copy is in /Applications README, a new MANUAL section, and a line under the command in the macOS 27 notice
5 1.13 quit silently next to a running 1.8 to 1.12 direct copy OtherRunningCopy.offerToReplaceOlderCopy: the same Quit and Switch alert, naming the version. Same path, same or newer version, or unknown version still quit silently
6 Status card said "running from d." for a translocated path RunningFolder.displayName says "a temporary folder"
7 Migration and notice strings were English only All 12 other locales carry them; a test checks every key and its %@ and newline counts

"Not now" keeping Open at login goes beyond the literal ask (the brief only asked to hold off while the offer is unanswered): without it the next launch would apply the direct build's unset "off" and remove the item one launch late.

Live run (hb-macos2701, macOS 27.0.1, head 0be6025)

App Store stand-in: the App Store scheme, Release, Developer ID signed, sandboxed, planted receipt, root-owned in /Applications. Direct build: this branch, Release-Direct, Developer ID signed, opened from a folder outside /Applications.

Step Result Screenshot
App Store copy, Open at login on, always-hidden and hover on BTM item enabled, URL /Applications/Hidden Bar.app
Direct build opens Quit and Switch offer; behind it the collapse wrote areSeparatorsHidden = true; BTM unchanged
Quit and Switch Import still offered
Import isAutoStart, alwaysHiddenSectionEnabled, hoverToExpand imported; BTM URL now the direct copy
Move to Trash (root-owned copy) "You do not have permission"; alert names the paths
Settings Open at login on, always-hidden on
Manual steps from the explainer, open from /Applications Working, Open at login on, BTM URL /Applications/Hidden Bar.app (the direct copy)
Reboot The direct copy started at login (boot 16:16:27, app 16:16:53)
1.11.2 running, this build opens "Hidden Bar 1.11.2 is running. Quit it and switch to this version?"; afterwards only the new copy runs
Opened from /private/tmp "It is running from a temporary folder."

The VM is back on released 1.13.0 (CDHash matches the pre-test copy, pre-test prefs byte-identical) and stopped.

Tests (mac-ui VM)

  • Red first: 8 new tests failed by assertion before the fixes (fixes 1, 2, 5, 6, 7).
  • Affected classes: direct 67 passed, App Store 45 passed, 0 failed.
  • scripts/test.sh at 0be6025: direct 709 passed, App Store 467 passed, 0 failed.
  • negctl, each green, RED under mutation, green after restore, Verdict PASS: fix 1 (keysWrittenAtLaunch emptied, test_keysTheDirectBuildWritesAtLaunchDoNotBlockTheImport fails); fix 2 gate (shouldApply forced true, test_loginItemIsLeftAloneWhileTheImportIsPending fails); fix 2 take-over (unregister skipped, test_takeOverReregistersAnEnabledItem fails).

Not covered

  • "Not now" was not run live; unit tests only.
  • The notice's Homebrew line was not seen live (the stand-in predates it).
  • A later manual move of the app: in the run the final login-item URL came from the one-time legacy login-item reset. Once smAppServiceMigrated is set, a launch with the item already enabled does not re-register, so a copy moved by hand afterwards keeps the old URL.
  • docs/appstore/listing.json still shows the brew command without the first step; the listing ships through App Store Connect, not this PR.

Strings left in English (translation uncertain)

"a temporary folder" stays English everywhere because the status card sentence it fills is still English in every locale.

  • ar (11): "Only one Hidden Bar can run at a time. The App Store version stays ins..."; "Only one Hidden Bar can run at a time. The older version stays where i..."; "Hidden Bar from the App Store keeps its settings in a separate place. ..."; "The App Store copy is in /Applications. Quit Hidden Bar, move /Applica..."; "Hidden Bar is running from outside Applications. The copy already in A..."; "Hidden Bar is running from outside Applications. Move it there so it k..."; "Hidden Bar can hide icons only from /Applications"; "a temporary folder"; "macOS 27 no longer lets App Store apps hide menu-bar icons. Hidden Bar..."; "macOS 27: get the working version..."; "Quit this App Store version and move it to the Trash first. Homebrew d..."
  • de (1): "a temporary folder"
  • fr (1): "a temporary folder"
  • hr (13): "Hidden Bar from the App Store is running. Quit it and switch to this v..."; "Only one Hidden Bar can run at a time. The App Store version stays ins..."; "Only one Hidden Bar can run at a time. The older version stays where i..."; "Import your settings from the App Store version?"; "Hidden Bar from the App Store keeps its settings in a separate place. ..."; "The App Store version of Hidden Bar is still installed: %@ You can res..."; "Hidden Bar could not move the App Store copy to the Trash"; "Hidden Bar is running from outside Applications. The copy already in A..."; "Hidden Bar is running from outside Applications. Move it there so it k..."; "a temporary folder"; "macOS 27 no longer lets App Store apps hide menu-bar icons. Hidden Bar..."; "Or install it with Homebrew:"; "Quit this App Store version and move it to the Trash first. Homebrew d..."
  • it (1): "a temporary folder"
  • ja (2): "a temporary folder"; "macOS 27: get the working version..."
  • pl (6): "Hidden Bar from the App Store keeps its settings in a separate place. ..."; "Hidden Bar is running from outside Applications. The copy already in A..."; "Hidden Bar is running from outside Applications. Move it there so it k..."; "Move to Applications"; "a temporary folder"; "Quit this App Store version and move it to the Trash first. Homebrew d..."
  • tr (6): "Hidden Bar from the App Store is running. Quit it and switch to this v..."; "Hidden Bar is running from outside Applications. The copy already in A..."; "Hidden Bar is running from outside Applications. Move it there so it k..."; "a temporary folder"; "macOS 27 no longer lets App Store apps hide menu-bar icons. Hidden Bar..."; "Quit this App Store version and move it to the Trash first. Homebrew d..."
  • uk (10): "Hidden Bar from the App Store is running. Quit it and switch to this v..."; "Only one Hidden Bar can run at a time. The App Store version stays ins..."; "Hidden Bar from the App Store keeps its settings in a separate place. ..."; "The App Store copy is in /Applications. Quit Hidden Bar, move /Applica..."; "Hidden Bar is running from outside Applications. The copy already in A..."; "Hidden Bar is running from outside Applications. Move it there so it k..."; "Move to Applications"; "a temporary folder"; "macOS 27 no longer lets App Store apps hide menu-bar icons. Hidden Bar..."; "Quit this App Store version and move it to the Trash first. Homebrew d..."
  • vi (2): "Hidden Bar is running from outside Applications. Move it there so it k..."; "a temporary folder"
  • zh-Hans (1): "a temporary folder"
  • zh-Hant (1): "a temporary folder"

The import offer no longer counts the separator state and pinned-sections
table that the first collapse writes, and reads the settings as launch found
them. While the offer is unanswered and the App Store build opened at login,
launch leaves the login item alone; Import and "Not now" both keep Open at
login and point the item at this copy. A failed move to the Trash now says so.
An older direct copy (1.8 to 1.12) still running gets Quit and Switch instead
of a silent quit.
The status card named Gatekeeper's random folder (d.) when Hidden Bar ran
from a translocated or temporary path.
brew install --cask hiddenbar refuses while the App Store copy sits in
/Applications. The README, the manual and the macOS 27 notice now say so next
to the command; the manual gains a section on switching from the App Store.
Every locale now carries the App Store migration and macOS 27 notice strings.
Strings whose translation was uncertain stay in English. CHANGELOG entry for
the migration fixes.
Two bundles with one id can confuse Launch Services, so bundleURL may name
the other copy; the version read from the process's executable path is the
one already computed for the decision.
@tieubao
tieubao force-pushed the fix/appstore-migration branch from 0be6025 to 271d74c Compare November 18, 2026 07:39
@tieubao
tieubao marked this pull request as ready for review November 18, 2026 07:39
@tieubao
tieubao merged commit 9ad79d5 into develop Nov 18, 2026
3 checks passed
@tieubao
tieubao deleted the fix/appstore-migration branch November 18, 2026 07:42
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