Skip to content

Bug 2060541 - Recheck auth status on startup, weekly - #7564

Open
bytesized wants to merge 3 commits into
mozilla:mainfrom
bytesized:5386
Open

Bug 2060541 - Recheck auth status on startup, weekly#7564
bytesized wants to merge 3 commits into
mozilla:mainfrom
bytesized:5386

Conversation

@bytesized

Copy link
Copy Markdown

Pull Request checklist

  • Breaking changes: This PR follows our breaking change policy
    • This PR follows the breaking change policy:
      • This PR has no breaking API changes
  • Quality: This PR builds and tests run cleanly
    • cargo test succeeds locally.
  • Tests: This PR includes thorough tests or an explanation of why it does not
    • No automated testing, but this adds the cargo fxa force-auth-issues command to the example CLI client in order to be able to test this manually.
  • Changelog: This PR includes a changelog entry in CHANGELOG.md or an explanation of why it does not need one
    • This change is small enough that it doesn't seem like it warrants a changelog entry.
  • Dependencies: This PR follows our dependency management guidelines
    • No new dependencies added.

@bytesized

Copy link
Copy Markdown
Author

I have been thinking a fair amount about the part of this patch that I'm the least sure about: the part in components/fxa-client/src/state_machine/mod.rs where we avoid calling on_auth_issues() on the Uninitialized -> AuthIssues transition. When I wrote it, I felt reasonably sure that this change wouldn't have any negative effects because that state transition should only happen after we already transitioned to AuthIssues and because the effects of on_auth_issues should persist through the next initialization. But having thought about it a bit more, I believe that there are ways of having the Uninitialized -> AuthIssues transition without having previously been in the AuthIssues state. So I think I may have to undo that change. But I'm not sure of the correct way to address the issue that it always runs on_auth_issues when we start up in the AuthIssues state, resetting the last_auth_recheck_time timer. I'm going to have to think about this.

@bytesized

Copy link
Copy Markdown
Author

I ended up not putting the logic to reset the auth timer in on_auth_issues() because of the issue I discussed above. To summarize, we always call on_auth_issues() on the Uninitialized to AuthIssues transition which causes the recheck to never happen since we never see an expired timer. But this means that I've basically littered the transition() function with account.reset_auth_recheck_timer() calls. Which doesn't feel great since it makes maintenance of this function kinda nasty. I'm not sure what a better option is but I'm open to ideas.

@bendk
bendk self-requested a review September 2, 2026 22:08
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.

1 participant