From a53777e735bb89f1c1b3ac7ff654da1be3363797 Mon Sep 17 00:00:00 2001 From: Courtney Myers Date: Fri, 10 Jan 2025 09:02:34 -0500 Subject: [PATCH] Provide the latest Salesforce REST API version (v62.0) when setting up the Salesforce connection --- app/server/app/utilities/bap.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/server/app/utilities/bap.js b/app/server/app/utilities/bap.js index b4721cc0..6af72079 100644 --- a/app/server/app/utilities/bap.js +++ b/app/server/app/utilities/bap.js @@ -466,6 +466,7 @@ const { */ function setupConnection(req) { const bapConnection = new jsforce.Connection({ + version: "62.0", oauth2: { clientId: BAP_CLIENT_ID, clientSecret: BAP_CLIENT_SECRET, @@ -1913,8 +1914,15 @@ function verifyBapConnection(req, { name, args }) { const logMessage = `BAP Error: ${err}.`; log({ level: "error", message: logMessage, req, otherInfo: err }); + // TODO: Handle the following error: // Error: Unable to refresh session due to: No refresh token found in the connection. + if (err?.includes("No refresh token found in the connection.")) { + log({ level: "info", message: "Re-establishing BAP connection.", req }); + + // Re-establish the BAP connection. + } + throw err; }); }