Repository navigation
fix(console): signing out no longer hands your list's filter, search and sort to the next person who signs in - #29305
Merged
Conversation
…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
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTDksad4P3chz5nFKY
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTDksad4P3chz5nFKY
Contributor
Author
|
domain:ui#3 · zhuangjianguo · session_01QsR2jV4dWohojjbTJTQq5m 席位核对 · ACCEPT · 2026-11-02T11:46ZHead-sha:
|
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.
Requested by Steedos · project thread
Fixes #29174
Clause-②: no
Metadata-protocol: none
维护者速读
?redirect=只保留列表的路径和其它参数(如recordId),去掉列表的uf_*状态(筛选、搜索、排序、分组、快速筛选、标签页)。下一个在同一浏览器登录的人回到同一个列表,看到的是自己保存的状态或视图默认值,首个数据请求不再带上一个人的条件。records-forms.adhoc-filter-sort-builder的 A3、N2 失败项。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 (
LoginRedirectinui/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'suf_*state rode into whoever signed in next. It now composes the link from the path plus every param that is not in theuf_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)inui/packages/app-shell/src/views/userFilterUrlState.tsreturns a copy without anyuf_*param (the four toolbar keys, quick-filteruf_<field>anduf__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-②: noas 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 realAuthProviderover a scripted auth client, the realProtectedRoute(AuthGuard+LoginRedirect) and the real ConsoleLoginPage:uf__filter,uf__search,uf__sort,uf__group,uf_priority,uf__tabandrecordId; A signs out; the login page's URL carries nouf_param and none of A's values; B signs in on the form and lands on the list path withrecordId=r1kept;/login?redirect=/accept-invitation/inv_1) still lands on the invitation;note=a%20bstays%20);ui/packages/app-shell/src/views/ObjectView.listUrlState-11860.test.tsx: one new describe, 3 cases, at the data source of the realObjectViewandListView: 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 wholeuf_family goes, every other param stays in order, an empty-valueduf_param goes, the input is untouched, and params without list state come back equal.Acceptance notes
origin/main692e0dc8. The card offered the sign-out side or the login side. The only composer of a list URL into/loginis the Console'sLoginRedirect; app-shell'sAuthenticatedRoutesends a bare/login, and app-shell'sDefaultLoginPagenever follows?redirect=(it navigates to/). The follower is the ConsoleLoginPage(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=.@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.recordId,tab, a related list'sfilter[FIELD]scoping, and any other param outside theuf_family. A/login?redirect=…URL composed elsewhere (bookmarked or typed) is still followed as written; the login pages are unchanged.content/docs/ui/views.mdxgains one bullet under "A user's list state never writes the view".Verification
All readings below are at head
a1fa3999(this branch merged withorigin/main74a19dd8) unless a line names another head.Tests: 19 files, 194 passed
pnpm --dir ui exec vitest runon the three test files above plus the 16 nearest suites (the Console'sApproute tests,RootLandingRedirect,SetupRoute,StudioRoute×3,FormPage.predicateScope,AcceptInvitationRoute,i18nAfterSignIn-12034,internalFormShell,ObjectView.ufViewSwitch-11992,userFilterUrlState.listState-11860and the app-shell product-neutral ratchet): 19 files, 194 passed, 0 failed. The same set read 194/194 at97150043(before either merge) and at13da5477(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.LoginRedirect(const redirect = location.pathname + returnSearch;becomeslocation.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 blob30df279f== HEAD.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 blob44703363== HEAD.Real browser: the card's path on a stock showcase boot
Playwright (Chromium) against a fresh
showcaseboot built from this branch at97150043, 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./apps/com.example.showcase/showcase_task/view/in_progresswithuf__filter(estimate_hours > 10 and progress < 80),uf__search=pipelineanduf__sort(due_date desc). A's first data request carriedsearch=pipeline,sort=-due_dateand both conditions./_console/login?redirect=%2Fapps%2Fcom.example.showcase%2Fshowcase_task%2Fview%2Fin_progress, with nouf_and no "pipeline"./_console/apps/com.example.showcase/showcase_task/view/in_progresswith nouf_. 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./login?redirect=that holds A's state verbatim (what the guard composed before this change) lands withuf_in the URL, and B's first data request carries A's search, sort and both conditions.uf__search=pipelineand the first request carriedsearch=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-checkandpnpm --filter @object-ui/console run type-checkunderui/: exit 0.no-explicit-anylines inObjectView.listUrlState-11860.test.tsxoutside this change.pnpm exec turbo run build --filter=!@objectstack/docs: 117 of 117 tasks.pnpm check:new-line-citationsunderui/: 0 new citations.Derived gates: 66 derived, 66 run, all exit 0
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderives 66 commands for this change set, the same 66 at13da5477and ata1fa3999. All 66 ran at both heads with exit 0, each code recorded, includingpnpm --dir ui exec vitest run scripts/(169 files passed, 2 skipped; 4900 tests passed).dispatch-gates --ranreconciles: 66 derived, 66 run, 0 NOT-MEASURED, 0 UNRUN.🤖 Generated with Claude Code
https://claude.ai/code/session_01QsR2jTDksad4P3chz5nFKY
Generated by Claude Code