3 Commits
Author SHA1 Message Date
waozi d25420e61d Check the account keys from the settings cache
Every frame asked whether this device holds an account by reading its
public and private keys, values too long for the settings cache, so each
frame queried SQLite and copied kilobytes: a twentieth of a Lumi frame on
the Moto. The cache now remembers a long value as present without its
bytes, and the account check asks only whether each key is present.
2026-10-19 14:34:13 -03:00
waozi 2d40562dc3 Split the storage core by responsibility
storage_core.zi keeps what every storage module shares: the delegate hooks,
meta values, the sync keys and record-field version, new IDs and change
times. The rest moved unchanged into focused modules:

- storage_settings.zi: settings and cached social snapshots
- storage_json_sql.zi: JSON reads through SQLite
- sync_outbox.zi: queueing local records for the node
- sync_state.zi: the sync account, status, clearing and purging
- sync_migrations.zi: Lumi's collection and the connected-server flag
- sync_record_codec.zi: local rows as record payloads
- sync_collections.zi: collections and record IDs per entity
- sync_record_crypto.zi: record keys, sealing, opening and kept copies
- sync_apply.zi: applying received records
- sync_exchange.zi: the request payload and applying the response
- storage_profile_stats.zi and storage_export_csv.zi

Names, the protocol and the SQL are unchanged. Importing the core still
links every part, as one module did; importers import the parts whose
names they use. StorageSyncStatus moved beside storage_sync_status, so its
generated header no longer depends on an import cycle. The restore SQL test
and its law mutation read sync_outbox.zi, and the sync recovery link test
leaves out the parts it stubs, as it left out the core.
2026-10-17 21:01:19 -03:00
waozi 5a74caeb7b Keep background sync from freezing Inner Breeze inside Harmony
The owner saw Inner Breeze stop rendering inside Harmony. Its frame loop and
live-update worker were both waiting forever for the database connection,
held by a social-refresh worker that had already exited.

Settings write batches shared one depth counter across threads. When two
workers saved their sync session together, the second joined the first's
batch without its own BEGIN, so the first returned without COMMIT and exited
while its open transaction still held the connection. Each batch now holds
the connection for its own thread until it commits, a failed COMMIT rolls
back, and a failed sync savepoint release is rolled back too, so no worker
can leave the connection held.
2026-10-05 11:58:26 -03:00