From 15d4c7d7db23c9b38f546d3cc55beed4f8026589 Mon Sep 17 00:00:00 2001 From: Daniel Silva Date: Tue, 12 Mar 2024 17:12:02 +0100 Subject: [PATCH 1/3] adding param on reconnectapp params --- src/libs/API/parameters/ReconnectAppParams.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libs/API/parameters/ReconnectAppParams.ts b/src/libs/API/parameters/ReconnectAppParams.ts index 8c5b7d6c0da9..d8c1da4f0887 100644 --- a/src/libs/API/parameters/ReconnectAppParams.ts +++ b/src/libs/API/parameters/ReconnectAppParams.ts @@ -2,6 +2,7 @@ type ReconnectAppParams = { mostRecentReportActionLastModified?: string; updateIDFrom?: number; policyIDList: string[]; + idempotencyKey?: string; }; export default ReconnectAppParams; From df6bd265b0a6bd6089ed01d470718b225bd8f371 Mon Sep 17 00:00:00 2001 From: Daniel Silva Date: Tue, 12 Mar 2024 17:13:06 +0100 Subject: [PATCH 2/3] changing method to use the idempotencyKey --- src/libs/actions/App.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libs/actions/App.ts b/src/libs/actions/App.ts index 6442f2ec0eef..6665e4f6b68f 100644 --- a/src/libs/actions/App.ts +++ b/src/libs/actions/App.ts @@ -222,7 +222,10 @@ function openApp() { function reconnectApp(updateIDFrom: OnyxEntry = 0) { console.debug(`[OnyxUpdates] App reconnecting with updateIDFrom: ${updateIDFrom}`); getPolicyParamsForOpenOrReconnect().then((policyParams) => { - const params: ReconnectAppParams = {...policyParams}; + const params: ReconnectAppParams = { + ...policyParams, + idempotencyKey:`${WRITE_COMMANDS.RECONNECT_APP}`, + }; // When the app reconnects we do a fast "sync" of the LHN and only return chats that have new messages. We achieve this by sending the most recent reportActionID. // we have locally. And then only update the user about chats with messages that have occurred after that reportActionID. From 96108cf9e1b63a65ac55951d2f9823fc358277f0 Mon Sep 17 00:00:00 2001 From: Daniel Silva Date: Tue, 12 Mar 2024 17:15:20 +0100 Subject: [PATCH 3/3] prettier --- src/libs/actions/App.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/App.ts b/src/libs/actions/App.ts index 6665e4f6b68f..302e4048d0e8 100644 --- a/src/libs/actions/App.ts +++ b/src/libs/actions/App.ts @@ -224,7 +224,7 @@ function reconnectApp(updateIDFrom: OnyxEntry = 0) { getPolicyParamsForOpenOrReconnect().then((policyParams) => { const params: ReconnectAppParams = { ...policyParams, - idempotencyKey:`${WRITE_COMMANDS.RECONNECT_APP}`, + idempotencyKey: `${WRITE_COMMANDS.RECONNECT_APP}`, }; // When the app reconnects we do a fast "sync" of the LHN and only return chats that have new messages. We achieve this by sending the most recent reportActionID.