Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Dec 27, 2025

Please explain how to summarize this PR for the Changelog:

fix(plugin-record-hook): Errors during record hook execution are now properly propagated instead of being silently swallowed. Previously, errors were logged but the function would return normally, causing executions to appear successful even when record updates failed.

Tell code reviewer how and what to test:

Context: This fix addresses an issue where bulk record hook updates could fail silently. When event.update() failed, the error was caught, logged, and then the function returned without indicating failure. This caused agent executions to be marked as successful even when validation results weren't persisted.

Changes:

  1. Outer catch block: Changed from return to throw e so errors propagate to the listener runtime
  2. Inner catch block: Preserved the original error message instead of throwing a generic "Error updating records" message

Review checklist:

  • Verify this behavioral change is acceptable (errors now cause execution failures instead of silent success)
  • Consider if this warrants a major version bump as a breaking change
  • Note: The root cause of silent failures is in @flatfile/listener's AuthenticatedClient.fetch() which swallows errors. This fix helps surface errors that DO get thrown, but won't catch cases where fetch() silently returns undefined

To test:

  1. Create a record hook that processes records
  2. Simulate a failure in event.update() (e.g., network error, invalid data)
  3. Verify the error now propagates and marks the execution as failed

Requested by: christopher.harrison@flatfile.io (@cnharrison)

Previously, errors during record hook execution were caught, logged, and
then silently swallowed by returning early. This caused issues where
record updates could fail silently without surfacing the error to the
execution status.

Changes:
- Rethrow errors in the outer catch block so they propagate to the
  listener runtime and mark executions as failed
- Preserve the original error message when catching errors from
  event.update() for better debugging

Co-Authored-By: christopher.harrison@flatfile.io <cnharrison@gmail.com>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@cnharrison cnharrison closed this Dec 27, 2025
@promptless
Copy link

promptless bot commented Dec 27, 2025

📝 Documentation updates detected!

New suggestion: Add changelog entry for plugin-record-hook error propagation fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants