Repository navigation
Shed oversized client errors, pause on rejected keys and validate audit envelopes - #12
Merged
Merged
Conversation
- Validate the endpoint with a pattern instead of URL getters, which throw in React Native without a URL polyfill. - Shrink events above 60 KB in two steps (breadcrumbs, then context and raw stack) before dropping them; context.truncated records what was removed. - Normalise caller frames and beforeSend output to the server contract (at most 100 valid frames). - On 401/403 drop the queue and pause capture for 1 minute, doubling up to 32 minutes; expose getStats().paused and a "paused" diagnostic. - installBrowserErrors returns the existing installation for the same window and throws when no window exists. - Add typesVersions so subpath imports resolve with moduleResolution node. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- An enum cast in auditFields() made diff() throw and failed the model save. Snapshots and canonical() now record the backing value or case name. - Validate description, actor.label, redacted_fields and origin fields, and reject unknown keys in subject, actor, origin and changes, so an invalid envelope fails the write instead of being stuck in the outbox. - Count identifier and text lengths in UTF-16 code units like the backend. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up hardening for the browser/React Native error client and the Laravel audit capture.
Client errors (JS)
URLgetters, which throw "not implemented" in React Native without a URL polyfill.session_id) and the raw stack beyond 8,000 characters.context.truncatedrecords what was removed; only events still too large are dropped asoversize.captureExceptionand frames returned bybeforeSendare normalised to the server contract (valid entries, cleaned URLs, at most 100).401/403means every event will be rejected. The queue is dropped and capture pauses for 1 minute, doubling up to 32 minutes while rejections continue.getStats().pausedand apauseddiagnostic expose the state; a successful delivery resets it.installBrowserErrorsreturns the existing installation for the same window instead of duplicating listeners, and throws a clear error where nowindowexists (SSR).typesVersionsmakes thebrowser,react-native,nuxtandreactsubpaths resolve undermoduleResolution: node.Audit (Laravel)
auditFields()madeAuditEvent::diff()throw and failed the model save. Snapshots andcanonical()now record the backing value or the case name.description,actor.label,redacted_fieldsandorigin.*are validated, and unknown keys insubject,actor,originandchangesare rejected. An invalid envelope now fails the write instead of reaching the outbox and failing every publish.Validation:
npm run typecheck:errors,npm run build:errors, vitest 136/136 (5 new tests); phpunit Unit 152/152 (2 new tests).Known issue, not caused by this change:
npm run buildfails in the DTS step because@confluentinc/kafka-javascriptis not installed after the lockfile refresh in 0c462c9. The errors build and the ESM/CJS bundles succeed. The pre-commit secret check also passes a pattern starting with-----togrepwithout-e, so its private-key check does not run.