Skip to content

Commit

Permalink
Include installation ID bytes in inbox state
Browse files Browse the repository at this point in the history
  • Loading branch information
rygine committed Jan 8, 2025
1 parent 9a4bb87 commit 9dbec10
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sdks/browser-sdk/src/utils/conversions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,15 +339,17 @@ export const toSafeConversation = async (
});

export type SafeInstallation = {
id: string;
bytes: Uint8Array;
clientTimestampNs?: bigint;
id: string;
};

export const toSafeInstallation = (
installation: Installation,
): SafeInstallation => ({
id: installation.id,
bytes: installation.bytes,
clientTimestampNs: installation.clientTimestampNs,
id: installation.id,
});

export type SafeInboxState = {
Expand Down
3 changes: 3 additions & 0 deletions sdks/browser-sdk/test/Client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ describe.concurrent("Client", () => {
expect(inboxState2.inboxId).toBe(client.inboxId);
expect(inboxState.installations.length).toBe(1);
expect(inboxState.installations[0].id).toBe(client.installationId);
expect(inboxState.installations[0].bytes).toEqual(
client.installationIdBytes,
);
expect(inboxState2.accountAddresses).toEqual([
user.account.address.toLowerCase(),
]);
Expand Down

0 comments on commit 9dbec10

Please sign in to comment.