From 6e814ac41e35db9814587934b49ed2f056931cdc Mon Sep 17 00:00:00 2001 From: rebuildup Date: Sun, 29 Nov 2026 14:04:57 +0900 Subject: [PATCH] fix(#267): give the Launch Services lookup time to settle after an install The pre-rename and the post-rename artifact carry the same bundle id (the upgrade identity), so right after an install Launch Services keeps resolving to the previously registered app. The 15s window made verify fail on a real macOS host; the same check passed two minutes later. --- components/hoxay/verify.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/components/hoxay/verify.sh b/components/hoxay/verify.sh index 451fab7a..bbed5cac 100755 --- a/components/hoxay/verify.sh +++ b/components/hoxay/verify.sh @@ -89,8 +89,14 @@ if [[ "$APPS_DIR" != "$HOME/Applications" ]]; then echo "[hoxay] launch services: skipped (apps dir $APPS_DIR is not the standard location)" else [[ -x "$LSREGISTER" ]] && "$LSREGISTER" -f "$app" >/dev/null 2>&1 || true + # After an install the Launch Services database keeps resolving the shared + # bundle id to the previously registered app for a while (both the pre- and + # the post-rename build carry the same bundle id), so the lookup needs a + # settling window before it is a verdict (observed on a real macOS host: + # the same check failed right after the update and passed two minutes + # later). ls_ok=0 - for _ in $(seq 1 15); do + for _ in $(seq 1 60); do resolved="$(osascript -l JavaScript -e \ 'ObjC.import("AppKit"); var u = $.NSWorkspace.sharedWorkspace.URLForApplicationWithBundleIdentifier("'"$BUNDLE_ID"'"); u ? ObjC.unwrap(u.path) : ""' \ 2>/dev/null || true)" @@ -101,7 +107,7 @@ else sleep 1 done [[ "$ls_ok" == "1" ]] \ - || fail "Launch Services does not resolve $BUNDLE_ID to $app after 15s" + || fail "Launch Services does not resolve $BUNDLE_ID to $app after 60s" echo "[hoxay] launch services: $app" # Informational only: whether the Spotlight index currently knows the app.