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

Remember previous URL when reloading app #52

Closed
alxndrsn opened this issue May 24, 2018 · 5 comments
Closed

Remember previous URL when reloading app #52

alxndrsn opened this issue May 24, 2018 · 5 comments
Assignees
Labels
Type: Improvement Make something better UI/UX Changes the appearance or behaviour of the app
Milestone

Comments

@alxndrsn
Copy link
Contributor

medic/cht-core#4492 (comment)

Value can probably be saved in onStop(), and restored as currently done in onCreate().

@MaxDiz MaxDiz added this to Needs Triage in End Users Backlog via automation Nov 12, 2019
@MaxDiz MaxDiz added the UI/UX Changes the appearance or behaviour of the app label Nov 12, 2019
GopinathVempati pushed a commit to GopinathVempati/medic-android that referenced this issue Apr 22, 2020
medic#94 Android app should navigate to root instead of the _rewrite path after webapp 3.5.
medic#52 Remember previous URL when reloading app
@mrsarm mrsarm moved this from Needs Triage to Scheduled in End Users Backlog Sep 10, 2021
@mrsarm mrsarm added this to Ready for dev in Allies Workstream - DEPRECATED via automation Sep 10, 2021
@mrsarm mrsarm moved this from Ready for dev to Dev in progress in Allies Workstream - DEPRECATED Sep 10, 2021
@mrsarm mrsarm added this to the 0.10.0 milestone Sep 10, 2021
@mrsarm mrsarm added the Type: Improvement Make something better label Sep 10, 2021
@mrsarm mrsarm modified the milestones: 0.10.0, 0.11.0 Sep 15, 2021
@mrsarm mrsarm self-assigned this Sep 21, 2021
@mrsarm
Copy link
Contributor

mrsarm commented Sep 30, 2021

Ready for AT, PR #210 , branch mrsarm:gopinath/medic_changes (from external repo).

The feature was added as requested: remember the last URL loaded, but we also added a 24 hs limit, after that the app is loaded as always.

Worth to take into account:

  • Using local environment without changing sessions TTL will cause that after 24 hs (or faking the clock) sessions being closed, so use a dev environment with longer session TTL when testing.
  • Some times when you force close the app and open it again, the session is logged out, redirecting you to the login page. Not sure if it's an issue that we should report and handle in another ticket, but it is a behavior previous to this work (you can reproduce it with the latest stable version of the app).
  • We added an e2e test for this feature that is executed in CI 😄 , you can see a video in a comment in the PR.

@mrsarm mrsarm moved this from Dev in progress to Ready for AT in Allies Workstream - DEPRECATED Sep 30, 2021
@ngaruko ngaruko moved this from Ready for AT to AT in progress in Allies Workstream - DEPRECATED Oct 5, 2021
@ngaruko ngaruko moved this from AT in progress to Ready for AT in Allies Workstream - DEPRECATED Oct 5, 2021
@ngaruko
Copy link
Contributor

ngaruko commented Oct 6, 2021

Tested with local install of cht-android from the branch.

remember.mov

Some times when you force close the app and open it again, the session is logged out, redirecting you to the login page. Not sure if it's an issue that we should report and handle in another ticket, but it is a behavior previous to this work (you can reproduce it with the latest stable version of the app).

This needs some further investigation @mrsarm . Can you please open another ticket for it with replication steps? Thanks

Otherwise, good to merge...and thank you for adding some test for this.

@ngaruko ngaruko moved this from Ready for AT to AT in progress in Allies Workstream - DEPRECATED Oct 6, 2021
@ngaruko ngaruko self-assigned this Oct 6, 2021
@garethbowen
Copy link
Member

@ngaruko I think the logout issue may be unrelated. @dianabarsan was looking in to this...

@dianabarsan
Copy link
Member

@ngaruko this is what I am seeing: medic/cht-core#7343 (comment)

My conclusion is that Android calls a method that persists all cookies (including session cookies) on disk on a schedule (used to be manual in previous versions: https://developer.android.com/reference/android/webkit/CookieSyncManager). If you're quicker and you kill the app before the cookies are saved, you load the "old" cookies when you restart the app.

I think we should investigate if it's possible to reduce the interval at which this method runs, or call the "flush" method ourselves, because it's very easily outperformed by a human.
From the android docs:

The WebView now automatically syncs cookies as necessary. You no longer need to create or use the CookieSyncManager. To manually force a sync you can use the CookieManager method CookieManager#flush which is a synchronous replacement for sync().

@mrsarm mrsarm closed this as completed Oct 6, 2021
End Users Backlog automation moved this from Scheduled to Done Oct 6, 2021
Allies Workstream - DEPRECATED automation moved this from AT in progress to Done Oct 6, 2021
@mrsarm
Copy link
Contributor

mrsarm commented Oct 6, 2021

Clossing the issue (I'll create a separated ticket for the issue discussed about tomorrow).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Improvement Make something better UI/UX Changes the appearance or behaviour of the app
Projects
No open projects
Development

No branches or pull requests

6 participants