Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Flaky: models.dev refresh 'lets one of two runs at the same time work' on Postgres (#548-T03)

Open Beginner friendly
#584 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
83/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
postgresql, typescript
Domain
database, testing

Research direction

Start with app/src/models-dev/service.integration.test.ts and the named test, then inspect how its fake fetch and the two refresh() calls are coordinated. Make the first fetch remain pending until the second call returns skipped, so the overlap is deterministic. Done when the test consistently gets one applied and one skipped result.

Written by the indexing model from the issue text.

Description

area: app type: bug

app/src/models-dev/service.integration.test.ts > "the models.dev fetch on postgres" > "lets one of two runs at the same time work and answers the other at once" (// #548-T03) fails now and then.

Seen: 1 in 4 runs against a throwaway Postgres 18 (embedded-postgres, fsync=off, 2 vitest workers on a 4-core machine); the other runs of the same file were green (74/74). Found while working on #555 (PR #579), which does not touch src/models-dev/.

Failure:

expect(outcomes.map((o) => o.status).sort()).toEqual(["applied", "skipped"])
- "skipped"
+ "applied"

Both refresh() calls ended applied: the first run was already done (lock released) before the second one asked, so the second took the lock too. The test assumes the two calls overlap, which depends on timing.

Suggested fix: make the overlap deterministic (hold the first fetch open on the fake, for example a scripted hang released after the second call answered skipped) instead of relying on Promise.all timing.

Dominant language
TypeScript
Stars
0
Forks
1
Avg merge
1h 18m
Merged PRs (30d)
284

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ExpidetGames/code-reviewer

All issues in ExpidetGames/code-reviewer

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.