From 2c547f766a2fd768889798880318a186402b66a5 Mon Sep 17 00:00:00 2001 From: Harvmaster Date: Mon, 9 Feb 2026 12:34:22 +0000 Subject: [PATCH] publish to sync server --- src/services/invitation.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/services/invitation.ts b/src/services/invitation.ts index f7a58af..5a5100e 100644 --- a/src/services/invitation.ts +++ b/src/services/invitation.ts @@ -32,12 +32,14 @@ export class Invitation extends EventEmitter { // Try to get the invitation from the storage const invitationFromStorage = await dependencies.storage.get(invitation); if (invitationFromStorage) { + console.log(`Invitation found in storage: ${invitation}`); return this.create(invitationFromStorage, dependencies); } // Try to get the invitation from the sync server const invitationFromSyncServer = await dependencies.syncServer.getInvitation(invitation); - if (invitationFromSyncServer) { + if (invitationFromSyncServer && invitationFromSyncServer.invitationIdentifier === invitation) { + console.log(`Invitation found in sync server: ${invitation}`); return this.create(invitationFromSyncServer, dependencies); } @@ -141,6 +143,9 @@ export class Invitation extends EventEmitter { // Store the invitation in the storage await this.storage.set(this.data.invitationIdentifier, this.data); + // Publish the invitation to the sync server + this.syncServer.publishInvitation(this.data); + // Compute and emit initial status await this.updateStatus(); }