Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
Septias committed Dec 11, 2024
1 parent 6f3b6e9 commit ce38c65
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
5 changes: 2 additions & 3 deletions backend/message.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ test("distribute to self", () => {
return true;
}, 0);

client0.sendUpdate({ payload: "Hello" }, "") ;
client0.sendUpdate({ payload: "Hello" }, "");

expect(client0Heard).toMatchObject([
{ payload: "Hello", serial: 1, max_serial: 1 },
Expand Down Expand Up @@ -80,7 +80,7 @@ test("distribute to self and other", () => {
]);
expect(client1Heard).toMatchObject([
{ payload: "Hello", serial: 1, max_serial: 1 },
{ payload: "Bye", serial: 2, max_serial: 2 }
{ payload: "Bye", serial: 2, max_serial: 2 },
]);

expect(prepare(getMessages())).toEqual([
Expand Down Expand Up @@ -652,7 +652,6 @@ test("distribute to self and other, but other was disconnected", () => {
type: "sent",
instanceId: "3001",
update: { payload: "Hello", serial: 1, max_serial: 1 },

},
{
type: "received",
Expand Down
13 changes: 3 additions & 10 deletions backend/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import type {
import type { Message } from "../types/message";
import { getColorForId } from "./color";

type UpdateListenerMulti = (
updates: ReceivedStatusUpdate<any>[],
) => boolean;
type UpdateListenerMulti = (updates: ReceivedStatusUpdate<any>[]) => boolean;

type ClearListener = () => boolean;
type DeleteListener = () => boolean;
Expand Down Expand Up @@ -150,10 +148,7 @@ class Processor implements IProcessor {
this.clients.splice(client_index, 1);
}

distribute(
instanceId: string,
update: SendingStatusUpdate<any>,
) {
distribute(instanceId: string, update: SendingStatusUpdate<any>) {
this.currentSerial++;
const receivedUpdate: ReceivedStatusUpdate<any> = {
...update,
Expand Down Expand Up @@ -187,9 +182,7 @@ class Processor implements IProcessor {
updateListener(
this.updates
.slice(serial)
.map((update) =>
({ ...update, max_serial: maxSerial })
),
.map((update) => ({ ...update, max_serial: maxSerial })),
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion sim/webxdc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class FakeTransport implements Transport {

send(data: any) {
if (data.type === "sendUpdate") {
const { update} = data;
const { update } = data;
this.client.sendUpdate(update, "");
} else if (data.type === "setUpdateListener") {
this.client.connect(
Expand Down

0 comments on commit ce38c65

Please sign in to comment.