Repository navigation
Conversation
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.
Fixes Effect-TS/effect#5960
Fixes #6
With SQL message storage and calculateNextRunFromPrevious: true, ClusterCron stops running after a pod restart. InitialRun sends a message with a fixed entity id and empty primary key, so the same message_id is used every time. SQL storage deduplicates on message_id and ignores the duplicate on restart, so the cron chain never picks up again.
This change makes the InitialRun message use a unique message_id on each start so it’s no longer treated as a duplicate after restart.
Added a test that runs the cluster twice against the same SQLite DB (simulating a restart) and checks that the second run still executes the cron at least once. Also fixed the pg/mysql test fixtures (proper re-exports) and tightened SqlMessageStorage tests (truncate + outcome-based duplicate assertion).
SqlMessageStorage / SqlRunnerStorage: Only the sqlite dialect runs in this package; pg/mysql are skipped here to avoid cross-package test deps and dialect flakiness (they’re covered in their own packages). Short comments in both files explain this.
Fixtures: Removed test/fixtures/utils-mysql.ts and utils-pg.ts; cluster tests no longer depend on other packages’ test utils.
tsconfig: Cluster tsconfig.test.json is back to include: ["test"] and rootDir: "test"] (no sibling package includes).
CI: Dropped the unused “Set cluster-only when only cluster package changed” step and the full clone (fetch-depth: 0); Test job uses the default checkout again.
ClusterWorkflowEngine: Two tests that were hitting the 5s default timeout now use a 15s timeout so they pass reliably.
Types: Dialect layers use inferred types (as const) instead of a forced Layer<unknown, ...> so tsc -b passes.