test: seed the stateful activity mock instead of scripting handlers - #613
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughChangesActivity integration behavior
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@libs/game/idle-client/src/worker/handle-request-resync-message.test.ts`:
- Around line 41-54: Update the test setup’s scheduleFlush callback and returned
flush helper to queue every scheduled flush callback instead of overwriting
capturedFlush. Ensure ctx.flush() drains all queued callbacks, preserving
multi-activity work even when later scheduleFlush calls occur before flushing.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 573fe20f-c7e0-47bb-9ea2-a836ed995d53
📒 Files selected for processing (4)
libs/game/idle-client/src/worker/handle-client-message.test.tslibs/game/idle-client/src/worker/handle-request-resync-message.test.tslibs/game/idle-client/src/worker/run-continuation.test.tslibs/testing/mock-services/src/activity/track-activity-progress.ts
There was a problem hiding this comment.
All reported issues were addressed
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Description
Moves idle-client's happy-path worker tests off per-test scripted oRPC handlers and onto the stateful
@vers/mock-servicesbackend: tests seeddbcollections and authenticate with a bearer whose subject owns the seeded avatar, so resyncs, continuations, and appends hit the same state transitions the real service applies.trackActivityProgressnow closes the stream (row →stopped) when a batch ends on a terminal checkpoint, matching the real service — without it a fast-forward's continuation start conflicts with its own just-finished row.run-fast-forward,create-checkpoint-submitter, worker-runtime's incidental stub).Testing
bun run typecheckpassesbun run testpassesbun run lintpasses