Skip to content

Add PocketBase persistence backend with DAOs, cipher codec, and legacy migration - #70

Merged
ultraelectronica merged 27 commits into
mainfrom
versionF
Aug 18, 2026
Merged

Add PocketBase persistence backend with DAOs, cipher codec, and legacy migration#70
ultraelectronica merged 27 commits into
mainfrom
versionF

Conversation

@ultraelectronica

Copy link
Copy Markdown
Member

Summary

Adds a complete PocketBase persistence backend for vault metadata with encrypted DAOs, a cipher codec for secret column encryption, a LocalStore abstraction, legacy secure storage migration with fallback, and runtime sidecar management.

Changes

PocketBase DAOs

  • Add PbDao abstract class for PocketBase collection CRUD
  • Add VaultFileDao for encrypted vault file persistence
  • Add AlbumDao for PocketBase album persistence
  • Add FolderDao for encrypted folder persistence
  • Add TagDao for encrypted tag storage

Cipher & Store

  • Add CipherCodec for PocketBase secret column encryption
  • Add PocketBaseStore implementing LocalStore interface (files, albums, folders, tags) with caching and reconcile support
  • Add LocalStore interface for vault-metadata persistence abstraction
  • Add file key cache for performance

Migration & Fallback

  • Add legacy secure storage to PocketBase migration (one-time, upsert-only, guarded by flag)
  • Legacy store retained as fallback when PocketBase unavailable
  • Routes non-decoy index through PocketBase sidecar with one-time legacy migration

Sidecar Integration

  • Add PocketBase sidecar HTTP client
  • Add PocketBase runtime for sidecar process management
  • Start sidecar after successful unlock (non-blocking)
  • Guard startup with vault settings (return early if disabled)
  • Disable PB first-run installer in embedded mode
  • Enable PocketBase by default in VaultSettings
  • Enable native library extraction on Android

Testing

  • Add tests for PocketBase store, cipher codec, and sync integration (Ghost reconciliation, default album seeding, P4.4 e2e, PB-dead fallback)
  • Add runtime tests for PbHandshakeParser
  • Add testing guide for embedded PocketBase store

UI

  • Remove PocketBase spike screen

Documentation

  • Document P3/P4 PocketBase integration phases complete
  • Update .gitignore for PocketBase binaries

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.
@ultraelectronica ultraelectronica self-assigned this Aug 18, 2026
@ultraelectronica
ultraelectronica merged commit fa34e18 into main Aug 18, 2026
1 check failed
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.

1 participant