Skip to content

Carry relay X-Error-Details on GlowNetworkError - #33

Merged
dmitry-salnikov merged 2 commits into
mainfrom
relay-error-details
Aug 7, 2026
Merged

Carry relay X-Error-Details on GlowNetworkError#33
dmitry-salnikov merged 2 commits into
mainfrom
relay-error-details

Conversation

@dmitry-salnikov

@dmitry-salnikov dmitry-salnikov commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

The relay reports safe-to-reveal rejection reasons (a full destination mailbox, an exceeded per-sender storage quota) in the X-Error-Details response header. Glow used to drop the header, so callers only got a status code. In practice that made a quota rejection indistinguishable from a broken session: a client that treats every 400 as a stale session responds with a clear-session-and-reconnect loop, burning the relay's rate-limit budget along the way.

Change:

  • GlowNetworkError gets an optional details field, filled from X-Error-Details when the relay rejects a request. The error message becomes GlowNetworkError status: 400 (Sender storage quota exceeded) when details are present and keeps the exact old shape when they are absent, so existing message-based grouping only improves where the relay actually says something.
  • No behavior change otherwise; relays that do not send the header work as before.

Note for the relay side: reading the header cross-origin needs Access-Control-Expose-Headers: X-Error-Details from the relay.

Tests: two new specs (details captured, absent header keeps old message); full suite 128/128, build clean.

🤖 Generated with Claude Code

dmitry-salnikov and others added 2 commits August 5, 2026 13:07
The relay names safe-to-reveal rejection reasons (full mailbox, exceeded
sender storage quota) in the X-Error-Details response header. Glow used
to drop it, leaving callers just a status code — a quota rejection was
indistinguishable from a broken session, and the Vault12 app reacted to
both with session-reconnect storms (BETA-2351). GlowNetworkError now
carries the header as `details` and includes it in the message; absent
header keeps the old message shape.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@dmitry-salnikov
dmitry-salnikov marked this pull request as ready for review August 6, 2026 11:03
@dmitry-salnikov
dmitry-salnikov requested a lite review from Copilot August 6, 2026 11:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds support for propagating relay-provided, safe-to-reveal rejection reasons (X-Error-Details) through GlowNetworkError, enabling callers to distinguish actionable relay rejections (e.g., quota/full mailbox) from generic failures while preserving the prior error message format when details are absent.

Changes:

  • Extend GlowNetworkError with an optional details field and include details in the error message only when present.
  • Capture X-Error-Details from relay HTTP responses and pass it into GlowNetworkError on non-OK responses.
  • Add Jest specs to verify details are captured when present and message shape remains unchanged when absent; bump package version to 1.2.0.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/relay/relay.ts Reads X-Error-Details from response headers and attaches it to thrown GlowNetworkError for relay rejections.
src/relay/network-error.ts Adds optional details field and conditionally augments the error message when details exist.
src/relay/relay.spec.ts Adds tests ensuring details propagation and unchanged messaging when header is absent.
package.json Bumps library version to 1.2.0.
package-lock.json Updates lockfile version fields to 1.2.0.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dmitry-salnikov dmitry-salnikov changed the title [BETA-2351] Carry relay X-Error-Details on GlowNetworkError Carry relay X-Error-Details on GlowNetworkError Aug 7, 2026
@dmitry-salnikov
dmitry-salnikov merged commit ea8d8c7 into main Aug 7, 2026
3 of 4 checks passed
@dmitry-salnikov
dmitry-salnikov deleted the relay-error-details branch August 7, 2026 16:23
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.

4 participants