Skip to content

feat: improve logs for archive error#1233

Merged
riderx merged 2 commits into
mainfrom
improve_logs_for_archive_error
Oct 24, 2025
Merged

feat: improve logs for archive error#1233
riderx merged 2 commits into
mainfrom
improve_logs_for_archive_error

Conversation

@WcaleNieWolny
Copy link
Copy Markdown
Contributor

@WcaleNieWolny WcaleNieWolny commented Oct 24, 2025

Summary by CodeRabbit

  • Bug Fixes
    • Improved error handling and logging for queue message processing with enhanced context and more detailed error messages.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Oct 24, 2025

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Error handling in the queue consumer's archive_queue_messages function is enhanced to extract error details, truncate message IDs for logging, emit structured error logs with contextual information, and throw updated errors with more informative messages.

Changes

Cohort / File(s) Summary
Error Handling Enhancement
supabase/functions/_backend/triggers/queue_consumer.ts
Enhanced error handling in archive_queue_messages: derives errorMessage and errorStack from errors, truncates msgIds to maximum 20 for logging, emits cloudlogErr with detailed context (requestId, queueName, errorMessage, errorStack, msgIds, lengths), and throws error with updated message and payload containing truncated message IDs.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Hops of joy through error paths,
Where logs now capture all the math,
Truncate, emit, and throw with care,
Better debugging everywhere! 🎉

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request description is completely empty with no content provided by the author. The repository template requires multiple sections including Summary, Test plan, Screenshots (optional for backend), and a Checklist. Without any description, the PR lacks critical information about the change's purpose, how to test it, and verification that the author followed project standards and tested their code manually. The author should provide a complete pull request description following the template. At minimum, they must include a Summary section explaining the logging improvements and a Test plan section documenting how the changes can be tested. The Checklist section should be completed to confirm code style compliance, testing coverage, and manual verification of the changes.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title "feat: improve logs for archive error" directly aligns with the main change described in the summary, which enhances error handling and logging in the archive_queue_messages function. The title is concise, specific to the primary change, and clearly communicates to reviewers that this PR focuses on improving error logs for archive-related operations. It uses standard conventional commit formatting and avoids vague terminology.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link
Copy Markdown

@riderx riderx merged commit 4ea9f7b into main Oct 24, 2025
11 of 12 checks passed
@riderx riderx deleted the improve_logs_for_archive_error branch October 24, 2025 20:09
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