Hosted rooms' instance IDs name their owner: <owner>-<2100000000+n>
CI / test (push) Successful in 58s
CI / test (push) Successful in 58s
The client takes a room's owner from the instance ID's first part; with 2100000000 there, the owner couldn't decorate their hosted room (putting furniture on went to their home room instead). Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
f65f36c1ea
commit
43183ec7ee
7 files changed
+17
-13
No files matched your search
@@ -119,7 +119,7 @@ test("only the room's owner decorates it; contents are checked", async () => {
|
||||
const put = (contents: unknown, instance = room) => call(owner, "PUT", `/api/v1/decorations/${instance}`, { contents });
|
||||
for (const bad of ["502", "0502-3", "502-0", "502-3-4", "x-1", "1234567890123-1"])
|
||||
expect((await put([item], bad)).status).toBe(400);
|
||||
expect((await put([item], "2100000000-5")).json.error).toBe("hosted_room");
|
||||
expect((await put([item], "12345-2100000005")).json.error).toBe("hosted_room");
|
||||
expect((await put([[7, "AAAAAAAAAA", ""]])).status).toBe(400);
|
||||
expect((await put([[7, 12345, ""]])).status).toBe(400);
|
||||
expect((await put([[-1, "aaaaaaaaaa", ""]])).status).toBe(400);
|
||||
@@ -157,7 +157,7 @@ test("viewers see the products they may, with a hash of what they see", async ()
|
||||
// Unknown rooms have nothing.
|
||||
expect((await call(undefined, "GET", "/api/v1/decorations/601-9")).json).toEqual({ instance: "601-9", contents: [], hash: hash([]) });
|
||||
expect((await call(undefined, "GET", "/api/v1/decorations/601-x")).status).toBe(400);
|
||||
expect((await call(undefined, "GET", "/api/v1/decorations/2100000000-1")).status).toBe(400);
|
||||
expect((await call(undefined, "GET", "/api/v1/decorations/12345-2100000001")).status).toBe(400);
|
||||
|
||||
const put = await call(owner, "PUT", `/api/v1/decorations/${room}`, { contents: [g, a, r] });
|
||||
expect(put.status).toBe(200);
|
||||
|
||||
@@ -133,7 +133,7 @@ test("rooms are made, listed, changed and closed by their owners", async () => {
|
||||
expect(made.status).toBe(201);
|
||||
const n = made.json.room.n;
|
||||
expect(made.json.room).toMatchObject({
|
||||
instanceId: `2100000000-${n}`,
|
||||
instanceId: `302-${2_100_000_000 + n}`,
|
||||
chatId: 2_100_000_000 + n,
|
||||
name: "The Lounge",
|
||||
description: "A quiet place.",
|
||||
|
||||
Reference in new issue
Block a user