fix: don't update session timestamp for metadata-only changes (resolves #9494) (#9495)

This commit is contained in:
Ariane Emory
2026-01-20 21:38:54 -05:00
committed by GitHub
parent 3723e1b8d2
commit cbe20d22d3
3 changed files with 8 additions and 6 deletions

View File

@@ -281,7 +281,7 @@ export const SessionRoutes = lazy(() =>
session.title = updates.title session.title = updates.title
} }
if (updates.time?.archived !== undefined) session.time.archived = updates.time.archived if (updates.time?.archived !== undefined) session.time.archived = updates.time.archived
}) }, { touch: false })
return c.json(updatedSession) return c.json(updatedSession)
}, },

View File

@@ -259,7 +259,7 @@ export namespace Session {
draft.share = { draft.share = {
url: share.url, url: share.url,
} }
}) }, { touch: false })
return share return share
}) })
@@ -269,14 +269,16 @@ export namespace Session {
await ShareNext.remove(id) await ShareNext.remove(id)
await update(id, (draft) => { await update(id, (draft) => {
draft.share = undefined draft.share = undefined
}) }, { touch: false })
}) })
export async function update(id: string, editor: (session: Info) => void) { export async function update(id: string, editor: (session: Info) => void, options?: { touch?: boolean }) {
const project = Instance.project const project = Instance.project
const result = await Storage.update<Info>(["session", project.id, id], (draft) => { const result = await Storage.update<Info>(["session", project.id, id], (draft) => {
editor(draft) editor(draft)
draft.time.updated = Date.now() if (options?.touch !== false) {
draft.time.updated = Date.now()
}
}) })
Bus.publish(Event.Updated, { Bus.publish(Event.Updated, {
info: result, info: result,

View File

@@ -1816,6 +1816,6 @@ NOTE: At any point in time through this workflow you should feel free to ask the
const title = cleaned.length > 100 ? cleaned.substring(0, 97) + "..." : cleaned const title = cleaned.length > 100 ? cleaned.substring(0, 97) + "..." : cleaned
draft.title = title draft.title = title
}) }, { touch: false })
} }
} }