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

[Nextcloud login flow] No login after returning from custom tabs when on low memory #1029

Conversation

ArnyminerZ
Copy link
Member

Purpose

See #552. When low memory, Android closes DAVx⁵ in the background after opening custom tabs, so state is not restored, and the login process is reset.

Short description

  • Stored all relevant states in SavedInstanceHandle
  • Passing pollUrl and token back from state to NextcloudLoginFlow.

Checklist

  • The PR has a proper title, description and label.
  • I have self-reviewed the PR.
  • I have added documentation to complex functions and functions that can be used by other modules.
  • I have added reasonable tests or consciously decided to not add tests.

Signed-off-by: Arnau Mora Gras <arnyminerz@proton.me>
Signed-off-by: Arnau Mora Gras <arnyminerz@proton.me>
@ArnyminerZ ArnyminerZ added the bug Something isn't working label Sep 17, 2024
@ArnyminerZ ArnyminerZ self-assigned this Sep 17, 2024
@ArnyminerZ ArnyminerZ marked this pull request as ready for review September 17, 2024 13:14
@ArnyminerZ
Copy link
Member Author

Well, it's not the prettiest thing in the world, but I think it's the most simple way we have to store the states without adding too much boilerplate code.

@rfc2822 rfc2822 requested review from sunkup and removed request for rfc2822 September 19, 2024 12:15
Copy link
Member

@sunkup sunkup left a comment

Choose a reason for hiding this comment

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

I can see why you think it's ugly. But hey, it works. Without looking into alternative ways to fix this I think this is quite alright 👍

@@ -93,7 +94,8 @@ class NextcloudLoginModel @AssistedInject constructor(
val loginFlow = NextcloudLoginFlow(context)

// Login flow state
/*private var pollUrl: HttpUrl?
// Login flow state
Copy link
Member

Choose a reason for hiding this comment

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

double comments

@rfc2822
Copy link
Member

rfc2822 commented Sep 28, 2024

Quite a big change, because it changes the login objects etc. Without further documentation, we will surely forget about it and convert the data objects back to objects at some time. So we need much more time, documentation etc. for this little thing.

So let's do this later, seems there is not easy solution for it. :(

@rfc2822 rfc2822 closed this Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Nextcloud login flow] No login after returning from custom tabs when on low memory
3 participants