Revert "Release/2026 02 27 (pull request #3070)"

This commit is contained in:
Patrick Fic
2026-03-04 16:18:44 +00:00
parent 522f2b9e26
commit c9e41ba72a
204 changed files with 5497 additions and 7715 deletions

View File

@@ -4,14 +4,11 @@ const { FortellisJobExport, FortellisSelectedCustomer } = require("../fortellis/
const CdkCalculateAllocations = require("../cdk/cdk-calculate-allocations").default;
const registerRREvents = require("../rr/rr-register-socket-events");
const SOCKET_SESSION_TTL_SECONDS = 60 * 60 * 24;
const redisSocketEvents = ({ io, redisHelpers, ioHelpers, logger }) => {
// Destructure helpers locally, but keep full objects available for downstream modules
const {
setSessionData,
getSessionData,
clearSessionData,
addUserSocketMapping,
removeUserSocketMapping,
refreshUserSocketTTL,
@@ -54,16 +51,12 @@ const redisSocketEvents = ({ io, redisHelpers, ioHelpers, logger }) => {
}
// NEW: seed a base session for this socket so downstream handlers can read it
await setSessionData(
socket.id,
{
bodyshopId,
email: user.email,
uid: user.user_id || user.uid,
seededAt: Date.now()
},
SOCKET_SESSION_TTL_SECONDS
);
await setSessionData(socket.id, {
bodyshopId,
email: user.email,
uid: user.user_id || user.uid,
seededAt: Date.now()
});
await addUserSocketMapping(user.email, socket.id, bodyshopId);
next();
@@ -133,18 +126,14 @@ const redisSocketEvents = ({ io, redisHelpers, ioHelpers, logger }) => {
}
// NEW: refresh (or create) the base session with the latest info
await setSessionData(
socket.id,
{
bodyshopId,
email: user.email,
uid: user.user_id || user.uid,
refreshedAt: Date.now()
},
SOCKET_SESSION_TTL_SECONDS
);
await setSessionData(socket.id, {
bodyshopId,
email: user.email,
uid: user.user_id || user.uid,
refreshedAt: Date.now()
});
await refreshUserSocketTTL(user.email);
await refreshUserSocketTTL(user.email, bodyshopId);
socket.emit("token-updated", { success: true });
} catch (error) {
if (error.code === "auth/id-token-expired") {
@@ -200,11 +189,6 @@ const redisSocketEvents = ({ io, redisHelpers, ioHelpers, logger }) => {
if (socket.user?.email) {
await removeUserSocketMapping(socket.user.email, socket.id);
}
try {
await clearSessionData(socket.id);
} catch {
//
}
// Optional: clear transactional session
try {
await clearSessionTransactionData(socket.id);