Skip to content

fix(): fix source-map saving#449

Merged
e11sy merged 4 commits intomasterfrom
fix-sourcemap-saving
Sep 2, 2025
Merged

fix(): fix source-map saving#449
e11sy merged 4 commits intomasterfrom
fix-sourcemap-saving

Conversation

@e11sy
Copy link
Copy Markdown
Member

@e11sy e11sy commented Sep 2, 2025

Problem

image - On some saves we had this kind of error related to the transactions we've implemented transactions in this pr: (https://github.com//pull/390) so now if some of the transaction is blocked (it will stop and then re-run after db lock will be removed) but in js we already mutated savedFile object (we used `delete file.content;` and it led to errors on transaction re-run)

Solution

  • do not mutate original savedFiles object to avoid errors on transaction re-run

@e11sy e11sy marked this pull request as ready for review September 2, 2025 16:01
neSpecc
neSpecc previously approved these changes Sep 2, 2025
@neSpecc neSpecc requested a review from Copilot September 2, 2025 16:06
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread workers/javascript/src/index.ts Outdated
const originalContent = consumer.sourceContentFor(originalLocation.source);

// functionContext = this.getFunctionContext(originalContent, originalLocation.line) ?? originalLocation.name;
functionContext = this.getFunctionContext(originalContent, originalLocation.line) ?? originalLocation.name;
Copy link

Copilot AI Sep 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems as a strange comment since functionContext is defined just above the condition

@e11sy e11sy merged commit 084fce2 into master Sep 2, 2025
4 of 5 checks passed
@e11sy e11sy deleted the fix-sourcemap-saving branch September 2, 2025 17:19
e11sy added a commit that referenced this pull request Sep 2, 2025
* 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>
e11sy added a commit that referenced this pull request Sep 2, 2025
* 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>
Dobrunia added a commit that referenced this pull request Sep 11, 2025
* 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>
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.

3 participants