Skip to content

Fix a race when renaming a session - #3

Merged
javiertoledo merged 1 commit into
theam:mainfrom
didelco:fix-session-rename-race
Oct 9, 2026
Merged

javiertoledo merged 1 commit into
theam:mainfrom
didelco:fix-session-rename-race

Conversation

@didelco

@didelco didelco commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Dismissing the rename alert set AppModel.renaming to nil right away, but the Rename button's Task only read renaming after an await, by which point it was already nil — so confirming a rename could silently do nothing.
  • Capture the RenamePrompt synchronously in the button's action, before the Task starts, so it survives the dismissal.

Test plan

  • swift build succeeds
  • Rename a session and confirm the workspace is renamed every time (not just when the awaited Task happens to win the race)

🤖 Generated with Claude Code

Dismissing the rename alert cleared AppModel.renaming to nil right
away, but the Rename button's Task only read renaming after an await,
by which point it was already gone — so renaming silently did nothing.
Capture the prompt synchronously when the button is tapped instead.
@javiertoledo
javiertoledo merged commit a09b789 into theam:main Oct 9, 2026
1 check passed
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.

2 participants