Skip to content

fix(console): signing out no longer hands your list's filter, search and sort to the next person who signs in - #29305

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-jfxofh
Nov 2, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-jfxofh

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steedos · project thread

Fixes #29174

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:会话结束时(点「退出登录」或会话过期),Console 跳到登录页所带的回跳链接 ?redirect= 只保留列表的路径和其它参数(如 recordId),去掉列表的 uf_* 状态(筛选、搜索、排序、分组、快速筛选、标签页)。下一个在同一浏览器登录的人回到同一个列表,看到的是自己保存的状态或视图默认值,首个数据请求不再带上一个人的条件。
  • 为什么改:共享电脑上 A 退出、B 登录,B 会打开 A 的筛选、搜索和排序,而筛选值可能是敏感信息(客户名、金额、搜索词)。这是 18.3.0 RC 中 P1 条目 records-forms.adhoc-filter-sort-builder 的 A3、N2 失败项。
  • 风险与回滚:低。只改回跳链接的拼装,两个登录页都没动;没有列表状态时回跳链接逐字节不变;邀请链接不受影响。代价:同一用户会话过期后重新登录,回到同一列表,筛选面板、排序、搜索从本人存储恢复,但快速筛选标签和工具栏分组回到视图默认;未登录者打开带列表状态的分享链接,登录后落在该列表,用自己的状态而不是链接里的。回滚即回退本 PR。
  • 先看:ui/apps/console/src/components/ProtectedRoute.tsx(LoginRedirect);ui/packages/app-shell/src/views/userFilterUrlState.ts(withoutListStateParams);新测试 ui/apps/console/src/components/ProtectedRoute.signOutListState-29174.test.tsx。
  • 两分钟验证:pnpm --dir ui exec vitest run apps/console/src/components/ProtectedRoute.signOutListState-29174.test.tsx,预期 4 个用例全部通过;第一个用例断言 A 退出后登录页地址不含 uf_ 和 "pipeline",B 登录后落在 /apps/demo/demo_task/view/in_progress?recordId=r1。
  • 需要你做的:无,席位落地。

What changes

The sign-in page's return link leaves the list's state behind. When a session ends, the Console's signed-out guard (LoginRedirect in ui/apps/console/src/components/ProtectedRoute.tsx) sends the visitor to /login?redirect=…, and the Console login page follows that link after any successful sign-in. The guard built the link from the whole path and query, so a list's uf_* state rode into whoever signed in next. It now composes the link from the path plus every param that is not in the uf_ family. When the URL carried no list state, the link keeps the original query byte for byte, so existing deep links do not change.

One helper, in the module that owns the uf_ family. withoutListStateParams(searchParams) in ui/packages/app-shell/src/views/userFilterUrlState.ts returns a copy without any uf_* param (the four toolbar keys, quick-filter uf_<field> and uf__tab), keeping every other param in order. It reuses the module's own prefix, so no second copy of the naming exists. It is exported from @object-ui/app-shell, which is "private": true, so no published surface widens (Clause-②: no as claimed).

Where the list then opens. With no uf_* state in the URL, the list seeds from the signing-in user's own stored state (objectViewListUrlState.ts, seed leg 2: their Filter panel conditions and sort from their preferences, their search term from their per-user cache), or the view's default. B's storage is keyed by B's id, so nothing of A's is read.

