Skip to content

fix: apply per-event data via capture-local scope instead of mutating the global scope - #54

Draft
gradinarufelix wants to merge 1 commit into
flownative:mainfrom
gradinarufelix:feature-capture-local-scope
Draft

fix: apply per-event data via capture-local scope instead of mutating the global scope#54
gradinarufelix wants to merge 1 commit into
flownative:mainfrom
gradinarufelix:feature-capture-local-scope

Conversation

@gradinarufelix

Copy link
Copy Markdown
Contributor

captureThrowable() and captureMessage() currently write per-event data (extras, tags, user, the session tag) into the hub's scope permanently via configureScope(). In long-running CLI processes — queue workers in particular — data from one capture leaks into all subsequent events of the same process: stale Reference Codes, exception_code tags and WithExtraDataInterface payloads then decorate unrelated events, which actively misleads debugging.

This applies per-event data inside withScope() instead, so it evaporates after each capture. The process-stable flow_version/flow_context tags remain on the global scope (set at initialization) and are additionally re-applied on the capture-local scope, preserving the previous behavior even when foreign code replaces or clears the hub scope.

Draft while #52 is under discussion — no code dependency on it (applies cleanly to main), but review feedback there may affect naming here.

… the global scope

captureThrowable() and captureMessage() previously wrote extras, tags, user
and the session tag into the hub's scope permanently. In long-running CLI
processes (queue workers) data from one capture leaked into all subsequent
events: stale Reference Codes, exception_code tags and WithExtraDataInterface
payloads. Per-event data is now applied inside withScope(), so it evaporates
after each capture; the process-stable flow_version/flow_context tags remain
on the global scope, set once at initialization.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant