fix: improve error labelling, grouping, and stack traces in the Errors feature#4225
Conversation
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✅ Files skipped from review due to trivial changes (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📜 Recent review details⏰ Context from checks skipped due to timeout. (24)
WalkthroughError fingerprinting now falls back from an error message to its name or raw value, with tests covering grouping and precedence behavior. ClickHouse materialized views now derive error types, messages, and stack traces from updated error JSON fields, while migration down steps restore the previous derivation rules. A changelog entry documents the resulting Errors-page behavior. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
72e1c07 to
e524cce
Compare
Errors thrown without a message (e.g. tagged errors) and non-Error throws (strings, plain objects) were all shown as "Unknown error" and collapsed into a single fingerprint, so unrelated failures across different tasks shared one group. Fall back message -> name -> raw when computing both the error fingerprint and the displayed message. Message-bearing errors are unaffected, so existing groups don't split; only errors that currently have no message get a meaningful title and their own group going forward. Also fix two display-derivation bugs in the same error materialized views (via MODIFY QUERY, existing rows unchanged): - error_type now shows the real class name / internal code instead of the generic serialization tag (BUILT_IN_ERROR, STRING_ERROR, ...). - stack traces now read the stored stackTrace field, not the always-empty error.data.stack, so they populate again.
e524cce to
b7efc4e
Compare
@trigger.dev/build
trigger.dev
@trigger.dev/core
@trigger.dev/python
@trigger.dev/react-hooks
@trigger.dev/redis-worker
@trigger.dev/rsc
@trigger.dev/schema-to-json
@trigger.dev/sdk
commit: |
Problem
Several display/grouping issues in the Errors feature, all rooted in how the ClickHouse error materialized views (
errors_mv_v1,error_occurrences_mv_v1) read the stored error JSON produced byparseError:coalesce(nullIf(message,''), 'Unknown error')to the literal, even though the error's classnameis available (e.g. an Effect tagged errorListMessagesErrorwith no message).calculateErrorFingerprintkeys ontype : message : stack, wheretypeis always the union tag (BUILT_IN_ERROR, …),messageis empty, and the stack isn't read — so every messageless built-in error (and every string/custom error) hashes to the same constant input → one fingerprint.coalesce(type, name, …)always resolves totype(always present), so the column showsBUILT_IN_ERRORinstead of the real class name.error.data.stack, but the serializer stores the trace understackTrace— so the column is always empty.Fix
All display changes are
ALTER TABLE … MODIFY QUERYon the two views (migration035); the fingerprint change is in the webapp.errorFingerprinting.ts): fall back message → name → raw. Messageless errors now group by class name (or raw value for non-Error throws); message-bearing errors are unchanged (short-circuits atmessage), so existing groups don't split — only currently-messageless errors get their own group going forward.message → name → rawfallback before'Unknown error'.name → code → 'Error'(drops the reliance on the union tag). Built-in → class name, internal →code, string/custom →Error.error.data.stackTrace. Bounded as before (serializer caps 50 frames / 1024 chars per line; MV clips to 2000 chars).Migration notes
MODIFY QUERYswaps the view query in place (no drop/recreate gap); Down restores the previous query.Tests
errorFingerprinting.test.ts— 57 pass, incl. new cases for messageless class names, string/custom raw values, and stability of message-bearing fingerprints.Fixes the display-derivation half of TRI-11938 (error_type + stack trace); relates to TRI-9254 and TRI-9250.