No server change, no metadata key or option, and neither login page is edited (so nothing overlaps #29136 or #29105). Rows were always read under the signing-in user's permissions; this is a state carry-over fix, not an access fix.

Tests

  • ui/apps/console/src/components/ProtectedRoute.signOutListState-29174.test.tsx (new), 4 cases, through the real AuthProvider over a scripted auth client, the real ProtectedRoute (AuthGuard + LoginRedirect) and the real Console LoginPage:
    1. the card's path: A is on a list URL carrying uf__filter, uf__search, uf__sort, uf__group, uf_priority, uf__tab and recordId; A signs out; the login page's URL carries no uf_ param and none of A's values; B signs in on the form and lands on the list path with recordId=r1 kept;
    2. an invitation redirect (/login?redirect=/accept-invitation/inv_1) still lands on the invitation;
    3. a signed-out arrival on a deep link with no list state keeps it byte for byte (note=a%20b stays %20);
    4. a signed-out arrival on a link carrying list state loses it too (the guard cannot tell who signs in).
  • ui/packages/app-shell/src/views/ObjectView.listUrlState-11860.test.tsx: one new describe, 3 cases, at the data source of the real ObjectView and ListView: A's URL as A left it puts A's filter, search and sort into the first data request (control); the handed-over URL puts none of it there and the view's declared sort applies; the next user's own stored state applies there with nothing of A's merged in.
  • ui/packages/app-shell/src/views/userFilterUrlState.withoutListState-29174.test.ts (new), 6 cases: the whole uf_ family goes, every other param stays in order, an empty-valued uf_ param goes, the input is untouched, and params without list state come back equal.

Acceptance notes

  • Which site, measured on origin/main 692e0dc8. The card offered the sign-out side or the login side. The only composer of a list URL into /login is the Console's LoginRedirect; app-shell's AuthenticatedRoute sends a bare /login, and app-shell's DefaultLoginPage never follows ?redirect= (it navigates to /). The follower is the Console LoginPage (window.location.assign). The guard was chosen because it is the single producer and needs no record of who left. A login-side drop would have needed that record to tell users apart, would still show A's values (the search term "pipeline") in the login page's address bar and history, and would have three followers to patch (login, register, verify-email-prompt), which all forward ?redirect=.
  • Same-user session expiry. At the guard, an explicit sign-out and an expired or revoked session look the same (the auth context only says the user is gone), and telling them apart would need new state in @object-ui/auth. So both drop the list state, and the user's own return path (the list's path and other params) is kept. Measured in the real browser below: a user who typed a search, signed out and signed back in got their own search back from their per-user storage. Quick-filter chips and a toolbar grouping are not in per-user storage, so they fall back to the view's.
  • A signed-out visitor opening a shared list link now lands on that list after signing in, on their own state rather than the link's (test case 4). A visitor already signed in still opens the link's state exactly as before.
  • Kept as non-list-state params: recordId, tab, a related list's filter[FIELD] scoping, and any other param outside the uf_ family. A /login?redirect=… URL composed elsewhere (bookmarked or typed) is still followed as written; the login pages are unchanged.
  • content/docs/ui/views.mdx gains one bullet under "A user's list state never writes the view".

Verification

All readings below are at head a1fa3999 (this branch merged with origin/main 74a19dd8) unless a line names another head.

Tests: 19 files, 194 passed

pnpm --dir ui exec vitest run on the three test files above plus the 16 nearest suites (the Console's App route tests, RootLandingRedirect, SetupRoute, StudioRoute ×3, FormPage.predicateScope, AcceptInvitationRoute, i18nAfterSignIn-12034, internalFormShell, ObjectView.ufViewSwitch-11992, userFilterUrlState.listState-11860 and the app-shell product-neutral ratchet): 19 files, 194 passed, 0 failed. The same set read 194/194 at 97150043 (before either merge) and at 13da5477 (after the first).

Ablations: both go red, both restored to HEAD

Run with node scripts/ablation-replace.mjs, which restores the file and checks its blob against HEAD.

  1. Restore the verbatim redirect in LoginRedirect (const redirect = location.pathname + returnSearch; becomes location.pathname + location.search): the Console test file reads 2 failed, 2 passed. Red: "A signs out of a filtered, searched, sorted list; B signs in and lands on the path with none of it" and "a signed-out arrival on a link carrying list state loses the list state". Green, as they should be: the invitation redirect and the deep link with no list state. Restored blob 30df279f == HEAD.
  2. Make the helper keep every param (if (!key.startsWith(PREFIX)) kept.append(…) becomes an unconditional append): 7 failed, 34 passed across the three test files (the two Console cases above, three helper cases, and the two ObjectView cases that read the handed-over URL). Restored blob 44703363 == HEAD.
Real browser: the card's path on a stock showcase boot

Playwright (Chromium) against a fresh showcase boot built from this branch at 97150043, through the real Console sign-in form. A is the seeded admin. B is a second member, invited, signed up and accepted on the same server. Both used the same browser context, as on a shared computer.

  • A opened /apps/com.example.showcase/showcase_task/view/in_progress with uf__filter (estimate_hours > 10 and progress < 80), uf__search=pipeline and uf__sort (due_date desc). A's first data request carried search=pipeline, sort=-due_date and both conditions.
  • A signed out from the Account menu. The login page's URL was /_console/login?redirect=%2Fapps%2Fcom.example.showcase%2Fshowcase_task%2Fview%2Fin_progress, with no uf_ and no "pipeline".
  • B signed in on that page and landed on /_console/apps/com.example.showcase/showcase_task/view/in_progress with no uf_. B's first data request carried only the view's own filter (status = in_progress), with no search, no sort and none of A's conditions.
  • Control: B signing in on a /login?redirect= that holds A's state verbatim (what the guard composed before this change) lands with uf_ in the URL, and B's first data request carries A's search, sort and both conditions.
  • Same user: A typed a search in the toolbar, signed out and signed back in. A's own search came back from A's per-user storage (the URL re-mirrored uf__search=pipeline and the first request carried search=pipeline). In the same browser, B signing in after A got the view's default.
Type-check, lint, build
  • pnpm --filter @object-ui/app-shell run type-check and pnpm --filter @object-ui/console run type-check under ui/: exit 0.
  • eslint on the six touched source and test files: 0 errors; 8 warnings, all pre-existing no-explicit-any lines in ObjectView.listUrlState-11860.test.tsx outside this change.
  • pnpm exec turbo run build --filter=!@objectstack/docs: 117 of 117 tasks.
  • pnpm check:new-line-citations under ui/: 0 new citations.
Derived gates: 66 derived, 66 run, all exit 0

node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derives 66 commands for this change set, the same 66 at 13da5477 and at a1fa3999. All 66 ran at both heads with exit 0, each code recorded, including pnpm --dir ui exec vitest run scripts/ (169 files passed, 2 skipped; 4900 tests passed). dispatch-gates --ran reconciles: 66 derived, 66 run, 0 NOT-MEASURED, 0 UNRUN.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QsR2jTDksad4P3chz5nFKY


Generated by Claude Code

…behind

The signed-out guard composed the login page's ?redirect= from the full
path and query, so a list's uf_* state (filter, search, sort, grouping,
quick filters, tab) rode into whoever signed in next on that browser.
LoginRedirect now drops the uf_ family before composing the link, keeping
the path and every other param (byte for byte when there was no list
state). The helper lives in userFilterUrlState, the family's owner.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jTDksad4P3chz5nFKY
…heir own state

Pins the first data request at the return link the signed-out guard
composes: none of the previous user's filter, search or sort, the view's
default sort, and the signing-in user's own stored state where they have
one. Adds the changeset and a views docs bullet.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jTDksad4P3chz5nFKY
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 2, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#3 · zhuangjianguo · session_01QsR2jV4dWohojjbTJTQq5m

席位核对 · ACCEPT · 2026-11-02T11:46Z

Head-sha: a1fa39996016332f7607d9e133425110ba83c8dc

  • Shape: draft → main, Fixes #29174 in the body only. 8 files, +420 / −2 (422 lines ≤ 3000). No governed path: check-governed-merges --pr 29305 reports NOT governed (0 of 8 paths). Clause-②: no and Metadata-protocol: none are line-initial in the body and the changeset, as claimed (6573329008). The changeset is patch for @object-ui/app-shell and @object-ui/console.
  • Contract review: none owed. The one new entry export, withoutListStateParams from @object-ui/app-shell, is on a "private": true package (read at origin/main), so Clause-②: no holds; no spec, metadata key or i18n change.
  • File surface: the seat accepted the os-dev's named files before editing (the uf_ helper in its owner module userFilterUrlState.ts, one entry export line, ProtectedRoute.tsx), plus tests, the changeset, and one bullet in content/docs/ui/views.mdx beside the existing "a link carrying list state wins" rule. No LoginPage edit, so no overlap with fix(auth): sign-in, password reset and MFA set-up work at phone width #29136 or Console sign-in: a TOTP-enrolled user who signs in with a password gets twoFactorRedirect and the login page just stays, with no code field and no message #29105.
  • Read in the diff: LoginRedirect builds ?redirect= from the path plus the query without any uf_* key; with no list state the original location.search is kept byte for byte. Invitation (/accept-invitation/…) and deep-link params are untouched. The guard cannot tell sign-out from expiry, so both drop the state; the same user signing back in gets their own stored filter, sort and search back (stated in the changeset and the body).
  • Tests (dev): new ProtectedRoute.signOutListState-29174 and userFilterUrlState.withoutListState-29174, plus three cases in ObjectView.listUrlState-11860 through the real list host: a control proving A's URL carries A's state into the first data request, the handed-over URL carrying none of it, and the next user's own stored state applying. 19 files / 194 passed at three heads; ablations (verbatim redirect; helper) red as expected, restored. 66 derived gates exit 0.
  • Measured (dev): on a showcase in a real browser, B lands with no uf_ and B's first request carries only status=in_progress; the control carries A's search, sort and filter.
  • Gates (check-runs on this head): 51 success, 8 skipped, 0 failed or pending. mergeable_state is clean.
  • Landing: ordinary queue landing, pr_ready then automerge_enable. Fixes #29174 closes the card on merge.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 2, 2026 11:47
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit 62e2d07 Nov 2, 2026
60 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-jfxofh branch November 2, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

1 participant