Description
Scheduled job (node-cron or BullMQ) to reconcile on-chain stream state with DB for active streams.
Requirements and context
- Backoff on RPC errors.
- Metrics: lag seconds.
Suggested execution
- Fork the repository and create a branch (example below).
- Implement changes in StreamPay-Backend (TypeScript / Express per
package.json).
- Keep the service secure, tested, and documented; prefer small, reviewable PRs.
git checkout -b feature/sync-job-chain-to-db
Implementation targets
src/jobs/syncStreamsJob.ts.
- Worker entry in
src/worker.ts if split process.
Tests and validation
-
Tests: mock RPC responses; reconciliation logic unit tests.
-
Run npm test and npm run lint in StreamPay-Backend.
-
Cover edge cases; include test output and brief security notes in the PR description.
Guidelines
- Target minimum 95% test coverage on new or changed backend code (or justify gaps).
- Clear documentation (OpenAPI / README / inline docs as specified).
- Timeframe: 96 hours from assignment.
Example commit message
feat(backend): periodic chain-to-DB stream sync job
Description
Scheduled job (node-cron or BullMQ) to reconcile on-chain stream state with DB for active streams.
Requirements and context
Suggested execution
package.json).Implementation targets
src/jobs/syncStreamsJob.ts.src/worker.tsif split process.Tests and validation
Tests: mock RPC responses; reconciliation logic unit tests.
Run
npm testandnpm run lintinStreamPay-Backend.Cover edge cases; include test output and brief security notes in the PR description.
Guidelines
Example commit message