Skip to content

feat(watcher): surface subscription errors via subscriptionError event#93

Merged
zeevdr merged 2 commits into
mainfrom
feat/watcher-subscription-errors
May 25, 2026
Merged

feat(watcher): surface subscription errors via subscriptionError event#93
zeevdr merged 2 commits into
mainfrom
feat/watcher-subscription-errors

Conversation

@zeevdr
Copy link
Copy Markdown
Member

@zeevdr zeevdr commented May 25, 2026

Summary

  • ConfigWatcher now extends EventEmitter and emits a 'subscriptionError' event on every Subscribe stream error, giving callers visibility into connection health without requiring polling or log scraping.
  • Both retryable errors (UNAVAILABLE, INTERNAL — watcher reconnects) and fatal errors (all others — watcher stops) are surfaced so callers can distinguish transient blips from permanent failures.
  • The ConfigWatcherEvents interface is exported for consumers that want fully-typed listener signatures.

Test plan

  • Unit tests added for retryable error emission (status.UNAVAILABLE)
  • Unit tests added for fatal error emission (status.PERMISSION_DENIED)
  • All 221 existing tests pass (npm test)
  • Build clean (npm run build)
  • Lint clean (npx biome check src/ test/)

Closes #61

@zeevdr zeevdr added this to the Beta Readiness milestone May 25, 2026
@zeevdr zeevdr added size: S Quick win — a few hours or less priority: P1 Current milestone work labels May 25, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

zeevdr and others added 2 commits May 25, 2026 12:53
ConfigWatcher now extends EventEmitter and emits a typed
'subscriptionError' event whenever the Subscribe stream encounters an
error. Both retryable errors (UNAVAILABLE, INTERNAL — which trigger
reconnection) and fatal errors (all others — which stop the watcher)
are surfaced, letting callers log or monitor connection health without
polling.

The ConfigWatcherEvents interface is exported for consumers that want
typed listener signatures. The 'subscriptionError' name is intentional:
using 'error' would throw on unhandled listeners per Node.js convention.

Closes #61

Co-Authored-By: Claude <noreply@anthropic.com>
…ener test

Co-Authored-By: Claude <noreply@anthropic.com>
@zeevdr zeevdr force-pushed the feat/watcher-subscription-errors branch from db04e32 to 8edbcad Compare May 25, 2026 09:54
@zeevdr zeevdr merged commit 3f89d85 into main May 25, 2026
13 checks passed
@zeevdr zeevdr deleted the feat/watcher-subscription-errors branch May 25, 2026 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: P1 Current milestone work size: S Quick win — a few hours or less

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Watcher: surface non-fatal subscription errors to caller

1 participant