Skip to content

fix(app): prevent notification crash on unavailable server#37730

Open
water-boom wants to merge 3 commits into
anomalyco:devfrom
water-boom:fix/notification-missing-server-clean
Open

fix(app): prevent notification crash on unavailable server#37730
water-boom wants to merge 3 commits into
anomalyco:devfrom
water-boom:fix/notification-missing-server-clean

Conversation

@water-boom

@water-boom water-boom commented Jul 19, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #35686

Type of change

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

What does this PR do?

A persisted active server key can outlive its connection, for example after a
WSL distribution is removed. The notification context then throws during
render and the desktop app can enter a startup crash loop.

This change handles both cases:

  • If another server is available, activeServer() falls back to it instead of
    keeping the stale key.
  • If no server is available, ensure() returns an empty notification state
    instead of throwing. The UI remains usable and can recover when a server
    becomes available.

How did you verify your code works?

  • Exercised stale-key, available-server, and no-server cases locally
  • Ran bun typecheck
  • Ran 622 unit tests
  • Launched the desktop dev build

Screenshots / recordings

Not applicable; this does not change the UI.

Checklist

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

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Jul 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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

Found potential duplicate PRs:

  1. fix(notification): handle unavailable server during initialization #37190 - fix(notification): handle unavailable server during initialization

    • Directly related to the same notification/server unavailability issue
  2. fix(app): guard missing notification server state #35688 - fix(app): guard missing notification server state

These two PRs appear to be addressing the same or closely related notification crash issues when servers are unavailable. You should verify whether they handle the same root cause and coordinate with any existing work on this issue.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Jul 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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.

OpenCode Desktop v1.17.14 can get stuck in an infinite startup crash loop with: Error: Notification server not found: http://[server-ip]:4096

1 participant