Skip to content

fix(tui): Prevent out-of-order project.sync() responses from overwriting state with stale data.#22461

Open
CarloWood wants to merge 1 commit intoanomalyco:devfrom
CarloWood:CW08_project_sync_fix
Open

fix(tui): Prevent out-of-order project.sync() responses from overwriting state with stale data.#22461
CarloWood wants to merge 1 commit intoanomalyco:devfrom
CarloWood:CW08_project_sync_fix

Conversation

@CarloWood
Copy link
Copy Markdown

Issue for this PR

Closes #22450

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

If results from project.sync() arrive out of order, only keep the most recent one.

How did you verify your code works?

I had a 100% reproducible case where the race occurred and using the stale instance did break things for me. I added extensive debug output to determine exactly what was the root cause.
After applying this patch everything worked again as expected.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions
Copy link
Copy Markdown
Contributor

Hey! Your PR title Prevent out-of-order project.sync() responses from overwriting state with stale data. doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@CarloWood CarloWood changed the title Prevent out-of-order project.sync() responses from overwriting state with stale data. fix(tui): Prevent out-of-order project.sync() responses from overwriting state with stale data. Apr 14, 2026
@CarloWood CarloWood force-pushed the CW08_project_sync_fix branch from 0bd4cd8 to 564174d Compare April 14, 2026 15: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.

[Bug]: async race in project.sync(): stale promise resolution clobbers newer state

1 participant