Skip to content

Allow mocking timers in tests - #33

Merged
simolus3 merged 2 commits into
mainfrom
connection-setup
Sep 15, 2026
Merged

simolus3 merged 2 commits into
mainfrom
connection-setup

Conversation

@simolus3

@simolus3 simolus3 commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

This refactors the sync retry delay to be based on sync options passed to the upload / download actors (instead of a field on the database). This is mostly a preparation for checkpoint requests: The current test timer implementation panics (and we carefully set a zero duration on existing tests with failures), but that won't work for the intentional checkpoint retry loop. So, this adds a simple mocked timer implementation we can forward manually.

As another small fix, this applies the cache size and busy timeout pragma on all connections instead of just on the writer. Closes #28.

AI use: Reviewed with Claude Code.

Comment thread powersync/src/db/pool.rs
@simolus3
simolus3 requested a review from Chriztiaan September 15, 2026 13:07
@simolus3
simolus3 merged commit 7d90bb1 into main Sep 15, 2026
7 checks passed
@simolus3
simolus3 deleted the connection-setup branch September 15, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ConnectionPool: reader connections have no busy_timeout while the writer has 30s

2 participants