Repository navigation
Conversation
Deleting a draft cascades to its `discovers` rows but not to their `internal.tasks` rows, so `DiscoverExecutor` failed to load the row and the automations server retried the task after every heartbeat timeout, indefinitely. When the lookup finds no row, the task now completes with `Action::Done` and is removed without invoking the connector: * Other database errors still fail the attempt, and the task is retried * A draft deleted mid-discover fails that attempt; the next attempt removes the task
This was referenced Sep 30, 2026
This branch has not been 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.
Description:
Deleting a draft cascades to its
discoversrows, but their tasks remain ininternal.tasks.DiscoverExecutorthen fails to load thediscoversrow on every attempt, and the automations server retries the task after each heartbeat timeout, indefinitely.When
fetch_discoverfinds no row, the executor now returnsDiscoverOutcome::Deleted, which applies asAction::Doneand removes the task. The connector is not invoked. Other database errors propagate as before, so the task is kept and retried.If the draft is deleted while a discover is running, that attempt still fails when applying its results, since the draft and
discoversrows are gone. The next attempt, after the heartbeat timeout, finds nodiscoversrow and removes the task. Tasks orphaned before this change are removed the same way on their next retry.Workflow steps:
No user-facing change.
Documentation links affected:
None.
Notes for reviewers:
fetch_discovernow returnsOption<Row>, matchingfetch_alert_by_id. The query text is unchanged, so.sqlx/needs no update.Action::Doneonly removes a task that ends up suspended. A task with unconsumed inbox messages is re-polled instead.integration_tests/user_discovers.rscompareinternal.tasksbefore and after each attempt:discovers:ObjSafe::pollreturns the error, the task is kept, and a later attempt succeeds.discovers.rsanduser_discovers.rs. The branches change different regions of both files and merge without conflicts.