You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
├── DEVELOPMENT.md ← Recipes for adding features/commands/providers,
27
29
│ RFC process, build & test quick reference
28
30
├── TESTING.md ← Test conventions, mock infrastructure (.mockAny(),
@@ -50,6 +52,7 @@ Feature-specific docs (in each module directory):
50
52
| Write or fix tests |`docs/TESTING.md`|
51
53
| Check naming, lint, commit format |`docs/CONVENTIONS.md`|
52
54
| Touch swizzling code |`docs/SWIZZLING.md`|
55
+
| Report an error to internal telemetry |`docs/ERROR_HANDLING.md`|
53
56
| Modify a fragile area |`docs/KNOWN_CONCERNS.md`|
54
57
| Work on RUM specifically |`DatadogRUM/RUM_FEATURE.md`|
55
58
| Work on Session Replay specifically |`DatadogSessionReplay/SESSION_REPLAY_FEATURE.md`|
@@ -71,6 +74,7 @@ Feature-specific docs (in each module directory):
71
74
-**Do NOT name branches with `codex`.** Use repo branch naming conventions instead.
72
75
-**Never mention AI assistant names** (Claude, ChatGPT, Cursor, Copilot, etc.) in commit messages, PR descriptions, code comments, or co-author tags.
73
76
-**Never write or modify a swizzle without reading `docs/SWIZZLING.md` first.** Past incidents have caused production crashes.
77
+
-**Never report a raw `Error` to internal telemetry.**`"\(error)"` can embed customer data (e.g. `EncodingError.invalidValue` embeds the offending value). Always go through `Telemetry.error(_:)`, which sanitizes via `TelemetrySanitizableError`; see `docs/ERROR_HANDLING.md`. Past incidents have leaked customer PII and auth tokens this way.
@@ -753,7 +753,7 @@ class DataUploadWorkerTests: XCTestCase {
753
753
XCTAssertEqual(telemetry.messages.count,2)
754
754
755
755
leterror=tryXCTUnwrap(telemetry.messages.firstError(),"An error should be send to `telemetry`.")
756
-
XCTAssertEqual(error.message,#"Failed to initiate 'some-feature' data upload - Failed to prepare upload"#)
756
+
XCTAssertEqual(error.message,"Failed to initiate 'some-feature' data upload - ErrorMock does not conform to TelemetrySanitizableError — reporting type name only")
757
757
758
758
letmetric=tryXCTUnwrap(telemetry.messages.firstMetric(named:"upload_quality"),"An upload quality metric should be send to `telemetry`.")
0 commit comments