Skip to content

fix: send Basic Auth header on TAP WebSocket handshake#2

Closed
Kzoeps wants to merge 2 commits intomainfrom
fix/tap-auth-issue
Closed

fix: send Basic Auth header on TAP WebSocket handshake#2
Kzoeps wants to merge 2 commits intomainfrom
fix/tap-auth-issue

Conversation

@Kzoeps
Copy link
Copy Markdown
Collaborator

@Kzoeps Kzoeps commented Apr 6, 2026

The TAP /channel WebSocket endpoint requires Basic Auth when TAP_ADMIN_PASSWORD is set. The consumer was sending no Authorization header, causing a 401 which gorilla/websocket surfaces as 'bad handshake'.

Wire cfg.TapAdminPassword into ConsumerConfig.Password and build the Authorization header in runOnce() before dialing, matching the pattern already used by AdminClient for HTTP requests.

The TAP /channel WebSocket endpoint requires Basic Auth when
TAP_ADMIN_PASSWORD is set. The consumer was sending no Authorization
header, causing a 401 which gorilla/websocket surfaces as 'bad handshake'.

Wire cfg.TapAdminPassword into ConsumerConfig.Password and build the
Authorization header in runOnce() before dialing, matching the pattern
already used by AdminClient for HTTP requests.
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hyperindex-atproto-client Ready Ready Preview, Comment Apr 7, 2026 5:12am

Request Review

…ecord drops

Three interconnected bugs caused health check failures when acks were enabled
and records to be silently dropped:

1. Empty-body create/update events caused hard ParseEvent errors → never acked
   → Tap's un-acked queue grew → Tap's /health degraded → Railway health check
   failed. Fix: allow these events to parse successfully; handler skips them
   gracefully (nothing to store without a body) and returns nil so they get acked.

2. Records with empty CID (Tap omits cid field on some events) were silently
   skipped by the Insert dedup check: existingCID("") == cid("") → Skipped.
   New records were never written to the DB. Fix: only skip when cid != "".
   Also log Skipped results at DEBUG for observability.

3. /health proxied to Tap's admin HTTP API, so any Tap restart/blip caused
   Railway to fail the health check and restart hyperindex. Fix: /health now
   reflects hyperindex's own health only. Tap sidecar status moves to /stats
   where it is visible but non-blocking.
@Kzoeps
Copy link
Copy Markdown
Collaborator Author

Kzoeps commented Apr 14, 2026

closing since #3 covers this as well

@Kzoeps Kzoeps closed this Apr 14, 2026
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.

1 participant