fix(event bus cron): cron event being marked as delivered after one successful run#2444
Open
viktormarinho wants to merge 1 commit intomainfrom
Open
fix(event bus cron): cron event being marked as delivered after one successful run#2444viktormarinho wants to merge 1 commit intomainfrom
delivered after one successful run#2444viktormarinho wants to merge 1 commit intomainfrom
Conversation
Contributor
🧪 BenchmarkShould we run the Virtual MCP strategy benchmark for this PR? React with 👍 to run the benchmark.
Benchmark will run on the next push after you react. |
Contributor
Release OptionsShould a new version be published when this PR is merged? React with an emoji to vote on the release type:
Current version: Deployment
|
Contributor
There was a problem hiding this comment.
1 issue found across 2 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="apps/mesh/src/event-bus/worker.ts">
<violation number="1" location="apps/mesh/src/event-bus/worker.ts:410">
P2: `markEventCompleted` unconditionally sets the event to `delivered`, which can overwrite a `failed` status when the final cron run fails. This hides delivery failures for the last cron cycle.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| `[EventBus] Cron expression for event ${event.id} has no more runs`, | ||
| ); | ||
| // Cron is exhausted — mark the event as delivered (terminal state) | ||
| await this.storage.markEventCompleted(event.id); |
Contributor
There was a problem hiding this comment.
P2: markEventCompleted unconditionally sets the event to delivered, which can overwrite a failed status when the final cron run fails. This hides delivery failures for the last cron cycle.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/mesh/src/event-bus/worker.ts, line 410:
<comment>`markEventCompleted` unconditionally sets the event to `delivered`, which can overwrite a `failed` status when the final cron run fails. This hides delivery failures for the last cron cycle.</comment>
<file context>
@@ -406,6 +406,8 @@ export class EventBusWorker {
`[EventBus] Cron expression for event ${event.id} has no more runs`,
);
+ // Cron is exhausted — mark the event as delivered (terminal state)
+ await this.storage.markEventCompleted(event.id);
return;
}
</file context>
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.
What is this contribution about?
Screenshots/Demonstration
How to Test
Migration Notes
Review Checklist
Summary by cubic
Fixes cron events being marked as delivered after the first run. Cron events now stay pending between deliveries and are only marked delivered when the schedule is exhausted.
Written for commit 8f5cf8a. Summary will update on new commits.