Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create property delegate function for ThreadLocal #58

Merged
merged 1 commit into from
Nov 13, 2023

Conversation

fractalwrench
Copy link
Contributor

Goal

Neither Gson or EmbraceSerializer are thread-safe. This changeset updates both to use ThreadLocal to avoid any thread safety issues around JSON serialization, and adds some syntactic sugar that makes it easier to use thread locals.

Testing

Added unit test coverage.

@fractalwrench fractalwrench requested a review from a team as a code owner November 10, 2023 15:18
Copy link

codecov bot commented Nov 10, 2023

Codecov Report

Merging #58 (f6a9ca8) into master (3fbf6ad) will increase coverage by 0.08%.
Report is 3 commits behind head on master.
The diff coverage is 82.35%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #58      +/-   ##
==========================================
+ Coverage   74.58%   74.67%   +0.08%     
==========================================
  Files         307      308       +1     
  Lines       10094    10095       +1     
  Branches     1453     1448       -5     
==========================================
+ Hits         7529     7538       +9     
+ Misses       1986     1982       -4     
+ Partials      579      575       -4     
Files Coverage Δ
...esdk/comms/delivery/EmbraceDeliveryCacheManager.kt 77.31% <100.00%> (ø)
...embracesdk/internal/utils/ThreadLocalExtensions.kt 80.00% <80.00%> (ø)
...e/android/embracesdk/internal/EmbraceSerializer.kt 63.15% <81.81%> (+26.31%) ⬆️

... and 2 files with indirect coverage changes

Copy link
Contributor

@lucaslabari lucaslabari left a comment

Choose a reason for hiding this comment

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

LGTM

@fractalwrench fractalwrench merged commit ea815e8 into master Nov 13, 2023
4 checks passed
@fractalwrench fractalwrench deleted the thread-local branch November 13, 2023 10:17
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.

None yet

2 participants