Skip to content

fix(update): swap back to the previous app when an updated InkFlow does not start - #350

Merged
nervouna merged 2 commits into
mainfrom
343-update-rollback
Dec 4, 2026
Merged

nervouna merged 2 commits into
mainfrom
343-update-rollback

Conversation

@nervouna

@nervouna nervouna commented Dec 4, 2026 •

Copy link
Copy Markdown
Owner

Summary

Closes #343

When an updated InkFlow starts in none of the sessions, the root helper swaps the previous app back, kills the new copy and starts the previous app again. One session that starts keeps the update. --start looks once more at another process at the target path if the checked one fails, and waits for isFinishedLaunching and then 5 s of life. 「设置 → 更新」 shows the update as not installed when a sent update did not take.

Acceptance (final commit, after rework round 1)

  1. bash macOS/scripts/test.sh updater: pass (ok session outcomes, ok processes, PASS 1 units: updater).
    First new case (first round) on the old replace (the kill closure existed, replace unchanged):
    FAIL session outcomes: TestFailure(message: "TEST: the reply names the build and the user: nil")
    
  2. bash macOS/scripts/test.sh input-source-lifecycle: pass (PASS verify started: ..., PASS 1 units: input-source-lifecycle).
  3. bash macOS/scripts/test.sh settings: pass (PASS update sent: ..., PASS update problem store: ..., PASS 1 units: settings).
  4. bash macOS/scripts/build.sh: exit 0.
  5. python3 -B scripts/docs-lint.py, comment-lint.py --base origin/main, style-lint.py --base origin/main: no output, pass.
  6. git status --porcelain: empty after the commit.

Deviations and open issues

  • Rework round 1 followed the changed spec: rollback only when no session starts, startAndVerify second look (tested with an injected launch closure; the lifecycle test fails without the second look with exited after it started), kill(running:) repeats and re-checks the path, docs rewrapped.
  • None to the spec. The kill closure in the test fixture records kill staged build N, with N the installed build, to check the order.
  • Not checked (out of scope): the real helper, sudo, the installed InkFlow, the Settings UI. Whether a real InkFlow reaches isFinishedLaunching within 15 s is from the issue's measurement (about 0.45 s).
  • After the swap back, proc_pidpath of a running new copy is assumed to report the staging path; the system kill test covers only a process started at that path.
  • sessionOutcomes no longer asserts that a failed start keeps the new app.

Delivery record

Implementer model Implementer tokens Rework rounds Dispatch to merge Defects found in review Defects found in acceptance
claude-sonnet-5-5 189348 (57 tool calls) 1 1h 04m (17m 30s implementation) 0 in the implementation; 3 spec changes after the security review 0

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-04T08:17:45.694446Z 625efbf PR opened
🔒 Security Review ✅ Completed 2026-12-04T08:19:30.353844Z 625efbf PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@nervouna

nervouna commented Dec 4, 2026

Copy link
Copy Markdown
Owner Author

Orchestrator review: accepted

On f483bee1730b. The branch is up to date with main.

# Acceptance item Result
1 test.sh updater pass: PASS 1 units: updater, on f483bee. The implementer showed the first new case failing on the old replace
2 test.sh input-source-lifecycle pass: PASS 1 units: input-source-lifecycle, on f483bee
3 test.sh settings pass: PASS 1 units: settings, on f483bee
4 build.sh pass: exit 0 on f483bee
5 docs, comment and style lint pass: exit 0 each, base origin/main
6 git status --porcelain pass: empty

Own checks: Ran the helper as root with a scratch app (own bundle ID and folder) through launchctl asuser. On main, a build that exits, hangs or crashes after 2 s is reported as installed and stays. On f483bee all three end with the previous build installed and running (7 s, 22 s, 8 s), the staging folder gone and no process of the new copy left. A healthy build is installed in 6 s, also while the app is opened again every 50 ms. An independent read-only security review of 625efbf found no new way to gain root or install another app. Its points on several sessions, the launch race and the kill loop became the rework, as spec changes and not implementer defects.

Deviations: None.

Open for the user:

@nervouna
nervouna merged commit 61feb34 into main Dec 4, 2026
7 checks passed
@nervouna
nervouna deleted the 343-update-rollback branch December 4, 2026 09:09
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.

Swap back to the previous app when an updated InkFlow does not start

1 participant