fix(web): keep rectification sessions listed and persist chats on first send
Empty-consultation filtering is now session_type scoped so birth-time rows stay in the sidebar. Subtitles use updatedAt with sort/group/cursor. New chats stay local until the first send.
This commit is contained in:
@@ -7,6 +7,7 @@ import { sessionCursorFilter } from "../src/lib/session-cursor.ts";
|
||||
|
||||
const core = readFileSync(new URL("../src/lib/db/local-postgres-client-core.ts", import.meta.url), "utf8");
|
||||
const listRoute = readFileSync(new URL("../src/app/api/sessions/route.ts", import.meta.url), "utf8");
|
||||
const listFilter = readFileSync(new URL("../src/lib/session-list-filter.ts", import.meta.url), "utf8");
|
||||
|
||||
test("or() compiles a comma-separated PostgREST filter", () => {
|
||||
const parameters: unknown[] = [];
|
||||
@@ -48,3 +49,10 @@ test("or() compiles the session cursor filter with a nested and", () => {
|
||||
]);
|
||||
assert.match(listRoute, /pageQuery = pageQuery\.or\(sessionCursorFilter\(cursor\)\)/);
|
||||
});
|
||||
|
||||
test("session list empty-consultation filter is session_type scoped", () => {
|
||||
assert.match(listFilter, /session_type\.neq\.consultation,messages\.neq\.\[\]/);
|
||||
assert.match(listRoute, /excludeEmptyConsultations/);
|
||||
assert.doesNotMatch(listRoute, /\.not\("messages", "eq", \[\]\)/);
|
||||
assert.doesNotMatch(listFilter, /\.not\("messages", "eq", \[\]\)/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user