The oracle comparison clean-up job is written and never started
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- postgresql, redis, typescript
- Domain
- backend, databases, distributed-systems, testing
Research direction
Read src/jobs/oracleRetention.ts and the “Lending rate retention” block in src/index.ts (lines 220–249), then inspect src/__tests__/oracleRetention.test.ts for the existing test patterns. Wire startup pruning and the queue/worker into main(), with an hourly unref'd timer fallback if queue creation fails. Done when tests cover the startup wiring and Redis fallback, prune failures are logged without stopping the service, and old rows are pruned hourly.
Written by the indexing model from the issue text.
Description
Background
src/jobs/oracleRetention.ts is a complete retention job for the
oracle_comparisons table. It has a batched delete
(pruneOldOracleComparisons), a per-network wrapper
(pruneAllNetworksOracleComparisons), a queue, a worker and a schedule
(createOracleRetentionQueue, startOracleRetentionWorker,
scheduleOracleRetention). It has a test, src/__tests__/oracleRetention.test.ts.
Nothing calls it. src/index.ts starts the snapshot, lending-rate and
partition jobs, but it never imports oracleRetention. A search of src/ and
scripts/ finds no caller outside the file itself.
Meanwhile src/services/oracleComparison.ts (line 173) inserts into
oracle_comparisons on every comparison run. So the table only grows.
What to build
Start the job from main() in src/index.ts, the same way the lending-rate
job is started a few lines above:
- run one prune at boot, inside a
try/catchthat logs and continues; - try to start the queue and worker;
- if Redis is not available, close what was created and fall back to an hourly
in-process timer with.unref().
Redis being down must not stop the service and must not stop the pruning.
Where to look
src/jobs/oracleRetention.tssrc/index.ts, the "Lending rate retention" block (lines 220–249) as the
pattern to copydocs/RUNBOOK.mdif it lists the background jobs
Done when
-
oracle_comparisonsrows older thanORACLE_COMPARISON_RETENTION_DAYS
are removed on a running instance (show this on a local database) - The job still runs hourly when Redis is down
- A failed prune is logged and does not crash the process
- A test covers the wiring (job started, fallback used when the queue
cannot be created)
Drips Wave · Complexity: Easy · 100 points
Repo: Divinity-Labs/Lens. Install with npm ci, typecheck with
npx tsc --noEmit, test with npm test. Tests are vitest, not jest.
Running jest reports zero tests and proves nothing.
You cannot reach production. Contributors have no access to the deployed
service or its database. Everything must be provable on your own machine. The
Postgres and Redis in docker-compose.yml are enough.
Five generated files are compared byte for byte: openapi.json /
openapi.yaml, the generated tables in README.md, schema.graphql,
clients/typescript/src/schema.d.ts, and the Prisma baseline
prisma/migrations/0_init/migration.sql. The commands that regenerate them are
in the scripts section of package.json (openapi:gen, readme:gen,
graphql:schema:gen, client:gen) and in docs/database-migrations.md. If a
guard fails and the diff looks identical, it is Windows line endings (CRLF),
not your change.
The database is migrated with prisma migrate deploy. Never use
prisma db push. A change to prisma/schema.prisma needs a new migration
folder and a regenerated baseline, or CI fails. Schema drift is not repaired at
start-up any more.
Start-up must stay forgiving. A boot-time check must never stop the whole
service because one optional dependency (Redis, one network's RPC, one venue)
is down. Report it, do not exit.
A CI job that fails at the install step hides every later step. If your
change touches dependencies, check that the steps after install really ran.
Do not weaken a test to make it pass. Never put a secret, a connection
string, or an RPC URL that contains an API key in code, logs, tests or the PR.
Never shorten a Stellar address or contract id; copy it whole from the repo.
Required: Before submitting, join the contributor Telegram so your work can be tracked and counted toward the Stellar Wave: https://t.me/+fxHXq8f1SwlkZDBk
- Dominant language
- TypeScript
- Stars
- 4
- Forks
- 71
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 24
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Divinity-Labs/Lens
-
`/price/:assetA/:assetB/history` turns a bad `limit` into a 500 and an unknown pair into an empty 200Possibly taken @I-frenzy claimed this today. Openarea:api difficulty:easy help wanted points:100 Stellar Wave
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
Divinity-Labs/Lens#664 ·
Maintainers usually reply within 3 days
-
area:reliability difficulty:easy help wanted points:100 Stellar Wave
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Divinity-Labs/Lens#663 · 1 comment ·
Maintainers usually reply within 3 days
-
`/status?network=mainnet` is rate limited although `/status` is exemptPossibly taken @Joyful12-tech claimed this 1 day ago. Openarea:reliability difficulty:easy help wanted points:100 Stellar Wave
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Divinity-Labs/Lens#662 ·
Maintainers usually reply within 3 days
-
area:ingest difficulty:easy help wanted points:100 Stellar Wave
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Divinity-Labs/Lens#633 ·
Maintainers usually reply within 3 days
-
Webhook retries have no jitter, so failures synchronisePossibly taken @Richard-tobi claimed this 35 days ago. Openarea:reliability difficulty:easy help wanted points:100 Stellar Wave
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
Divinity-Labs/Lens#341 · 2 comments · 1 assignee ·
Maintainers usually reply within 3 days
All issues in Divinity-Labs/Lens
Similar issues
-
[功能请求] 设置选项语言调整Open功能请求
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
antithesishq/bombadil#473 ·
Maintainers usually reply within 2 days
-
The structured output reference promises null results for refusals that carry validation detailsOpenbug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
mattermost/mattermost-mobile#10358 ·
Maintainers usually reply within 1 day
-
ready-for-agent
Difficulty 1/5 Under an hour Newbie friendliness 86/100
LucasSantana-Dev/Lucky#3257 ·
Maintainers usually reply within 1 day