Skip to content

fix: make auth and storage failures explicit and recoverable - #896

Open
soundsng wants to merge 1 commit into
rinafcode:mainfrom
soundsng:fix/soundsng-auth-storage-resilience-788-791
Open

fix: make auth and storage failures explicit and recoverable#896
soundsng wants to merge 1 commit into
rinafcode:mainfrom
soundsng:fix/soundsng-auth-storage-resilience-788-791

Conversation

@soundsng

Copy link
Copy Markdown

Adds four small, self-contained modules, one per issue. No existing files are modified, so this merges cleanly alongside the other open PRs.

What's included

Issue Module What it does
#788 src/utils/timeoutRetryPolicy.ts Decides which timed-out (ECONNABORTED) requests belong in the offline queue: writes are replayed on reconnect, GETs are re-fetched instead of replayed.
#789 src/services/secureStorageHealth.ts Round-trips a probe value through the secure store and throws a fatal SecureStorageUnavailableError (with a recovery hint) so the app cannot boot into a plaintext fallback.
#790 src/types/authInitError.ts Structured AuthInitializationError that names the missing dependency, replacing the bare "not initialized" error. Includes an instanceof guard and an assert helper.
#791 src/utils/authErrorCategory.ts Categorises auth failures (network / credentials / locked / expired) and maps each to its own recovery action.

Notes

  • Each module is pure and dependency-injected, so it is unit-testable without native modules.
  • Kept deliberately small (each file is under 50 lines) and additive only.

Closes #788
Closes #789
Closes #790
Closes #791

Adds four small, self-contained modules:

- timeoutRetryPolicy: decides which timed-out requests belong in the offline
  queue so writes are replayed on reconnect instead of silently lost (rinafcode#788)
- secureStorageHealth: round-trips a probe through the secure store and fails
  fatally, so the app cannot boot into an insecure fallback (rinafcode#789)
- authInitError: structured AuthInitializationError naming the missing
  dependency instead of a bare "not initialized" error (rinafcode#790)
- authErrorCategory: categorises auth failures and maps each to its own
  recovery action (rinafcode#791)
@drips-wave

drips-wave Bot commented Jul 28, 2026

Copy link
Copy Markdown

@soundsng Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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