Repository navigation
fix(platform): close the session-lapse review round after #3763 - #3795
Merged
Merged
Conversation
readableErrorMessage passed a TypeError's or SyntaxError's developer text through, while the platform's failureDetail hid it. The floor now returns nothing for the runtime's own error types, and failureDetail builds on it after its refusal and connection checks, so the two read a failure by one rule. The repo contract says so.
The guard's error name missed the short catch names, so 'description: e.message' passed. It now matches e and ex, and an allowlist entry names its file and the matched text, so it exempts one site rather than its whole file.
The Google Drive and Microsoft 365 imports, team delete (dialog and bulk bar) and the team membership writes kept the write hook's default toast while their surfaces also toasted, so one failure raised two toasts, or one per refused call. The hooks pass errorToast: false. The create dialog now reports a refused member add in its one toast (the team exists, so it no longer says it could not be created, nor hides the refusal behind a success toast). Tests run the real hooks and count every toast.
authClientError reads a 401 with the code UNAUTHORIZED, or with no code, as a lapsed session. That rested on one browser observation of create-team's bare 401. A Better Auth upgrade that changed either answer would have put the library's English under the team dialogs' localized titles, and nothing would have failed. The answers are now pinned once, in backend/auth/team-lapse.integration.ts. The new backend:integration lane checkLapsedTeamWrites asks the real create-team and update-team, through the Better Auth client the SPA uses, with no session cookie, an expired session and a signed-out one, and asserts that nothing was written. Because backend:integration is not a CI job, auth-client-error.test.ts also runs the app's own createAuth handler, with no reachable database, in the CI test lane, holds its no-session answers to the same pin, and reads them through authClientError into the session sentence in en, de and fr.
In an installed iPhone app the in-shell notice padded the notch, and the shell's mobile header, or a thread page's spacer, padded it again right below it, leaving a blank band while the notice showed. The notice now carries data-session-lapse-notice; the header and the spacer (now ShellMobileHeader and ShellNotchSpacer) drop their pad while the shell holds it. On a dashboard page outside the shell (the organization wizard, the changelog, access denied) the notice floated over the top of the page. Below about 536 px it covered the header or the changelog's back link. It is now the same compact row as in the shell, placed in the flow above the page, and the page is bounded to the rest of the window, so a page exactly the window tall still scrolls to its last control. The frame is always there, so the page never remounts. The browser test measures both in Chromium: a 47 px notch cleared once, and the three real page frames at 375, 900x400 and 1280 px.
AUTH-B13 now creates and renames a team on the held tab, in de, fr and en, each under its localized title with the session sentence beneath. Its Environment step runs on a tab that really stayed open, in a browser tab of its own: the old box said 'still-open' while its other steps navigated that tab away, and it passed only because of the read's five-minute freshness. The member preferences page (en, de, fr) now says when a reopened Environment tab still shows its variables. NAV-B5 gains a save variant: a save made offline shows the localized connection sentence in de and fr, per engine, never the browser's own words. The adapters coverage moved from the AUTH-B13 automation row to NAV-B5's. AUTH-B13 and AUTH-B14 name the new tests and the lane, and a pin records why the Environment step has its own tab.
Importing a folder from Google Drive or Microsoft 365 lists it first, through an action that kept its default toast. A refused listing therefore toasted, and the import's own failure toast followed. The walk's listing actions now pass errorToast: false. The dialog already reports every walk failure in its one toast. The lapsed-session test now imports a folder too.
The create dialog's destructive toast for refused member adds reused `settings.teams.teamCreated`, which French words as "créée avec succès", so a red toast said the team was created successfully above the reason. It now reads `settings.teams.teamCreatedMembersRefused` in en, de and fr. The partial refusal without a lapse (a 409 `NOT_A_MEMBER`) and the success toast had no test: both are pinned now with the real toast, one toast each, the dialog closed, and recorded in a SET-F18 automation row.
`BulkDeleteBar` raised one failure toast for a batch with only its title. A caller whose write hook keeps its own toast silent, so a failure raises one toast, had no way to show the refusal's words. `describeFailure` receives the refused deletes' reasons and returns the toast's description; without it the toast is unchanged.
`useDeleteTeam` keeps its own toast silent, so a bulk delete from the teams table showed only "Couldn't delete some items", never why. The table now passes the first refusal through `failureDetail` to the bar, so a lapsed session reads `common.errors.sessionEnded` in that toast.
The standing notice unmounted while the confirmation was open, so its Sign in grew the page behind the dialog by the notice's height and Stay here shrank it again, outside the shell and in it, and the focus had no Sign in to return to. The notice now stays, invisible and aria-hidden, while the confirmation is open; the notch stays cleared once.
An entry was keyed by file and matched text, so it also exempted every identical copy of its line in that file. An entry now carries a count (one by default): a file with more copies lists them all, and one with fewer marks the entry stale.
The team-lapse lane carried a byte-for-byte copy of integration-check's `cookieHeaderFrom` and its own copy of `signUpUser`. Both move, with the throwaway users' password, to `backend/integration-lane-helpers.ts`, which the check and the lane import.
AUTH-B14 gains a device step: no notch band above the shell header in an installed iPhone app, no page jump under the reopened confirmation, and at 375 px the notice in the flow above the changelog (Back can be pressed) and the organization wizard (scrolls to its last control). The AUTH-B13 automation row now says no workflow runs `backend:integration`, so the expired and signed-out team-write answers are proven only when `checkLapsedTeamWrites` is run by hand.
This was referenced Sep 29, 2026
yannickmonney
added a commit
that referenced
this pull request
Sep 29, 2026
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.
Follow-up to #3763, from its post-merge review (TALE-100). I re-checked each finding on
main(c2c5d4a) before changing it; all eight still held. The branch is rebased on 3257d0e.What changed
Better Auth's lapse answer is pinned (medium).
authClientErrorreads a 401 with the codeUNAUTHORIZED, or with no code at all, as a lapsed session. That rested on one browser observation ofcreate-team's bare 401. The two answers are now pinned once, inbackend/auth/team-lapse.integration.ts, and held to the library twice:backend:integrationlane,checkLapsedTeamWrites, asks the realcreate-teamandupdate-teamon Postgres. It goes through the Better Auth client the SPA uses and tries three sessions: no cookie, an expired one and a signed-out one. It also has a live control and checks that the refused writes wrote nothing.backend:integrationis not a CI job, soapp/lib/auth/auth-client-error.test.tsalso runs the app's owncreateAuthhandler in the CItestlane. Its database is a closed port, so an answer that needed the database would be a 500. The test holds the no-session answers to the same pin and reads them throughauthClientErrorto the session sentence in en, de and fr. Moving the pin, or making the app stop reading a bare 401 as a lapse, fails both.settings.teams.teamCreateFailed/teamUpdateFailed) withcommon.errors.sessionEndedbeneath. The AUTH-B13 automation row names the test and the lane.No notch band (low). In an installed iPhone app, the in-shell notice padded the notch, and the shell's mobile header (or a thread page's spacer) padded it again right below. The notice now carries
data-session-lapse-notice. The header and spacer are extracted asShellMobileHeaderandShellNotchSpacer(app/components/layout/shell-mobile-header.tsx), and drop their pad while.mobile-nav-shellholds the notice.The notice no longer floats over pages outside the shell (low). On the organization wizard, the changelog and access-denied pages, the notice floated at the top of the window. At 375 px it covered the header and the changelog's back link. It is now the shell's compact row (title and Sign in, the sentence kept for screen readers), placed in the flow above the page. The page is bounded to the rest of the window while the notice shows, so a page exactly the window tall (
STANDALONE_PAGE,h-screen) still scrolls to its last control. The frame around the dashboard is always there, so pages never remount when the notice appears.One toast per failure (low). These surfaces kept the write hook's default toast while also toasting through
failureDetail: the Google Drive and Microsoft 365 imports (including the import walk's folder-listing actions), team delete (the dialog and the teams table's bulk bar), and adding and removing members. One failure raised two toasts, or one per refused call. The hooks now passerrorToast: false.One behaviour change in the create dialog: a refused member add after the team exists now shows one destructive toast, "Team created, but not every member was added" (
teams.teamCreatedMembersRefused) with the refusal (the session sentence orteams.membershipChangesFailed). Before, it said "Couldn't create team", or was hidden behind a success toast that claimed every member was added. The new*.lapsed-session.test.tsxfiles run the real hooks, adapter rows andbackendFetch, and count every toast on the real@tale/ui/use-toast.One rule for runtime errors (low).
readableErrorMessage(@tale/ui/error-message) now returns nothing for the runtime's own error types.failureDetailbuilds on it after its refusal and connection checks, so the two read a failure by one rule.json-inputneeds no opt-in: its inline validation shows the parser's words, and its toast falls back tovalidation.invalidJson..agents/repo.mdsays so.The guard catches
e.message(low). Error names now includeeandex, with samples. An allowlist entry is keyed by file and the matched text and counts its sites (one by default), so it exempts exactly those, not its whole file or another copy of its line.AUTH-B13 (g) and the member docs agree (low). The box keeps the Environment tab open in a browser tab of its own. The old "still-open" tab had been navigated away and passed only inside the read's five-minute freshness. The member preferences page (en, de, fr) now says that a reopened Environment tab shows its variables for five minutes after it last loaded. A pin records why.
The connection sentence has a box (low). NAV-B5 gains a save variant: save on the Environment tab with the browser offline, in de and fr and in Firefox and Safari. It expects
common.errors.connectionLostunder the save's title, never the browser's own wording. Theadapters.test.tscoverage moved from the AUTH-B13 row to NAV-B5's.Review round 1
NOT_A_MEMBER) and the success toast are now tested on the real toast, one toast each, dialog closed; a SET-F18 automation row records it.teamCreatedsays "créée avec succès", so the destructive toast has its own key,teams.teamCreatedMembersRefused, in en/de/fr (no de-CH override needed).BulkDeleteBartakes an optionaldescribeFailure(reasons); the teams table passes the first refusal throughfailureDetail, so a lapsed bulk delete sayscommon.errors.sessionEnded.invisibleandaria-hidden, instead of unmounting; the page no longer moves 49 px behind the dialog and on Stay here (browser tests fail on the previous code).cookieHeaderFromandsignUpUsermoved tobackend/integration-lane-helpers.ts, shared byintegration-check.tsand the team-lapse lane (not re-run on Postgres this round: typecheck only).backend:integrationis run by hand.How I verified it
Every new test was run against
main's code, and failed there:main's dialogs.Integration lane:
ITEST_LANES=checkLapsedTeamWriteson a scratch Postgres 16 passes 9/9 of its checks, on the rebased branch too. The only other failure in that run is the BM25 boot check, which needspg_searchand isn't available here.Real browser: Chromium 141 in vitest browser mode, 34 tests, measured at 375×740, 900×400 and 1280×800 with a 47 px notch.
The real app: local backend and Vite, 375×740, signed out through the same cookie jar, then Stay here.
mainvisual-aspect-analyzer was embedded and signed in, with the lapse set up in its
interacthook, againstmainas baseline:Checks run locally, all passing:
tscover every changed file (integration-check.tsin a run of its own);oxfmt --check.lint:manual,check-guideonauth.mdandnavigation.md, and the docs suite (35 files).The whole platform suite, workspace-wide
tscand knip are left to CI (the sandbox's 4 GB limit).Left open
useUpsertGovernancePolicycomment says editors passerrorToast: false, but most do not), legal hold, data residency, enterprise SSO and more.TOAST_LIMIT1 shows only the last toast, but both fire. That is its own sweep.onedrive-file-table.tsx), noticed while testing the imports./dashboard/create-organizationmay leave for/log-inby itself after a lapse. Its effect navigates there onceuseAuth()reports signed out, and the recovery's recheck refreshes that probe. If so, the wizard's drafts skip the Stay-here confirmation. That is from readingcreate-organization.tsx; I did not reproduce it.Overlaps only the shared registers with open PRs:
integration-check.ts(one import and one lane entry),reference/automation.md(three rows) andpins.md(#3794, #3787, #3786, #3785, #3784, #3782, #3781, #3780, #3779, #3778, #3776, #3775, #3772).