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

Move active session down to SessionHandler #94

Merged
merged 1 commit into from
Nov 20, 2023

Conversation

fractalwrench
Copy link
Contributor

Goal

Moves the activeSession property down to SessionHandler & makes it private. This avoids having to pass state between the two classes unnecessarily.

Testing

Updated existing test coverage.

@fractalwrench fractalwrench requested a review from a team as a code owner November 20, 2023 14:13
Copy link

codecov bot commented Nov 20, 2023

Codecov Report

Merging #94 (1ce5fe5) into master (e724ccd) will decrease coverage by 0.16%.
The diff coverage is 95.45%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #94      +/-   ##
==========================================
- Coverage   76.00%   75.85%   -0.16%     
==========================================
  Files         314      314              
  Lines       10078    10071       -7     
  Branches     1460     1458       -2     
==========================================
- Hits         7660     7639      -21     
- Misses       1829     1840      +11     
- Partials      589      592       +3     
Files Coverage Δ
...ndroid/embracesdk/session/EmbraceSessionService.kt 77.58% <100.00%> (-2.42%) ⬇️
...brace/android/embracesdk/session/SessionHandler.kt 81.87% <94.11%> (-6.52%) ⬇️

... and 1 file with indirect coverage changes

Copy link
Collaborator

@bidetofevil bidetofevil left a comment

Choose a reason for hiding this comment

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

LGTM.

One question though: is there a reason (other than inertia) that we are using so many volatile member variables instead of using atomic references? Any time we have mutable state that can be accessed by multiple threads, we should think carefully about synchronization, and while making something atomic doesn't automatically guarantee thread safety, at least it synchronizes access and forces us (in theory) to think about how that is changed.

@fractalwrench
Copy link
Contributor Author

I think it's mainly inertia & there isn't a good reason why better synchronisation mechanisms aren't being used.

@fractalwrench fractalwrench merged commit 302a9b9 into master Nov 20, 2023
4 checks passed
@fractalwrench fractalwrench deleted the move-session-down branch November 20, 2023 17:08
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.

2 participants