chore: checkpoint Boss app v2.5.11
This commit is contained in:
@@ -6,13 +6,23 @@ async function readSource(path: string) {
|
||||
return readFile(new URL(path, import.meta.url), "utf8");
|
||||
}
|
||||
|
||||
test("events route enriches message events with a lightweight project chat payload", async () => {
|
||||
test("events route supports message patch v1 while retaining snapshot fallback", async () => {
|
||||
const source = await readSource("../src/app/api/v1/events/route.ts");
|
||||
|
||||
assert.match(
|
||||
source,
|
||||
/projectMessagesPayload:\s*buildProjectMessagesRealtimePayload\(state,\s*String\(payload\.projectId \?\? ""\)\)/,
|
||||
"expected realtime event route to include a lightweight project chat payload for message events",
|
||||
/x-boss-realtime-capabilities/,
|
||||
"expected realtime event route to inspect native app capability headers",
|
||||
);
|
||||
assert.match(
|
||||
source,
|
||||
/projectMessagesPatch/,
|
||||
"expected realtime event route to emit a message patch for capable clients",
|
||||
);
|
||||
assert.match(
|
||||
source,
|
||||
/projectMessagesPayload:\s*buildProjectMessagesRealtimePayload/,
|
||||
"expected realtime event route to retain full snapshot fallback for older clients",
|
||||
);
|
||||
});
|
||||
|
||||
@@ -29,6 +39,16 @@ test("ProjectDetailActivity applies lightweight realtime chat payloads before sc
|
||||
/JSONObject projectMessagesPayload = event\.payload\.optJSONObject\("projectMessagesPayload"\);/,
|
||||
"expected chat page to read the lightweight message payload from realtime events",
|
||||
);
|
||||
assert.match(
|
||||
source,
|
||||
/JSONObject projectMessagesPatch = event\.payload\.optJSONObject\("projectMessagesPatch"\);/,
|
||||
"expected chat page to read message-patch-v1 realtime payloads first",
|
||||
);
|
||||
assert.match(
|
||||
source,
|
||||
/scheduleRealtimeReload\(false\);/,
|
||||
"expected chat page to fall back to a debounced message reload when a patch has a gap",
|
||||
);
|
||||
assert.match(
|
||||
source,
|
||||
/renderLoadedProjectSnapshot\(new ProjectSnapshot\(projectMessagesPayload,\s*null,\s*null\)\);/,
|
||||
|
||||
Reference in New Issue
Block a user