Skip to content

Run every index sync in main so the renderer never writes the database - #74

Open
jchavannes wants to merge 3 commits into
masterfrom
main-owned-sync
Open

Run every index sync in main so the renderer never writes the database#74
jchavannes wants to merge 3 commits into
masterfrom
main-owned-sync

Conversation

@jchavannes

Copy link
Copy Markdown
Collaborator

No description provided.

jchavannes and others added 3 commits September 1, 2026 15:39
The renderer downloaded history, tokens, blocks, profiles, posts and chat
rooms itself and handed the rows to main to store, which made it the
writer of every row the signer trusts: a compromised page could save a
real token output as NOT_SLP and the signer would spend it as plain BCH,
burning the tokens (#51).

Every sync now lives in main/sync, ported query for query, and the
renderer asks for one by name, hears progress on a per-request channel,
and reads the result back through the unchanged Get handlers. The save
and subscribe IPC is gone; subscriptions are six main-owned kinds that
store each frame before the page hears it. The generic GraphQL query
stays for broadcasting signed transactions only.

An address the index answers with null transactions is now dropped for
the run instead of being re-asked for all hundred rounds.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… dialog

With every index sync in main (#51), the index server is the one source the
wallet trusts for which outputs carry tokens - and the page still chose it.
SetWindowNetwork took a whole option object and set the window onto it after
a shape check, so a compromised page could point its window at any https
server without touching the file; SaveNetworkConfig wrote network.json with
nobody asked. A server that lies makes a token output read as plain coins,
and spending it that way burns the tokens.

Now main holds the presets, the file, and the choice of active entry. A
window is set onto a stored entry by id through SelectNetwork; the page
never hands main a server. Any server that is not a preset, not on this
machine, and not approved before is named in main's native dialog - modal to
the asking window, impossible for the page to cover or answer - before it is
written or used, on save and on first selection alike; declining leaves the
file and the window untouched.

Approval is main's own record, in ~/.memo/network-approved.json beside the
configuration rather than in it, so network.json keeps the shape every
release validates and a downgrade does not discard the person's networks. A
file written by an older version, with nobody asked, carries no approvals:
its custom servers are asked about on first use. The record is pruned to the
current list on every read, so one left stale by a failed write or by an
older release rewriting the configuration alone vouches for nothing.

The preload strips Electron's channel prefix from these calls' rejections,
so the editor and the load screen show the reason alone.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A selection changes only Last but writes the whole configuration, and the
confirmation dialog it may wait on is open for as long as a person takes.
Another load window can save an edit meanwhile, and writing back what was
read before the dialog reverted that edit and dropped the approval it had
recorded. After a dialog the files are now read again and the selection is
made against that reading; an entry that is gone, or now points at a
server the dialog did not name, is refused rather than selected.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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