Skip to content

Avoid capturing shared state by Event Write Context#1126

Merged
0xnm merged 1 commit into
feature/sdkv2from
nogorodnikov/avoid-capturing-shared-fields-by-event-write-context
Nov 7, 2022
Merged

Avoid capturing shared state by Event Write Context#1126
0xnm merged 1 commit into
feature/sdkv2from
nogorodnikov/avoid-capturing-shared-fields-by-event-write-context

Conversation

@0xnm

@0xnm 0xnm commented Nov 4, 2022

Copy link
Copy Markdown
Member

What does this PR do?

Bugfix for #1117: since EWC is executed on the worker thread, by the time we get the context shared fields/state may already be changed.

This PR avoids that by making sure that EWC captures only the local state or immutable shared state.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

@codecov-commenter

codecov-commenter commented Nov 4, 2022

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.53%. Comparing base (5506ab9) to head (ca3c664).

Additional details and impacted files
@@                Coverage Diff                @@
##           feature/sdkv2    #1126      +/-   ##
=================================================
+ Coverage          82.44%   82.53%   +0.10%     
=================================================
  Files                347      347              
  Lines              11375    11394      +19     
  Branches            1918     1918              
=================================================
+ Hits                9377     9404      +27     
+ Misses              1416     1415       -1     
+ Partials             582      575       -7     
Files with missing lines Coverage Δ
...ndroid/rum/internal/domain/scope/RumActionScope.kt 98.61% <100.00%> (+0.05%) ⬆️
.../android/rum/internal/domain/scope/RumViewScope.kt 96.91% <100.00%> (+0.48%) ⬆️

... and 12 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@0xnm
0xnm marked this pull request as ready for review November 4, 2022 11:44
@0xnm
0xnm requested a review from a team as a code owner November 4, 2022 11:44
@0xnm
0xnm force-pushed the nogorodnikov/avoid-capturing-shared-fields-by-event-write-context branch from f6b1b5c to ca3c664 Compare November 7, 2022 12:51
@0xnm
0xnm merged commit 658dd10 into feature/sdkv2 Nov 7, 2022
@0xnm
0xnm deleted the nogorodnikov/avoid-capturing-shared-fields-by-event-write-context branch November 7, 2022 13:25
@xgouchet xgouchet added this to the 1.16.0 milestone Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants