fix(ui): dedup ALIASES + user.identities by alias name (#114)#118
Merged
iduartgomez merged 1 commit intomainfrom May 6, 2026
Merged
fix(ui): dedup ALIASES + user.identities by alias name (#114)#118iduartgomez merged 1 commit intomainfrom
iduartgomez merged 1 commit intomainfrom
Conversation
2 tasks
iduartgomez
added a commit
that referenced
this pull request
May 6, 2026
* ci: clear apt lock between Playwright install-deps retries `timeout 240 npx playwright install-deps` SIGTERMs the npx wrapper but the spawned `apt-get update` keeps running and holds /var/lib/apt/lists/lock. Subsequent retry attempts then fail in <1s with "Could not get lock" — all 3 attempts burn within seconds and the step fails permanently. Reap the leftover apt-get and clear the lock files between attempts, and bump the retry sleep from 10s to 30s so the previous process has time to fully exit. Surfaced as a recurring infra flake on PR runs (e.g. PR #118). * ci: bump Playwright install-deps timeout 240s → 600s The previous 240s budget was below the typical ubicloud apt-mirror time (apt-get update alone runs 4-5min on these runners). All three retry attempts in the run on PR #119 timed out at 240s, even though the prior fix correctly clears the lock between retries. Bump per-attempt timeout to 10min and drop retries 3 → 2, keeping the worst-case wall time around 20min (step cap also bumped to 25). * ci: bypass slow apt-get update by installing chromium deps directly `npx playwright install-deps chromium` invokes `apt-get update` which hangs 10min+ on ubicloud's apt mirror, blowing past any reasonable timeout. Install the chromium package list directly with a plain `apt-get install -y` (skipping update entirely). Package list extracted from node_modules/playwright-core/lib/server/registry/nativeDeps.js under `ubuntu24.04-x64.chromium`. If Playwright bumps the list a future cache-miss build will fail and we'll catch it.
Within one browser session, a stale GetIdentities echo can race a manual CreateIdentity for the same alias name. Both paths pushed into ALIASES (thread_local) and user.identities (Signal) without checking what was already there, surfacing two rows for the same alias and (more importantly) two distinct inbox-contract subscriptions. The delegate is single-valued per alias name — `manager.identities` is a HashMap whose `insert` overwrites. So old keys are already gone server-side; the UI duplication is purely a state-management bug on our side. Fix: in `Identity::set_alias` (manual create path) and the new-entry branch of `Identity::set_aliases` (delegate echo restore path), look up the alias first and replace in place if present, rather than unconditionally pushing. This fixes the iso-harness test artifact (#114) where 3 Playwright tests sharing one delegate created 3 "alice" rows in test 3. Note: this does NOT add a UI guard against the user explicitly creating "alice" twice — that's a latent production data-loss bug tracked in #117 and needs a confirm dialog or refusal flow.
534f499 to
b4619f0
Compare
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.
Summary
Closes #114 (test artifact) — does NOT close #117 (production warning).
Within a single browser session, a stale
GetIdentitiesecho can race a manualCreateIdentityfor the same alias name. Both paths previously pushed intoALIASES(thread_local) anduser.identities(Signal) without checking, surfacing two rows for the same alias and two distinct inbox-contract subscriptions.The delegate is single-valued per alias name (
manager.identitiesis a HashMap whoseinsertoverwrites), so server-side this was never duplicated — purely a UI state-mgmt bug.Fix: dedup-by-alias on push in both
set_alias(manual create) and the new-entry branch ofset_aliases(delegate echo restore).Why this doesn't address #117
#117 is the latent production scenario where a user explicitly clicks "Create Identity" with a name they already use. The delegate already overwrites the keypair (existing behavior, predates this PR), so the prior identity's inbox messages become unreadable. That's data loss — needs a confirm dialog or refusal at the UI layer. Out of scope here.
Test plan
cargo check --target wasm32-unknown-unknowncleancargo clippy --target wasm32-unknown-unknowncleancargo fmt --checkclean