Skip to content

Handle fatal connection attempt errors#385

Merged
jackyzha0 merged 1 commit into
mainfrom
jackyzha0/fatal-connection-attempt
Jun 26, 2026
Merged

Handle fatal connection attempt errors#385
jackyzha0 merged 1 commit into
mainfrom
jackyzha0/fatal-connection-attempt

Conversation

@jackyzha0

Copy link
Copy Markdown
Member

Why

River exposes isFatalConnectionError so callers can stop retrying connection failures that are permanent. That hook was only honored after a connection had been established, so fatal failures during the initial connection attempt still retried until the retry budget or session grace behavior kicked in.

This is needed for pid2 auth failures where the target repl is gone: callers can classify that as fatal and avoid the noisy retry loop.

What changed

  • Honor isFatalConnectionError in the initial onConnectionFailed path.
  • Disable reconnects and delete the unhealthy pending session when the initial connection error is fatal.
  • Add a regression test covering fatal initial connection failures.
  • Bump @replit/river to 0.219.0.

Versioning

  • Breaking protocol change
  • Breaking ts/js API change

Test plan

  • direnv exec . npm run check
  • direnv exec . npm exec -- vitest run

@jackyzha0 jackyzha0 requested a review from a team as a code owner June 26, 2026 16:25
@jackyzha0 jackyzha0 requested review from Monkatraz and removed request for a team June 26, 2026 16:25
@jackyzha0 jackyzha0 force-pushed the jackyzha0/fatal-connection-attempt branch from 21eaa36 to 3595ae4 Compare June 26, 2026 16:34
@jackyzha0 jackyzha0 force-pushed the jackyzha0/fatal-connection-attempt branch from 3595ae4 to 1ffd06e Compare June 26, 2026 16:38
@jackyzha0 jackyzha0 merged commit 04c7a3a into main Jun 26, 2026
3 checks passed
@jackyzha0 jackyzha0 deleted the jackyzha0/fatal-connection-attempt branch June 26, 2026 16:45
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