Skip to content

feat(events): replaces notifications gate with Events API polling#82

Merged
wgordon17 merged 7 commits intogordon-code:mainfrom
wgordon17:feat/events-api-polling
Apr 24, 2026
Merged

feat(events): replaces notifications gate with Events API polling#82
wgordon17 merged 7 commits intogordon-code:mainfrom
wgordon17:feat/events-api-polling

Conversation

@wgordon17
Copy link
Copy Markdown
Member

Summary

  • Replaces broken notifications API gate with 60s Events API polling loop using ETag conditional requests
  • Adds targeted per-repo refreshes with ID-based dedup, surfacedBy union, and hot set seeding
  • Removes notifications OAuth scope, cleans up all notification gate references across code and docs

- Add events.ts with fetchUserEvents(), parseRepoEvents(), ETag management
- Remove notifications gate: hasNotificationChanges, skipped field, background
  tab gating, notification 403 handler, POLL_MANAGED_SOURCES entry
- Add createEventsPollCoordinator with 60s setTimeout chain, dual race guards
- Add fetchTargetedRepoData with MAX_TARGETED_REPOS=10 cap (SEC-IMPL-003)
- Add seedHotSetsFromTargeted for additive hot set population
- Wire targeted merge in DashboardPage with ID-based dedup, surfacedBy union
- Delete poll-notification-effects.test.ts (all tests were notification gate)
- Remove notifications OAuth scope from oauth.ts
- Remove notifications scope UI from LoginPage.tsx
- Replace notifications API source with userEvents in api-usage.ts
- Update DEPLOY.md, README.md, USER_GUIDE.md notification references
- Update test mocks and assertions for the source rename
- Captures cache snapshot eagerly before setTimeout (CR-001/PERF-001)
- Adds per-repo 2-min cooldown to prevent API amplification (PERF-004)
- Adds parts.length guard in fetchTargetedRepoData (SEC-004)
- Wires resetEventsState into resetPollState for test isolation (CR-010)
- Removes stale notification references from README and USER_GUIDE
- Fixes ApiUsageSection test mock for notifications→userEvents rename
STRUCT-012: fetchTargetedRepoData now returns empty data immediately
when cooldown filtering removes all repos, avoiding unnecessary
GraphQL/REST calls and no-op merge pipeline execution.
- events.test.ts: 22 tests for fetchUserEvents (ETag, 304, first-call,
  numeric ID dedup, empty username guard) and parseRepoEvents (filtering,
  flags, case-insensitive matching, timestamps)
- events-poll.test.ts: 22 tests for fetchTargetedRepoData (scoped repos,
  workflow activity filter, cooldown, cap, malformed names),
  seedHotSetsFromTargeted (pending guard, enriched guard, additive only,
  generation preservation), and config-change effects
- Tracked-user item preservation across targeted refresh
- surfacedBy annotation union merging
- detectNewItems + dispatchNotifications called after merge
- seedHotSetsFromTargeted called (not rebuildHotSets)
- MCP relay exclusion (lastRefreshedAt unchanged)
- Extract handleTargetedData to named module-scope function
- Fix fetchUserEvents changed flag on empty first call
- Reset consecutiveFailures on non-error skip paths
- Add isFullRefreshing re-check after fetchTargetedRepoData
- Add user login reactive effect to reset events ETag state
- Remove redundant lowercase Set copy in parseRepoEvents
- Rename trackedRepoNames to getTrackedRepoNames
- Fix indentation in pollFetch if/else block
- Replace plan-tag comments with descriptive WHY comments
- Add EVENTS_POLL_INTERVAL_MS explanatory comment
- Strengthen surfacedBy union tests with value assertions
- Add 13 new tests covering untested code paths
@wgordon17 wgordon17 marked this pull request as ready for review April 24, 2026 18:35
@wgordon17 wgordon17 merged commit 25bbe14 into gordon-code:main Apr 24, 2026
1 check passed
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