feat(events): replaces notifications gate with Events API polling#82
Merged
wgordon17 merged 7 commits intogordon-code:mainfrom Apr 24, 2026
Merged
Conversation
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary