fix(rivetkit): fix sqlite teardown logic#4259
Conversation
|
🚅 Deployed to the rivet-pr-4259 environment in rivet-frontend
|
How to use the Graphite Merge QueueAdd the label merge-queue to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
PR Review: fix(rivetkit): fix sqlite teardown logicThis PR fixes a real correctness bug: Core Fix: connection-manager.tsThe key change is correct. Moving
for (const _conn of this.connectionManager.connections.values()) {
return CanSleep.ActiveConns; // always returns on first conn
}
if (this.connectionManager.pendingDisconnectCount > 0) {
return CanSleep.ActiveDisconnectCallbacks;
}The conn/mod.tsMoving db/mod.ts + db/drizzle/mod.tsThe Minor: The sqlite-runtime.ts
Minor: Potential concern: TestsThe new test in actor-db.ts correctly validates the fix by checking that a 250ms-delayed disconnect insert completes before the actor sleeps. The test uses timing ( One issue with the test: It doesn't explicitly disconnect — it relies on the actor's implicit sleep mechanism to trigger disconnect. If the actor doesn't sleep within The SummaryThe fix is correct and well-tested. The main things worth a follow-up:
|
65d3775 to
6840f4f
Compare
6840f4f to
63849b3
Compare
63849b3 to
6840f4f
Compare
6840f4f to
81946f1
Compare
81946f1 to
854e432
Compare
854e432 to
81946f1
Compare
81946f1 to
cdb63b8
Compare
cdb63b8 to
48bfc9a
Compare
48bfc9a to
81946f1
Compare
Merge activity
|
# Description Please include a summary of the changes and the related issue. Please also include relevant motivation and context. ## Type of change - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update ## How Has This Been Tested? Please describe the tests that you ran to verify your changes. ## Checklist: - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes
| import { afterEach, describe, expect, it } from "vitest"; | ||
| import { mkdtempSync, rmSync } from "node:fs"; | ||
| import { join } from "node:path"; | ||
| import { tmpdir } from "node:os"; |
There was a problem hiding this comment.
These import statements need to be sorted according to Biome's import sorting rules. Node.js built-in modules (fs, path, os) should typically come before other imports, and they should be alphabetically sorted.
Spotted by Graphite Agent (based on CI logs)
Is this helpful? React 👍 or 👎 to let us know.

Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist: