Skip to content

fix(client): ignore disappeared sessions during creation refresh - #57036

Open
HootRock wants to merge 2 commits into
anomalyco:devfrom
HootRock:ignore-missing-created
Open

HootRock wants to merge 2 commits into
anomalyco:devfrom
HootRock:ignore-missing-created

Conversation

@HootRock

@HootRock HootRock commented Oct 19, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #57026

Type of change

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

What does this PR do?

A short-lived session can disappear before the read triggered by session.created finishes, causing a spurious desktop error. Ignore only a matching SessionNotFoundError from that background refresh. Other errors still reach the error handler, and explicit reads still reject.

Successful stale responses remain the separate scope of #56886.

How did you verify your code works?

The regression fails before the fix. The data suite passes all 33 tests, including 500 and mismatched-session controls; an independent review ran 660 passing randomized repetitions. Client typecheck and all 34 bun run check tasks pass.

Full client run: 223 passed, 4 skipped, 5 service tests failed on Windows. An unchanged-baseline service run also failed 3 cases, so I am not claiming a full-suite pass.

AI-assisted; reviewed and tested locally.

Screenshots / recordings

No visual layout change; tested the data layer used by the desktop error handler.

Checklist

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

Added by the opencode bot (AI-generated).

Related: #48012, #51940

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I reproduced the issue's scenario against servers run from source: creating and immediately deleting 5 sessions triggered 5 onError calls ("Session not found: ses_…") on the base and none with this change, while the server still logs the 404 reads. The new test fails on the base and passes here. The client data tests (33/33) and the client typecheck pass.

The check is narrow: it only ignores a SessionNotFoundError for the session that was just created, and only in the background refresh. Explicit session.sync callers still get the rejection, and the test confirms no store entry is left behind.

Public API: unchanged.

No blocking concerns.

Related: #48012, #51940

This branch has not been deployed

No deployments
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.

desktop: recurring Session-not-found modal for session IDs that never existed (v2.0.32, Windows)

1 participant