useOracleClock: return advance(ms), and fake performance (or document what it fakes)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 32/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- javascript
- Domain
- testing
Research direction
Start in src/oracle-property.ts near the toFake list (around line 1070), which covers setTimeout, setInterval, and Date but not performance. Then read the framework self-oracle's controlled-clock law, since the issue requires an oracle-first change (P9) before the code change. Done means useOracleClock returns advance(ms), performance is either faked or its fakes are listed in the JSDoc, and the self-oracle passes.
Written by the indexing model from the issue text.
Description
Reported from an adopter's first session, at c58b0c2. Not yet reproduced here.
(a) Add an advance(ms) helper. useOracleClock should return advance(ms). Then drivers never import their own vi, which also avoids the problem in the two-Vitest-copies issue.
(b) Fake performance. Today toFake covers setTimeout, clearTimeout, setInterval, clearInterval and Date (src/oracle-property.ts around line 1070). In the adopter's client, a deadline timer re-checks performance.now(), so a virtual timeout kept re-arming until real time caught up. Their workaround: vi.spyOn(performance, 'now').mockImplementation(() => Date.now()). Add performance to toFake, or at least list in the JSDoc exactly what it fakes.
This is a framework change, so it needs an oracle-first change (P9) to the framework self-oracle's controlled-clock law.
This issue was written by Isaac.
- Dominant language
- JavaScript
- Stars
- 5
- Forks
- 1
- Avg merge
- 6h
- Merged PRs (30d)
- 56
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
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 TanStack/oracles
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
TanStack/oracles#120 · 1 comment ·
Maintainers usually reply within 1 day
-
windows
Difficulty 4/5 3-5 days Newbie friendliness 48/100
TanStack/oracles#118 · 1 comment ·
Maintainers usually reply within 1 day
All issues in TanStack/oracles
Similar issues
-
Edit: Telemante [YT]Openchannels:edit check:passed
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
fix
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
idean3885/claude-ops-agent#1083 ·
Maintainers usually reply within 1 day
-
入群码过期Open
Difficulty 1/5 Under an hour Newbie friendliness 84/100
aliyun/ai-agent-handbook#29 · 1 comment ·
-
docs documentation need-triage SaaS
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
apache/cloudstack#14719 ·
Maintainers usually reply within 1 day