Commit 25bbe14
authored
feat(events): replaces notifications gate with Events API polling (#82)
* feat(events): replace notifications gate with Events API polling
- 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)
* chore: clean up notification references and update docs
- 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
* fix(poll): addresses review findings from Phase 4
- 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
* fix(poll): adds early return when all repos are on cooldown
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.
* test(events): adds unit and integration tests for events API polling
- 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
* test(dashboard): adds targeted merge integration tests
- 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)
* fix(poll): address PR review findings and harden events poll
- 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 paths1 parent 91dcf41 commit 25bbe14
18 files changed
Lines changed: 2061 additions & 968 deletions
File tree
- docs
- src/app
- components/dashboard
- lib
- pages
- services
- tests
- components
- settings
- lib
- services
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
129 | 128 | | |
130 | 129 | | |
131 | 130 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
59 | | - | |
| 58 | + | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
319 | | - | |
320 | | - | |
| 319 | + | |
| 320 | + | |
321 | 321 | | |
322 | | - | |
| 322 | + | |
323 | 323 | | |
324 | 324 | | |
325 | 325 | | |
| |||
473 | 473 | | |
474 | 474 | | |
475 | 475 | | |
476 | | - | |
| 476 | + | |
477 | 477 | | |
478 | 478 | | |
479 | 479 | | |
480 | 480 | | |
481 | 481 | | |
482 | | - | |
| 482 | + | |
483 | 483 | | |
484 | | - | |
| 484 | + | |
485 | 485 | | |
486 | 486 | | |
487 | 487 | | |
488 | | - | |
| 488 | + | |
489 | 489 | | |
490 | 490 | | |
491 | 491 | | |
| |||
0 commit comments