Skip to content

fix(auth): add protected data unavailable error - #3990

Open
harsh62 wants to merge 4 commits into
mainfrom
auth-logout-errors
Open

fix(auth): add protected data unavailable error#3990
harsh62 wants to merge 4 commits into
mainfrom
auth-logout-errors

Conversation

@harsh62

@harsh62 harsh62 commented May 6, 2025

Copy link
Copy Markdown
Contributor

Issue #

#3972

Description

We’ve been investigating and believe the root cause is related to iOS application lifecycle behavior—specifically prewarming and protected data access. When the app is launched in the background (e.g., after device reboot or during system prewarming), UserDefaults and Keychain data may be inaccessible because protected data is not yet available. Amplify attempts to read credentials during this phase, fails to find them, and interprets it as corruption—triggering an unexpected AuthError and wiping the credentials.

Apple Documentation: https://developer.apple.com/documentation/uikit/about-the-app-launch-sequence.

General Checklist

  • Added new tests to cover change, if needed
  • Build succeeds with all target using Swift Package Manager
  • All unit tests pass
  • All integration tests pass
  • Security oriented best practices and standards are followed (e.g. using input sanitization, principle of least privilege, etc)
  • Documentation update for the change if required
  • PR title conforms to conventional commit style
  • New or updated tests include Given When Then inline code documentation and are named accordingly testThing_condition_expectation()
  • If breaking change, documentation/changelog update with migration instructions

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@harsh62
harsh62 requested a review from a team as a code owner May 6, 2025 22:52
thisisabhash
thisisabhash previously approved these changes May 7, 2025
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