fix(docs): update all lifecycle hooks to use the new unified param object#2479
fix(docs): update all lifecycle hooks to use the new unified param object#2479
Conversation
|
WalkthroughThe documentation example in docs/guides/examples/sentry-error-tracking.mdx updates the onFailure callback signature from three positional parameters ( Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes ✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
docs/guides/examples/sentry-error-tracking.mdx (2)
59-66: Optional: add light redaction and use Scope to avoid oversized/PII payloads.Raw
payload/ctxcan be large or contain secrets. Consider setting sanitized extras on a Scope.
Example diff within this block:- Sentry.captureException(error, { - extra: { - payload, - ctx, - }, - }); + Sentry.withScope((scope) => { + scope.setExtras({ + // TODO: redact or truncate sensitive/large fields + payload, + ctx, + }); + Sentry.captureException(error); + });Sentry supports both passing
extraand configuring aScope. (docs.sentry.io)
50-58: Optional: consider v4-style global hooks in init.ts.In v4 you can register global lifecycle hooks anywhere (e.g.,
trigger/init.ts). For discoverability, you might move Sentry init there and/or usetasks.onFailure(({ error, payload, ctx }) => ...)as an alternative to config-level hooks.
Reference: v4 global hooks andinit.ts. (trigger.dev)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
docs/guides/examples/sentry-error-tracking.mdx(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (1)
docs/guides/examples/sentry-error-tracking.mdx (1)
59-66: v4 hook signature change looks correct; keep as destructured args.Trigger.dev v4 unifies lifecycle hook params into a single destructured object. Your
onFailure: async ({ payload, error, ctx }) => { ... }matches the v4 API. Also, passingextradirectly toSentry.captureExceptionis supported by the JS SDK.
References: v4 upgrade notes (unified lifecycle hook args). (trigger.dev) Sentry docs (allowed context keys incl.extra). (docs.sentry.io)
No description provided.