Skip to content

fix(worker): Ensure notification results are serializable#821

Open
sentry[bot] wants to merge 1 commit intomainfrom
seer/fix/serializable-notification-results
Open

fix(worker): Ensure notification results are serializable#821
sentry[bot] wants to merge 1 commit intomainfrom
seer/fix/serializable-notification-results

Conversation

@sentry
Copy link
Copy Markdown
Contributor

@sentry sentry bot commented Apr 15, 2026

Fixes WORKER-Y7S. The issue was that: Celery's JSON serializer failed to encode NotificationResult dataclasses within the task's large return value, exacerbated by a soft time limit.

  • Modified the return value of the notification processing logic.
  • Transformed the 'notifications' list to ensure all its elements, especially the 'result' field, are serializable.
  • Converted the 'result' object within each notification to a dictionary using its 'to_dict()' method before returning.

This fix was generated by Seer in Sentry, triggered automatically. 👁️ Run ID: 13338997

Not quite right? Click here to continue debugging with Seer.

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.


Note

Low Risk
Low risk: only changes the Celery task return payload shape by converting NotificationResult objects to plain dicts, with no impact on notification sending logic.

Overview
Ensures NotifyTask returns a JSON-serializable result by transforming the notifications list before returning from run_impl_within_lock.

Each notification now returns only notifier, title, and a serialized result (via NotificationResult.to_dict()), preventing Celery JSON serialization failures when result is a dataclass.

Reviewed by Cursor Bugbot for commit 7ef35cd. Bugbot is set up for automated code reviews on this repo. Configure here.

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.

0 participants