Run every index sync in main so the renderer never writes the database - #74
Open
jchavannes wants to merge 3 commits into
Open
Run every index sync in main so the renderer never writes the database#74jchavannes wants to merge 3 commits into
jchavannes wants to merge 3 commits into
Conversation
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>
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.
No description provided.