Add PocketBase persistence backend with DAOs, cipher codec, and legacy migration - #70
Merged
Conversation
Status changed from Planning to In progress. P0 passed (pure-Go arm64 cross-compile, token-gated HTTP, collection CRUD verified on host). P1 done (Go wrapper, JS migrations embedded via go:embed, Makefile). P2 done (Dart runtime, PbClient, lifecycle wiring; spike screen deleted). Added findings section documenting size budget (32 MB), stdout handshake protocol, extractNativeLibs requirement, and collection rule design.
PB holds only ciphertext, so it can't be used until the key exists. Starting it non-blocking ensures the unlock flow is never delayed or failed by sidecar issues. Errors are logged and recovered silently.
P3: cipher_codec, shared PbDao base, 4 entity DAOs, PocketBaseStore, legacy migration P4: LocalStore interface, VaultService delegate with PB-first routing, pb_wire_test.dart e2e
Return early if PocketBase is disabled in settings, then activate it after startup. The error message now reflects the fallback to legacy storage when activation fails.
Routes non-decoy index through the PocketBase sidecar, running one-time legacy migration on first activation. Requires vault unlock and only operates when the sidecar is available.
Document testing strategies for the embedded PocketBase store: automated tests, host sidecar verification, and on-device debugging.
Add /locker-pb directory and update comment to reflect both make targets
One-time migration guarded by a secure-storage flag; upsert-only so existing PocketBase data is preserved. Legacy store is retained as fallback.
Implements LocalStore interface using PocketBase DAOs (files, albums, folders, tags) with caching and reconcile support. Non-decoy vault only.
Covers CipherCodec encryption, VaultFileDao round-trip, ghost reconciliation, default album seeding, P4.4 e2e sync workflow, and PB-dead fallback path.
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.
Summary
Adds a complete PocketBase persistence backend for vault metadata with encrypted DAOs, a cipher codec for secret column encryption, a
LocalStoreabstraction, legacy secure storage migration with fallback, and runtime sidecar management.Changes
PocketBase DAOs
PbDaoabstract class for PocketBase collection CRUDVaultFileDaofor encrypted vault file persistenceAlbumDaofor PocketBase album persistenceFolderDaofor encrypted folder persistenceTagDaofor encrypted tag storageCipher & Store
CipherCodecfor PocketBase secret column encryptionPocketBaseStoreimplementingLocalStoreinterface (files, albums, folders, tags) with caching and reconcile supportLocalStoreinterface for vault-metadata persistence abstractionMigration & Fallback
Sidecar Integration
VaultSettingsTesting
PbHandshakeParserUI
Documentation
.gitignorefor PocketBase binaries