Skip to content

fix: offline server restore requires the saved profile's provider (follow-up to #299) - #306

Merged
van-geaux merged 1 commit into
van-geaux:mainfrom
chortya:up/fix-offline-restore-provider
Oct 21, 2026
Merged

van-geaux merged 1 commit into
van-geaux:mainfrom
chortya:up/fix-offline-restore-provider

Conversation

@chortya

@chortya chortya commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Contribution pause

The maintainer lifted the pause and invited split PRs in #286.

  • The change is scoped to one problem: the provider edge case raised in the fix: don't wipe the current server when a switch target is unreachable #299 review.
  • Compatible with the provider-module refactor (one condition in AppCoordinator.changeServer).
  • Tests and manual-validation status are documented.
  • No credentials, cookies, API keys, private server URLs, or generated local data are included.

Summary

Follow-up to #299, as discussed in its review: the offline restore matched a saved profile by URL only.

Profiles are keyed by URL, so two profiles can't share an address. The reachable case is a single saved profile (say BookOrbit) whose address is chosen with another provider (say Komga) while the server is unreachable. The switch then:

  • restored the BookOrbit profile offline under the Komga provider, using that profile's session and cached state;
  • overwrote the profile's provider.

The restore now requires the provider to match as well. Another provider at that address gets the normal setup error, and the saved profile is left unchanged.

Verification

  • ./gradlew :app:testDebugUnitTest 949/949 pass, :app:lintDebug 0 errors, :app:assembleDebug succeeds; line endings preserved.
  • OfflineServerSwitchInstrumentedTest 3/3 on a Pixel Fold API 36 emulator. New: anotherProviderAtTheSavedAddressIsNotRestoredOffline, which fails without the fix.
  • Peer review (Codex GPT-6-Astra): no issues found.

🤖 Generated with Claude Code

Choosing a saved server's address with a different provider while it is
unreachable restored that profile offline: the other provider took over
its session and cached state, and the profile's provider was overwritten.
The offline restore now matches provider as well as URL; a different
provider at that address gets the normal setup error instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@van-geaux

Copy link
Copy Markdown
Owner

Thanks @chortya, this is a focused and necessary follow-up to #299. The provider-aware offline restore fix and regression test look good, and the automated checks pass. I found no blocking issues.

@van-geaux
van-geaux merged commit e921303 into van-geaux:main Oct 21, 2026
1 check passed
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