Repository navigation
Bank Sync: one Bank on all your devices and browser (optional, off by default) - #51
Open
YoruDev-Ryland wants to merge 3 commits into
Open
YoruDev-Ryland wants to merge 3 commits into
YoruDev-Ryland wants to merge 3 commits into
Conversation
Additions the sync library builds on; Local mode behaves exactly as before. - FileBankService.ApplyRemote: applies a batch from a sync server in one index write (checked first, so a refused batch changes nothing), plus IsReadOnly and Reload. - BankDecor groups box names, wallpapers and a new BankSettings file (bank-settings.json beside the index) so they can sync as part of the Bank. Each raises Changed on local edits only, and can be replaced or reloaded.
… server A library with no UI: every device keeps its full Bank and works offline; changes go out in groups that the server applies all-or-nothing, and edits of the same Pokémon on two devices become conflicts the user resolves instead of silent overwrites. A copy of the Bank is taken before it is ever replaced. The server (GPL-3.0-or-later, self-hostable with Docker) is a submodule at external/pkforge-sync-server; the tests start it in-process, so CI needs no running server.
- Bank Sync page: connect with an address and sign in, a pairing code (typed or from a QR picture, for devices without a camera), status, conflicts, devices and Stop syncing. Syncs a second after a change, when the app returns, and every two minutes. - Restore points also list the Bank copies sync takes; restoring one turns Bank Sync off first so the old Bank isn't sent to other devices. - The living dex start box moves once from device preferences into the Bank's settings, so every device fills the same boxes. - App lifecycle: Android can recreate the activity without OnResume; the return to the foreground is now completed when the window activates.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #18
Bank Sync keeps one Bank in step across devices (handheld, phone, tablet) through a PKForge Sync server that users run themselves with Docker. It is off by default. Anyone who never opens it keeps today's app: the Bank stays in the same folder with the same files.
The server is GPL-3.0-or-later and is included as a submodule at
external/pkforge-sync-server, like PKHeX.How it works
Size
src/PKForge.Sync, Bank Sync page, small services)tests/PKForge.Sync.Tests, 3 Domain test files)Three commits, each building on the last:
FileBankServicegainsApplyRemote,IsReadOnlyandReload. Box names, wallpapers and a newbank-settings.jsonare grouped inBankDecorand report local edits.PKForge.Sync, with no UI. Its tests start the server in-process, so CI needs nothing running.build.ymlgains onedotnet testline.App.cs,MauiProgram.cs,BankPage.cs, the Restore points page,LivingDexAutopilot.cs, the QR popup and the manifest (network permission).Changes to existing behavior
bank-settings.json, so every device fills the same boxes. The new value is written before the old preference is removed.OnResume, so the app never noticed it was back in the foreground. It now finishes that step when the window activates.Testing
dotnet test: Domain 626, Engine 953, Sync 142, all passing.Two small fixes found along the way are separate PRs (the menu marquee crash and the popup scrollbar line). They don't depend on this one.