Skip to content

fix(api): log notification task errors via log_exception instead of print - #10185

Merged
sriramveeraghanta merged 1 commit into
makeplane:previewfrom
Krish6115:fix/notification-task-log-exception
Nov 23, 2026
Merged

sriramveeraghanta merged 1 commit into
makeplane:previewfrom
Krish6115:fix/notification-task-log-exception

Conversation

@Krish6115

@Krish6115 Krish6115 commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Description

notification_task swallowed errors with print(e), which bypasses the worker's logging configuration and drops the traceback. Uses the existing log_exception helper (as webhook_task and the other bgtasks do) so failures reach the plane.exception logger.

Type of Change

  • Improvement (change that would cause existing functionality to not work as expected)

Test Scenarios

Syntax-checked the module. The task still returns on error as before.

Summary by CodeRabbit

  • Bug Fixes
    • Errors encountered during notification processing are now recorded through the application’s logging system instead of being printed directly. Notification behavior remains unchanged.
    • This improves how processing errors are captured for troubleshooting; it does not change the notifications users receive.

Copilot AI balanced review requested due to automatic review settings November 3, 2026 14:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

The notification task now reports caught exceptions with log_exception instead of printing them. Other notification behavior is unchanged.

Changes: Notification exception logging

Layer / File(s) Summary
Report notification exceptions
apps/api/plane/bgtasks/notification_task.py
The task imports log_exception and uses it in the notifications exception handler instead of print(e).

Estimated code review effort: 1 (Trivial) | ~4 minutes

Change: Bug fix

Suggested reviewers: dheeru0198

Merge Risk: Minimal · up to f0ba5

The change routes notification errors through the existing exception logger without changing notification behavior. No merge-blocking issue is identified.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title names the main change: notification task errors are now logged through log_exception instead of print. It matches the raw summary, which describes replacing print(e) with log_exception in no…
Description check Passed The description states the problem (print(e) bypasses logging configuration and drops the traceback) and the fix (use the existing log_exception helper so failures reach the plane.exception logger). I…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: notification task errors are now logged through log_exception instead of print. It matches the raw summary, which describes replacing print(e) with log_exception in notification_task.py. The title follows a conventional commit style and is 73 characters long.

Full details: Description check

Explanation

The description states the problem (print(e) bypasses logging configuration and drops the traceback) and the fix (use the existing log_exception helper so failures reach the plane.exception logger). It also gives the change type, marking Improvement. The template's Screenshots and References sections are absent, and the Type of Change list is partly filled, with only one box checked. The Test Scenarios section is brief: it says the module was syntax-checked and the task still returns on error. The sections that matter for this change are present, so the description is mostly complete.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f0b383fc-76e4-4d7c-a074-4dddbf825653
Commits

Reviewing files that changed from the base of the PR and between bc65a78 and f0ba54e.

Files selected for processing: 1
  • apps/api/plane/bgtasks/notification_task.py

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.

@Krish6115

Copy link
Copy Markdown
Contributor Author

Hi @pablohashescobar, whenever you have some free time, could you please review this PR? It's a small change. Happy to make any adjustments needed. Thanks!

@Krish6115

Copy link
Copy Markdown
Contributor Author

Hi @sriramveeraghanta, thanks for merging my earlier PRs. Whenever you get a chance, could you take a look at this one too? Happy to make any changes needed.

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.

3 participants