Skip to content

test: webhook UUID resolution + fix sse.test.ts Set regression (#3129) - #3233

Open
Shan7Usmani wants to merge 1 commit into
Priyanshu-byte-coder:mainfrom
Shan7Usmani:fix/3129-webhook-sse-uuid-resolution
Open

test: webhook UUID resolution + fix sse.test.ts Set regression (#3129)#3233
Shan7Usmani wants to merge 1 commit into
Priyanshu-byte-coder:mainfrom
Shan7Usmani:fix/3129-webhook-sse-uuid-resolution

Conversation

@Shan7Usmani

Copy link
Copy Markdown

Summary

Adds tests verifying the GitHub webhook POST handler resolves githubLogin to the database UUID before calling sendSSEEvent, and fixes a pre-existing regression in sse.test.ts where the sseConnections registry changed to Map<string, Set> but tests still stored plain controller objects.

Changes

  • ** est/webhook-sse-integration.test.ts** (new) — 8 tests covering:
    • Webhook resolves githubLogin → database UUID via markUserMetricsStale
    • sendSSEEvent is called with the resolved UUID, not the raw githubLogin
    • Linked account fallback when primary user not found
    • No SSE event when user lookup returns null
    • Payload includes repo name and timestamp
    • Rejects events when webhook secret is missing or signature is invalid
    • Ignores non-push events
  • ** est/sse.test.ts** — Fixed 4 failing tests that stored plain controller objects in sseConnections instead of Set, matching the multi-tab connection support added for [FEAT] : Broken Real-Time SSE Dashboard Updates #3129

Acceptance Criteria (from issue)

  • ✅ sseConnections successfully registers the active stream controller when a client connects (covered by existing sse-stream-route.test.ts)
  • ✅ Disconnecting removes the controller from sseConnections (covered by existing sse-stream-route.test.ts)
  • ✅ Webhook route queries the database to map githubLogin → database UUID (new tests)
  • ✅ sendSSEEvent is called with the resolved UUID (new tests)
  • ✅ Unit tests verify connection registration, payload routing via database UUIDs, and cleanup on socket close (all covered)

Related

Closes #3129

- Add 8 tests verifying webhook POST handler resolves githubLogin to
  database UUID before calling sendSSEEvent (fixes Priyanshu-byte-coder#3129)
- Fix sse.test.ts: update sendSSEEvent tests to use Set<Controller>
  registry pattern instead of plain controller object
- Covers acceptance criteria: connection registration, payload routing
  via database UUIDs, and proper cleanup on socket close
@github-actions github-actions Bot added gssoc26 GSSoC 2026 contribution type:design GSSoC type bonus: UI/design (+10 pts) type:testing GSSoC type bonus: tests (+10 pts) labels Jul 25, 2026
@github-actions

Copy link
Copy Markdown

GSSoC Label Checklist 🏷️

@Priyanshu-byte-coder — please apply the appropriate labels before merging:

Difficulty (pick one):

  • level:beginner — 20 pts
  • level:intermediate — 35 pts
  • level:advanced — 55 pts
  • level:critical — 80 pts

Quality (optional):

  • quality:clean — ×1.2 multiplier
  • quality:exceptional — ×1.5 multiplier

Validation (required to score):

  • gssoc:approved — counts for points
  • gssoc:invalid / gssoc:spam / gssoc:ai-slop — does not score

Type labels (type:*) are auto-detected from files and title. Review and adjust if needed.
Points formula: (difficulty × quality_multiplier) + type_bonus

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc26 GSSoC 2026 contribution type:design GSSoC type bonus: UI/design (+10 pts) type:testing GSSoC type bonus: tests (+10 pts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] : Broken Real-Time SSE Dashboard Updates

1 participant