fix(onboard): store an added agent when it connects; update dependencies - #266
Merged
Merged
Conversation
… encrypt prompt is left Adding a second agent from the setup page's "+ Connect another trust agent" looked like it worked and left the list unchanged. A successful connect held the connection in component state until the operator clicked Encrypt or Skip on the "Wallet onboarded" screen. That screen reads as the end, so people closed the tab there. The agent kept the ACL entry and the offscreen document kept the holder key, but the wallet never recorded the agent. OnboardView now commits the connection as soon as connect succeeds. The encrypt prompt is an optional follow-up that only re-wraps the key. Leaving it closes the add-another panel. The key can still be encrypted later from the plaintext banner. Two related ways the connection map lost data: - Each extension page hydrated the persisted map once and wrote the whole blob back on every change. A page loaded before another page added an agent wrote its stale map over the new one. The store now rehydrates when storage.onChanged reports another page's write. Its own writes are recognised and skipped. - The popup's transport refresh rebuilt the connection from a hand-picked list that omitted homeContext and agentScope. Any transport drift erased them, and the setup page then said "not recorded". withRefreshedTransports (store.ts) replaces only the three transport members. Signed-off-by: Glenn Gore <glenn.g@affinidi.com>
- @openvtc/trust-tasks ^0.19.14 -> ^0.19.17 (root and core) - @types/chrome ^0.2.2 -> ^0.3.0 (extension) - @tanstack/react-query ^5.101.2 -> ^5.103.2, lucide-react ^1.45.0 -> ^1.47.0, react-router-dom ^7.18.1 -> ^7.18.4 (pwa) - lockfile refreshed within existing ranges (rolldown, rollup, @types/node and others) The @swc/core and @swc/wasm override stays at ~1.15.47. The vite-plugin-top-level-await break it guards against is not fixed. Signed-off-by: Glenn Gore <glenn.g@affinidi.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.
Adding a second trust agent looked like it worked, but the agent never showed up in the popup's list of VTAs. It happened twice in a row.
Cause
From the setup page's + Connect another trust agent, a successful connect put the connection in component state and saved it only when the operator clicked Encrypt or Skip on the "Wallet onboarded ✓" screen. That screen reads as the end, so people closed the tab there. By then:
Fix
OnboardViewsaves the connection as soon as connect succeeds. The encrypt prompt is now an optional step that only re-wraps the key; leaving it closes the add-another panel. The key can still be encrypted later from the plaintext banner.pnm-connection/v3map once, and every write replaced the whole blob. A page loaded before another page added an agent would write its old map back over it. The store now reloads whenstorage.onChangedreports a write from another page. Its own writes are recognised and skipped, andhydratedoesn't persist, so this can't loop.homeContext/agentScopethrough a transport refresh. The popup rebuilt the connection from a hand-picked list that left both out, so any transport change erased them and the setup page then said "not recorded".withRefreshedTransports(store.ts) replaces only the three transport members.Dependencies
@openvtc/trust-tasks^0.19.14 → ^0.19.17, at the root and in core.@types/chrome^0.2.2 → ^0.3.0 (extension). No code changes were needed.@tanstack/react-query^5.103.2,lucide-react^1.47.0,react-router-dom^7.18.4.@types/node, among others).@swcoverride stays at~1.15.47; the plugin break it guards against is still unfixed.Checks
npm run clean→npm run lint→npm run build→npm test: 1550 passed, 0 failed.dist/passes locally: the single-bundle worker and console, the admin, seeds and persona guards, the Web Store zip, and pinned commits.connection-store-sync.test.mts(2 tests), plus one rendered test inonboard-scope.render.test.mts. All 3 fail on main and pass here.Pre-merge checklist (vti-stack-development-guide §9)
Signed-off-by: Glenn Gore glenn.g@affinidi.com