Skip to content

Commit

Permalink
[gh-NangoHQ#610] fix merge logic
Browse files Browse the repository at this point in the history
  • Loading branch information
khaliqgant committed May 3, 2023
1 parent f6b5c9b commit 688b52b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/server/lib/controllers/activity.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ class ActivityController {
}

if (log?.merge && sessions[log.sessionId as string]) {
const mergeIndex: number = sessions[log.sessionId as string] as number;
const mergeIndex: number = updatedLogs.findIndex((updated) => {
return updated.sessionId === log.sessionId && !updated.merge;
});
updatedLogs[mergeIndex]!.messages = [...updatedLogs[mergeIndex]!.messages, ...log.messages];
updatedLogs[mergeIndex]!.end = log.end as number;
} else {
Expand Down
1 change: 1 addition & 0 deletions packages/server/lib/controllers/oauth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ class OAuthController {
});

log.end = Date.now();
fileLogger.info('', log);

res.redirect(authorizationUri);
} else {
Expand Down

0 comments on commit 688b52b

Please sign in to comment.