Avoid exception when fetching auth methods for an unpersisted trigger#4820
Open
midigofrank wants to merge 1 commit into
Open
Avoid exception when fetching auth methods for an unpersisted trigger#4820midigofrank wants to merge 1 commit into
midigofrank wants to merge 1 commit into
Conversation
request_trigger_auth_methods used Repo.get! to load the trigger, which raised Ecto.NoResultsError when the trigger only existed in the collaborative editor document and was not yet persisted. Query the webhook auth methods directly via the trigger association so an unpersisted trigger returns an empty list instead. Fixes #4819
Security Review ✅
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4820 +/- ##
=====================================
Coverage 90.3% 90.3%
=====================================
Files 442 442
Lines 22545 22545
=====================================
+ Hits 20350 20356 +6
+ Misses 2195 2189 -6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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
request_trigger_auth_methodsusedRepo.get!to load the trigger, which raisedEcto.NoResultsErrorwhen the trigger only existed in the collaborative editor document and was not yet persisted.This PR queries the webhook auth methods directly via the trigger association so an unpersisted trigger returns an empty list instead.
Fixes #4819
Validation steps
This is hard to reproduce given it happens in an async task and therefore doesn't bubble up to the UI.
AI Usage
Please disclose whether you've used AI anywhere in this PR (it's cool, we just
want to know!):
You can read more details in our
Responsible AI Policy
Pre-submission checklist
/reviewwith Claude Code)
(e.g.,
:owner,:admin,:editor,:viewer)