Repository navigation
Conversation
- parseQueryString/getCookies: decode safely, split on the first "=", match exclusions on the decoded key, use "" for missing values and skip empty keys. - prune/stringify: drop values whose getter, toJSON or Proxy throws instead of throwing; cap nested toJSON calls by depth; track only ancestors for cycle detection (arrays and errors included) so shared, non-circular references are kept. - EventPluginManager: a throwing plugin is logged with its name and the error, and the event continues instead of being cancelled. - EventExclusionPlugin: logs without a level are cancelled when the source's minimum level is off; exception type exclusions also apply to @simple_error. - DuplicateCheckerPlugin: de-duplicate @simple_error events.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
🟡 Changes recommended
Error formatting can still abort event processing, throwing array getters can discard healthy entries, and throwing Date serialization can make property updates fail.
3 open issues
What changed in this PR
This PR hardens shared core event processing so malformed data and plugin failures are less likely to discard events across SDK runtimes.
Changes:
- Improves query/cookie parsing and defensive serialization.
- Continues processing after plugin failures while preserving explicit cancellation.
- Extends filtering and deduplication behavior, with regression tests and updated guidance.
| File | Description |
|---|---|
| packages/core/test/Utils.test.ts | Covers parsing and serialization edge cases. |
| packages/core/test/plugins/EventPluginManager.test.ts | Tests failure recovery and explicit cancellation. |
| packages/core/test/plugins/default/EventExclusionPlugin.test.ts | Covers unlevelled logs and simple-error exclusions. |
| packages/core/test/plugins/default/DuplicateCheckerPlugin.test.ts | Tests simple-error deduplication. |
| packages/core/src/Utils.ts | Hardens parsing, serialization, and cycle handling. |
| packages/core/src/plugins/EventPluginManager.ts | Continues after plugin failures and improves logging. |
| packages/core/src/plugins/default/EventExclusionPlugin.ts | Applies missing-level and simple-error filtering. |
| packages/core/src/plugins/default/DuplicateCheckerPlugin.ts | Adds simple-error fallback. |
| .agents/skills/exceptionless-javascript/references/troubleshooting.md | Explains filtering and plugin-failure diagnostics. |
| .agents/skills/exceptionless-javascript/references/plugins.md | Documents revised plugin-failure behavior. |
Review effort: Balanced
…aves - Read array elements one at a time so a throwing index getter drops only that element. - Serialize a Date with an overridden toJSON inside prune, where a throw drops only that value. - Format plugin errors without throwing (a thrown Symbol made the catch handler itself throw).
| seen: WeakSet<object> = new WeakSet(), | ||
| parentIsArray: boolean = false | ||
| ): unknown { | ||
| function pruneImpl(value: unknown, maxDepth: number, currentDepth: number = 10, ancestors: Set<object> = new Set(), parentIsArray: boolean = false): unknown { |
There was a problem hiding this comment.
we need a ton of coverage for this if we are changing it and benchmarks. I did a ton of work to make sure this was performant and error free
There was a problem hiding this comment.
[AGENT] I ran a focused synthetic benchmark of stringify() on Node 24.22.3, comparing 54ac83f with 4cbe944. Across 10 warmed, alternating-order pairs, median paired time was 4.1% higher for a 111-byte log (1.153 → 1.200 µs per call) and 2.4% higher for a 1,431-byte nested error/request (14.117 → 14.424 µs). Both revisions produced byte-identical JSON. This covers two ordinary payloads. Browser and device performance, allocations, and malformed or cyclic inputs remain open.

Fixes
@exceptionless/corepaths that silently dropped or corrupted events.parseQueryStringthrowsURIErroron?discount=100%, soBrowserRequestInfoPlugincancelled every event from that page; exclusions matched the still-encoded key (pass%77ordgot pastpassword);?flaggave"undefined"URIError, match exclusions on the decoded key, use""for missing values, skip empty keys, split on the first=getCookiessplit on every=, cutting off base64 values=and decode the same safe way. Values are now URI-decoded too, which they weren't beforeprune/stringifythrow on a throwing getter, a throwingtoJSONor a revoked Proxy. That cancelled error events and threw out ofsetPropertyundefined, the same way unsupported and circular values are dropped, and the rest of the object is kepttoJSONthat returns itself or anothertoJSONobject recursed with no limittoJSONcall counts against the depthseenset dropped shared references that aren't circular ({a: obj, b: obj}lostb); arrays and Errors weren't checked for cyclesEventPluginManager.runcancelled the event when any plugin threw, and the defaultNullLoghid itError running plugin "<name>": <message>. Continuing with the event.and keeps processing.context.cancelled = truestill works. Startup and suspend log the same way; a failure there already didn't stop other plugins@@log:*=off(orofffor one source) didn't stopsubmitLog("msg")when the log had no leveloff. Behavior is unchanged for every other levelDuplicateCheckerPluginandEventExclusionPluginonly read@error, so@simple_errorevents were never de-duplicated and exception-type exclusions didn't apply@error, and fall back to@simple_errorwhen it's missing. Results for@errorevents are unchangedExisting tests changed because they tested the old buggy behavior:
Utils.test.ts: "array reference removes duplicated object references" now expects[obj, obj]and is renamed "array reference keeps shared object references".EventPluginManager.test.ts: "throwing error should stop plugin execution" and "should cancel via timeout" relied on a throw cancelling the event (there is no timeout). Both are replaced by tests where a plugin throws or rejects and the event keeps going, plus tests for cancel-then-throw and for startup and suspend failures.No other existing test changed. Also updated the skill references
plugins.mdandtroubleshooting.md.Checks run:
npm ci;npm test(26 files, 382 tests pass);npm run lint(ESLint and Prettier pass);npm run buildfor core, browser and node.