Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes source map saving issues by preventing mutation of the original savedFiles object during database transactions. The mutation was causing errors when transactions were retried due to database locks.
- Prevents object mutation in release worker to avoid transaction retry errors
- Refactors file filtering and content removal to use immutable operations
- Uncomments and renames function context extraction functionality in javascript worker
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| workers/release/src/index.ts | Refactors source map saving to avoid mutating original objects and uses immutable operations for filtering and content removal |
| workers/javascript/src/index.ts | Uncomments function context extraction and removes underscore prefix from method name |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| const originalContent = consumer.sourceContentFor(originalLocation.source); | ||
|
|
||
| // functionContext = this.getFunctionContext(originalContent, originalLocation.line) ?? originalLocation.name; | ||
| functionContext = this.getFunctionContext(originalContent, originalLocation.line) ?? originalLocation.name; |
There was a problem hiding this comment.
The variable functionContext is being assigned but it's not declared in the visible scope. This will either cause a ReferenceError or create an implicit global variable.
There was a problem hiding this comment.
seems as a strange comment since functionContext is defined just above the condition
* Js worker fix (#445) * fix(): move logs after the conditions * chore(): fix error sending * fix(): do not use jsx parser * chore(): leave todo * chore(): do not use getFunctionContext * fix(): fix source-map saving (#449) * fix(): avoid mutations on savedFiles * revert js worker changes * fix(): js worker tests * imp(): catch errors on get function context --------- Co-authored-by: e11sy <130844513+e11sy@users.noreply.github.com>
* Js worker fix (#445) * fix(): move logs after the conditions * chore(): fix error sending * fix(): do not use jsx parser * chore(): leave todo * chore(): do not use getFunctionContext * fix(): fix source-map saving (#449) * fix(): avoid mutations on savedFiles * revert js worker changes * fix(): js worker tests * imp(): catch errors on get function context * chore(): imp perf (#450) --------- Co-authored-by: e11sy <130844513+e11sy@users.noreply.github.com>
* Js worker fix (#445) * fix(): move logs after the conditions * chore(): fix error sending * fix(): do not use jsx parser * chore(): leave todo * chore(): do not use getFunctionContext * fix(): fix source-map saving (#449) * fix(): avoid mutations on savedFiles * revert js worker changes * fix(): js worker tests * imp(): catch errors on get function context * chore(): imp perf (#450) * fix(hawk-workers-sentry): fix envelope parse error (#448) * fix(sentry): filter out binary items from raw event before parsing to prevent crashes * fix(sentry): enhance binary data handling to prevent crashes during event processing * linf fix * refactor(tests): skip specific test cases for JavaScript event worker --------- Co-authored-by: e11sy <130844513+e11sy@users.noreply.github.com> Co-authored-by: Dobrunia Kostrigin <48620984+Dobrunia@users.noreply.github.com>
Problem
Solution