Repository navigation
fix(workflows): name the workflow storage transactions - #30
Draft
NathanFlurry wants to merge 2 commits into
Draft
NathanFlurry wants to merge 2 commits into
NathanFlurry wants to merge 2 commits into
Conversation
RivetKit's SQLite profiler logs "SQLite transaction is unnamed" for each transaction shape that has no static name, so release-style workflows log it on their step storage writes. Name the driver's two transactions so the profiler can group their transaction, storage and commit performance across executions: - `workflow-batch-state`: live step writes committed with actor state - `workflow-batch`: control writes RivetKit 3.1.1 applies the name to `workflow-batch` today. It does not yet forward `name` for `experimental.includeState` transactions, so step writes keep logging the warning until RivetKit passes the name through. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The publish workflow created every GitHub release as a full release, so release candidates such as `1.0.0-rc.1` showed as regular releases and could take the "Latest" badge. Pass `--prerelease` when the version has a semver prerelease suffix. npm dist-tags are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
RivetKit 3.1's SQLite profiler logs a warning for each transaction shape that has no static
name:Release-style workflows log "SQLite transaction is unnamed" on every step's storage write, because
WorkflowStorage.batch()insrc/rivetkit/driver.tscallsdb.transaction()without a name. These are the package's onlytransaction()calls.Change
workflow-batch-statefor live step writes committed with actor state (experimental.includeState), andworkflow-batchfor control writes. The driver tests now assert the options passed todb.transaction().ci(release): the publish workflow now passes--prereleasetogh release createwhen the version has a semver prerelease suffix (for example1.1.2-rc.1). Previously, release candidates were created as full GitHub releases. npm dist-tag handling is unchanged.Limitation: RivetKit must accept a name for state transactions
In RivetKit 3.1.1 (and 3.1.2-rc.1),
db.transaction(cb, { experimental: { includeState: true } })callsbeginStateTransaction(timeout, scope)and dropsoptions.name. The native state transaction takes no name either. This PR passes the name anyway, so it takes effect once RivetKit forwards it; no further change is needed here.RivetKit's own actor bootstrap transactions are also unnamed and log the same warning once for each new actor, independent of this package.
Verification
I ran a minimal RivetKit 3.1.1 app with one
workflow()actor running three steps, and traced each driver transaction against the profiler output:workflow-batch)identity=workflow-batch), no warningworkflow-batch-state, includeState)Because a 1-row control write and a 1-row step write share a shape, the total warning count in this small app is unchanged until RivetKit forwards the state-transaction name.
pnpm lint,pnpm format:check,pnpm check:boundaries,pnpm check-types,pnpm test:e2e,pnpm buildandpnpm verify:packpass locally, and CI passes.tests/compat/upgrade.test.ts > pending-sleepfails identically onmainwhen the full suite runs on a loaded machine, and passes in isolation and in CI. The compat runner'sDate.nowadvances on every call, so extra clock reads under load shift the persisted timestamps.🤖 Generated with Claude Code