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

Extend user session #2876

Draft
wants to merge 5 commits into
base: commcare_2.54
Choose a base branch
from
Draft

Extend user session #2876

wants to merge 5 commits into from

Conversation

avazirna
Copy link
Contributor

@avazirna avazirna commented Oct 18, 2024

Summary

This PR adds the option for CommCare to extend the session of the user when they are navigating a widget that can't be recovered in case of session expiration. In another words, it extends the session to prevent the auto logout from being triggered and the user to lose any data captured using the widget. The widget in question is the CommCareAudioWidget.
This issue came up recently for a project that makes use of this widget to audio record long session in which users were being logout in the middle of the recording due to the session expiration. More information on this ticket.

Safety Assurance

  • I have confidence that this PR will not introduce a regression for the reasons below
  • Do we need to enhance manual QA test coverage ? If yes, "QA Note" label is set correctly

Safety story

This only adds more time to the current session. Local tests were successfully.

@avazirna avazirna marked this pull request as ready for review October 21, 2024 10:40
Comment on lines +251 to 254
if (questionsView.hasNonRecoverableWidgets()) {
CommCareApplication.instance().getSession().extendUserSessionIfNeeded();
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I would think a better place to do this would be when user take an action to start the unrecoverable action. For eg. for the audio recording widget we should only extend the session when user initiates the recording and do nothing if user decides to skip the recording widget present in the form. Also if user decies to attach a recording from the FileSystem (instead of live recording through CC) , the session should not be extended.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@shubham1g5 I have raised a new PR with a new approach to this. On that approach, the extension happens during the widget changed event.

@avazirna avazirna added this to the 2.54.1 milestone Oct 23, 2024
@avazirna avazirna marked this pull request as draft October 24, 2024 10:46
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