Repository navigation
feat: sync layouts, drawings, accounts and the CID across computers - #61
Merged
Merged
Conversation
Phase 3 of sync: every renderer store now syncs through the encrypted engine. Layouts and their charts, chart, layout and symbol drawings, profiles, chart and drawing templates, drawing looks, imported themes, watchlists, favourite indicators, timeframes and drawing tools, custom colours, price alerts, Pine scripts, and the theme, replay, Trade Assistant, Risk Ticket and risk settings. Panels, docks, the layout, chart and watchlist in front, and one-click consent stay per computer. - Renderer adapters (src/lib/sync-sources.ts) over a pure workspace model (src/lib/sync-model.ts), served over IPC to main-side proxies (electron/sync-renderer.ts). Validation runs in the renderer; source validation may be async and gets the record id. - New kinds layoutCharts and layoutDrawings; ordered maps carry an order item so drawing z-order and watchlist order survive merges. - A computer joining existing synced content chooses Merge or Use synced data instead of pushing its default layout everywhere. - Closing the window pushes unsynced edits first, while the stores can still be read.
…computers Phase 4 of sync, after a security review of Phases 1-3. Accounts and secrets: - Saved account profiles always sync. Passwords, API keys and webhook secrets sync only on computers that opt in and have a system keychain; the most recently saved password wins (secretSavedAt), and a secret that no longer decrypts is skipped, never read as deleted. - "Use one CID on all my computers" syncs the CID; turning it on asks which CID to keep when the synced one differs. - Webhook sources and notification targets sync; whether each source is switched on and the listener settings stay per computer. Presence and login handoff: - Computers list the accounts they hold in the encrypted manifest (30-minute presence, renewed at 15, cleared on logout and quit). - An MT5 login to an account open elsewhere asks Move it here / Log in anyway / Cancel. Move writes a request the other computer honours only if its session predates it, so an asleep computer logs out on waking but a later deliberate login is never ended. Review fixes: - Merged values are validated before apply; a failing merge keeps the remote value instead of failing every sync. - The unchanged-head shortcut re-pulls while any record lacks a base, so a skipped record is never overwritten by local data. - __proto__ refused as ids and keys; own-property lookups in merges. - Malformed renderer replies reject; snapshots must be plain JSON; secret kinds can never be served by the renderer. - The join question survives a restart, and a first merge prefers the synced value so a fresh install's defaults never replace settings. - Closing the window on macOS no longer stops sync; a loading window shows as waiting instead of Synced.
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.
Phases 3 and 4 of Sync Across Computers. Version 1.0.0 shipped the encrypted connection but synced nothing; this makes your content, saved accounts and (by choice) passwords and the CID follow you between computers.
Phase 3: content (df332f1)
src/lib/sync-sources.ts,src/lib/sync-model.ts) are served over IPC to main-side proxies (electron/sync-renderer.ts). The renderer never receives keys, tokens or secret records.Phase 4: accounts, secrets, CID, login handoff (7b9a788)
Security review of Phases 1-3
An independent read-only review ran before secrets were wired in. It found no path for keys or secrets to reach the renderer, and seven data-loss or wedging issues, all fixed in 7b9a788:
__proto__refused as ids and keys;Deliberate departures from the design
Testing
npm run checkpasses: typecheck, 842 tests, production build.