-
Notifications
You must be signed in to change notification settings - Fork 404
refactor(web): merge read state at render and give loaded pages one owner #1714
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
2521a9a
6dfd1b6
bd318c9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,15 +7,14 @@ import { applyTitleUpdate, isSessionListKey, type SessionListResponse } from "@/ | |
| import { | ||
| applySessionInboxTitleUpdate, | ||
| isSessionInboxKey, | ||
| type SessionInboxPage, | ||
| type SessionInboxSnapshot, | ||
| } from "@/lib/session-inbox-api"; | ||
|
|
||
| type SessionCacheMutator = ReturnType<typeof useSWRConfig>["mutate"]; | ||
|
|
||
| /** | ||
| * A session's title is cached in two payload families: session-list responses | ||
| * and inbox snapshots/pages. Every optimistic update, settlement, and rollback | ||
| * and inbox snapshots. Every optimistic update, settlement, and rollback | ||
| * must touch both, or the sidebar inbox briefly reverts to the stale title | ||
| * once the optimistic overlay clears. | ||
| */ | ||
|
|
@@ -30,7 +29,7 @@ function applyTitleToSessionCaches( | |
| (current) => applyTitleUpdate(current, sessionId, title), | ||
| { populateCache: true, revalidate: false } | ||
| ), | ||
| mutate<SessionInboxSnapshot | SessionInboxPage>( | ||
| mutate<SessionInboxSnapshot>( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [deep review] This breaks rename settlement for any session that exists only in a loaded tail page. Those pages now live exclusively in
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in 6dfd1b6 via the rename hook's existing
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Confirmed and scoped in #1722. Passing |
||
| isSessionInboxKey, | ||
| (current) => applySessionInboxTitleUpdate(current, sessionId, title), | ||
| { populateCache: true, revalidate: false } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.