Save storage for defunct and pending call links
This commit is contained in:
parent
a7be33b201
commit
c6902ec26a
10 changed files with 474 additions and 31 deletions
|
@ -83,13 +83,41 @@ export type CallLinkConversationType = ReadonlyDeep<
|
|||
}
|
||||
>;
|
||||
|
||||
// Call link discovered from sync, waiting to refresh state from the calling server
|
||||
export type PendingCallLinkType = Readonly<{
|
||||
rootKey: string;
|
||||
adminKey: string | null;
|
||||
}> &
|
||||
StorageServiceFieldsType;
|
||||
|
||||
// Call links discovered missing after server refresh
|
||||
export type DefunctCallLinkType = Readonly<{
|
||||
roomId: string;
|
||||
rootKey: string;
|
||||
adminKey: string | null;
|
||||
}> &
|
||||
StorageServiceFieldsType;
|
||||
|
||||
export type DefunctCallLinkRecord = Readonly<{
|
||||
roomId: string;
|
||||
rootKey: Uint8Array;
|
||||
adminKey: Uint8Array | null;
|
||||
storageID: string | null;
|
||||
storageVersion: number | null;
|
||||
storageUnknownFields: Uint8Array | null;
|
||||
storageNeedsSync: 1 | 0;
|
||||
}>;
|
||||
|
||||
export const defunctCallLinkRecordSchema = z.object({
|
||||
roomId: z.string(),
|
||||
rootKey: z.instanceof(Uint8Array),
|
||||
adminKey: z.instanceof(Uint8Array).nullable(),
|
||||
storageID: z.string().nullable(),
|
||||
storageVersion: z.number().int().nullable(),
|
||||
storageUnknownFields: z.instanceof(Uint8Array).nullable(),
|
||||
storageNeedsSync: z.union([z.literal(1), z.literal(0)]),
|
||||
}) satisfies z.ZodType<DefunctCallLinkRecord>;
|
||||
|
||||
// DB Record
|
||||
export type CallLinkRecord = Readonly<{
|
||||
roomId: string;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue