Skip to content

fix(login): preserve state after activity recreation - #6516

Open
SeniorZhai wants to merge 3 commits into
masterfrom
codex/fix-landing-state-restoration
Open

fix(login): preserve state after activity recreation#6516
SeniorZhai wants to merge 3 commits into
masterfrom
codex/fix-landing-state-restoration

Conversation

@SeniorZhai

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings July 22, 2026 15:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Preserves the landing/login flow across activity recreation.

Changes:

  • Avoids replacing restored fragment stacks.
  • Restores mnemonic-login errors and suppresses automatic retries.
  • Adds state-restoration unit tests.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
LandingActivity.kt Retains restored fragments.
MnemonicPhraseFragment.kt Restores login failure information.
LandingActivityStateRestorationTest.kt Tests restoration decisions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +139 to +140
if (shouldRequestAnonymousLogin(errorInfo)) {
anonymousRequest(words)
@SeniorZhai SeniorZhai added the testing Now testing, but you can review label Jul 22, 2026
Copilot AI review requested due to automatic review settings July 22, 2026 15:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

app/src/main/java/one/mixin/android/ui/landing/MnemonicPhraseFragment.kt:135

  • onSaveInstanceState can run before the in-flight coroutine reports a failure. Because this fragment's ViewModel survives configuration changes, a failure delivered between state saving and destruction remains in the ViewModel, but this Bundle-only check reads false and starts another anonymous request, clearing the restored error. Include the retained ViewModel state when deciding whether to retry.
        val restoredRequestFailed = savedInstanceState?.getBoolean(STATE_REQUEST_FAILED) == true

Copilot AI review requested due to automatic review settings July 23, 2026 01:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Now testing, but you can review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants