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

Fix manual session control enablement #1408

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nelsitoPuglisi
Copy link
Contributor

Goal

Have a kill switch to disable ending sessions manually. There was a confused implementation with the previous key.

Testing

Manual and Unit test.

Copy link
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Manifest Files

@@ -111,7 +111,7 @@ internal class SessionOrchestratorImpl(
payloadFactory.startSessionWithManual(timestamp)
},
earlyTerminationCondition = {
return@transitionState shouldEndManualSession(
return@transitionState !shouldEndManualSession(
Copy link
Contributor Author

@nelsitoPuglisi nelsitoPuglisi Sep 20, 2024

Choose a reason for hiding this comment

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

earlyTerminationCondition collects functions that prevent the execution.

*/
fun isSessionControlEnabled(): Boolean
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can keep this as enabled at this level (app usage) so it matches the other kill switches. It's at the Config level that we should make this be identify itself as disabled

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.

Looks good other than flipping the method name in the Behavior back to isSessionControlEnabled() to match the other kill switches.

@fractalwrench should look at the logic flip in OrchestratorImpl. Maybe a method rename to blockManualSessionEnd() while keep the true/false returns might read better?

Copy link

codecov bot commented Sep 20, 2024

Codecov Report

Attention: Patch coverage is 81.81818% with 2 lines in your changes missing coverage. Please review.

Project coverage is 82.45%. Comparing base (3ff718b) to head (bbd1da4).
Report is 201 commits behind head on main.

Files with missing lines Patch % Lines
...dk/internal/config/behavior/SessionBehaviorImpl.kt 0.00% 0 Missing and 1 partial ⚠️
.../orchestrator/OrchestratorTerminationConditions.kt 85.71% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1408      +/-   ##
==========================================
- Coverage   82.54%   82.45%   -0.10%     
==========================================
  Files         476      477       +1     
  Lines       10942    10964      +22     
  Branches     1668     1668              
==========================================
+ Hits         9032     9040       +8     
- Misses       1184     1195      +11     
- Partials      726      729       +3     
Files with missing lines Coverage Δ
...al/session/orchestrator/SessionOrchestratorImpl.kt 93.10% <100.00%> (ø)
.../embracesdk/internal/config/remote/RemoteConfig.kt 100.00% <100.00%> (ø)
...esdk/internal/config/remote/SessionRemoteConfig.kt 100.00% <ø> (ø)
...dk/internal/config/behavior/SessionBehaviorImpl.kt 66.66% <0.00%> (ø)
.../orchestrator/OrchestratorTerminationConditions.kt 95.45% <85.71%> (ø)

... and 12 files with indirect coverage changes

Copy link
Contributor

This PR is stale because it has been open 20 days with no activity. Remove stale label or comment or this PR will be closed in 10 days.

@github-actions github-actions bot added the stale label Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants