Skip to content

2001105254-netizen/RacePulsePH / .agents/skills/racepulse-realtime-delivery

racepulse-realtime-delivery

Verified

Choose and maintain RacePulsePH live update channels across Firestore onSnapshot listeners, LAN HTTP polling in useDualSync and RFID bridge polling. Use when adding or modifying live rankings, broadcast screens, engraving queues or checkpoint scan feeds.

RacePulse real-time delivery channels

Keep live leaderboards, operator dashboards and RFID scan feeds responsive while preventing listener leaks, duplicate subscriptions and unnecessary cloud reads. Covers src/lib/dualSync.ts, src/lib/liveBroadcast.ts, src/components/LiveRankingsScreen.tsx and server.ts.

Load with: racepulse-data-integrity, racepulse-delivery-performance. Rules upheld: C-2, C-4, C-5, R-02, R-35, R-36. Detail: listener lifecycle and transport selection.

Checklist

CheckReasonEvidence
Always return the unsubscribe() cleanup function and clearInterval timer from every useEffect that opens onSnapshot or a LAN pollerUnclosed listeners leak memory and multiply Firestore billable reads when operators switch tabsInspect cleanup returns in src/lib/dualSync.ts lines 78 and 105 to 108
Gate onSnapshot and LAN polling behind an explicit enabled flag and re-subscribe on access version changesPrevents unauthorized or backgrounded panels from polling endpoints they do not needInspect enabled and version handling in src/lib/dualSync.ts lines 32 to 34 and 68 to 80
Provide an error callback on every onSnapshot subscription so offline or permission errors degrade gracefully instead of throwing unhandled rejectionsUnhandled onSnapshot errors crash the listener when Firestore rules deny a query or the network dropsInspect the error handler in src/lib/dualSync.ts lines 75 to 77
Use useDualSync (onSnapshot + 2000ms LAN poll) for hybrid cloud/LAN collections (orders, chipReads) rather than inventing ad-hoc WebSocketsReuses the tested conflict-resolution and LAN health indicator across all operational screensInspect src/lib/dualSync.ts and its callers in src/components/
Keep public live rankings and broadcast screens on scoped Firestore snapshots with in-memory sorting (src/lib/liveRankings.ts, src/lib/liveBroadcast.ts)Spectators outside the venue LAN reach only Firebase cloud endpointsInspect src/lib/liveRankings.ts, src/lib/liveBroadcast.ts and src/components/LiveRankingsScreen.tsx

Stack mapping

  • WebSockets / Server-Sent Events in generic architectures map to Cloud Firestore onSnapshot persistent streams (src/lib/dualSync.ts, src/lib/liveBroadcast.ts) for cloud clients.
  • Short/long polling maps to the 2000ms LAN Express poller in src/lib/dualSync.ts and the 12000ms offline queue retry loop in src/lib/offlineScanQueue.ts.

Not covered

  • Timestamp tie-breaking and 7-digit tick math belong to racepulse-reliability-dr.

Verify

  1. Run npm run lint and node --test tests/timing-sequence.test.cjs.
  2. Inspect every onSnapshot and setInterval in src/ to confirm cleanup functions and error callbacks are present, then output the PASS/FAIL report.
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall