Introduce in-memory transactions for sessions
This commit is contained in:
parent
403b3c5fc6
commit
94d2c56ab9
12 changed files with 874 additions and 391 deletions
|
@ -131,11 +131,11 @@ export type UnprocessedType = {
|
|||
timestamp: number;
|
||||
version: number;
|
||||
attempts: number;
|
||||
envelope: string;
|
||||
envelope?: string;
|
||||
|
||||
source?: string;
|
||||
sourceUuid?: string;
|
||||
sourceDevice?: string;
|
||||
sourceDevice?: number;
|
||||
serverTimestamp?: number;
|
||||
decrypted?: string;
|
||||
};
|
||||
|
@ -188,6 +188,10 @@ export type DataInterface = {
|
|||
|
||||
createOrUpdateSession: (data: SessionType) => Promise<void>;
|
||||
createOrUpdateSessions: (array: Array<SessionType>) => Promise<void>;
|
||||
commitSessionsAndUnprocessed(options: {
|
||||
sessions: Array<SessionType>;
|
||||
unprocessed: Array<UnprocessedType>;
|
||||
}): Promise<void>;
|
||||
getSessionById: (id: string) => Promise<SessionType | undefined>;
|
||||
getSessionsById: (conversationId: string) => Promise<Array<SessionType>>;
|
||||
bulkAddSessions: (array: Array<SessionType>) => Promise<void>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue