oficina / meet Public

Calls: Connect item follows the stored link; unknown Oficina sign-in resumes as a link open

On branch fix/connect-item-when-linked

The bug

The account menu offered "Connect your Oficina account" to any member whose session method was magiclink or keymail. A person whose account is already linked to Oficina, but who signed in this time with Calls' own emailed link, still saw it (Paul hit this).

The fix

offersHomeLink(r, v) keeps its conditions (Home configured, signed in, member, local method) and adds a.home.bridge.Linked(r.Context(), v.person.ID) returning (false, nil). The offer follows the stored link, not how this session signed in. An error offers nothing. The person ID comes from the viewer that account() already has (viewerOf: the context person behind the guards, otherwise the optional lookup), so there is no second person lookup. The chrome.go diff is local to offersHomeLink and its one call, so it should merge cleanly with feat/switcher-tiles.

Lookup cost: one SELECT 1 FROM home_identity_links WHERE issuer = ? AND person_id = ? on the UNIQUE (issuer, person_id) index, run only on renders that draw the account menu for a local member session. A Home session short-circuits before the query.

Upstream this depends on (merge these first)

  • home fix/connect-item-when-linked @ 08bbcf3 (Bridge.Linked, connect.PageFor, the unknown-assertion resume, the success page, the new copy)
  • estilo fix/connect-item-when-linked @ 0b375d5 (the homeconnect button row)

This branch pins those branch commits. Once they merge, move the pin to the merge commits.

What changes for the person

  • Unknown assertion: an Oficina sign-in with no link here shows "Oficina account not connected". Its one button, "Sign in to your existing account", goes to /signin/local. The next fresh local sign-in in the same browser (/auth/local/complete) begins the link itself: /auth/start?return_to=%2Faccount%2Fhome%2Fconfirm, then a fresh Home assertion, then the confirm page. A marker older than 10 minutes is ignored, and the person lands on /continue as before.
  • Success page: Connect accounts now redirects to /account/home/confirm?connected=1&return_to=…, which shows "Accounts connected", only to a signed-in person whose link is stored. Calls renders with connect.PageFor, so "Back to the app" returns to the page the link began from, not /.
  • Button row: the connect pages' buttons share one <div rst-form-foot> row, primary first.
  • Copy: Calls has no copy overrides (it uses connect.English directly), so it gets the new confirm and unknown copy for free.

Confirm step: kept

We kept the explicit confirm click. Skipping it would let a remembered unknown assertion plus a local sign-in link the two accounts with no deliberate gesture. The Oficina assertion carries only an opaque subject, so the confirm page cannot name the Oficina address, only the local one. Instead, the confirm page now has its own title ("Connect these two accounts?") and its own copy.

Was the link actually stored?

Yes. The tests count rows in home_identity_links joined to alice's persons row:

  • 0 before the confirm click;
  • 1 after Connect accounts, both from the menu and from the unknown-assertion resume.

After the resume, a later Oficina sign-in with that subject succeeds.

Edge case: the resume needs the person's persons row to exist already. Calls' LookupLocalSession uses existingHomePerson, and the row is created on /continue. A member who has never signed in to Calls before therefore does not resume. connect falls back to /account/home (the Connect page), which still works. The tests give alice one earlier sign-in, which is the "existing account" the page asks for.

Tests (internal/calls/home_connect_item_test.go), each seen red

| Test | What it checks | Red run | |---|---|---| | TestTheConnectItemFollowsTheStoredLinkNotTheSessionMethod | Unlinked local session: item shown. Home session: no item. Linked account signed in by emailed link: no item. | Without the offersHomeLink change: "a linked account signed in by emailed link is still offered to connect" | | TestConfirmingTheLinkSaysSoAndRetiresTheMenuItem | Confirm POST leads to Accounts connected, the row exists, and the next render in the same magic-link session has no item. | Without the fix: "the menu still offers to connect right after connecting". On the old pins: fails at the confirm page's title. | | TestAnUnknownOficinaSigninResumesAsALinkAfterLocalSignin | The full resume flow (unknown page, local sign-in, freshness start, assertion, confirm, link stored), started from /signin?return_to=/settings. | Without PageFor: the success button is not href="/settings". On the old pins: lands on /continue. | | TestAnExpiredUnknownMarkerLandsAsBefore | A marker sealed with the fixture's DEK, 11 minutes old, lands on /continue. The same marker 1 minute old resumes, which shows the forged marker is the one connect writes. | On the old pins: the current-marker half fails. | | TestTheConnectPagesButtonsShareOneRowPrimaryFirst | Exact rst-form-foot markup, primary Connect first, then Back. | On the old estilo pin. |

Gate: GOTOOLCHAIN=go1.26.5 make ci and make race are green locally. The estilo bump broke no existing test.

Re-pinned after the coordinator restart. home/connect is now 4d87d00, the connect branch caught up with home main 0ceb238, and estilo comes in at 1817c1c, the homeconnect row branch caught up with switcher tiles d53b8e9. The local gate is green with go1.26.5. The pins should move to the merge commits once estilo and home land.

On "name both accounts" (item 4): the Oficina half cannot be named, by design. The assertion's subject is an opaque person ref, and Home's one rule is that it never stores a readable address, so no Oficina address exists anywhere to show. The confirm step names the local account and gets its own question for a title. The explicit click stays, because the resumed flow would otherwise link accounts with no deliberate gesture.

VERDICT: APPROVE Branch verdict: ready to merge

GPT-6-Astra (Codex), reviewing for session 21a32889. Reviewed the whole branch at 963b84348907065085ab5296932f4c1ce0f7f792 against fetched origin/main.

  1. No blocking P0/P1/P2 findings. Security review: I found no P0/P1 issue or demonstrated login-CSRF/account-link substitution in the changed flow. The sealed, ten-minute marker carries no identity; the resumed link still uses the actual fresh local session, a fresh nonce-bound Home assertion, and an explicit CSRF-protected confirmation POST. Success is checked against stored linkage. This is a code-review verdict, not a waiver of the required merge gate.

The menu now checks stored linkage with the existing issuer/person index. The confirm and success screens preserve the explicit click and only report stored linkage. For a first-time local account the automatic start cannot yet find a person, but the fallback account route runs the normal participant/person setup, so it produces a usable Connect page. This takes an additional Connect click; it does not strand the user.

Validation: GOTOOLCHAIN=go1.26.5 make ci passed. A separate scratch Go-overlay real-router probe with no local person passed: unknown Oficina assertion -> fresh local sign-in -> /account/home -> HTTP 200 with a working Connect page.

Note: the exact-head runner fails its credits inventory test under Go 1.26.10, and I verified the same failure on origin/main. Use the pinned Go 1.26.5 runner and rerun before an actual merge; do not regenerate credits for the wrong toolchain. Land the reviewed estilo/home dependencies first and update pins after squash if required.

New head: 9b004532ed2a2f521db8b1a7bf3f66270da237d1. estilo #25 and home #84 have merged, so this branch now pins main: estilo f14458a, and home/connect and home/handoff ff16bf5. Current origin/main is merged in; only go.mod and go.sum conflicted, and those were resolved to the new pins. writeestilo, where this repo has it, leaves the vendored CSS unchanged. The local gate is green with go1.26.5.