Skip to content

Commit a21dd46

Browse files
authored
pst mining: fix empty source (#2565)
* fix empty source * Update PSTEmailsFetcher.ts * Update callback.vue
1 parent 53f5c46 commit a21dd46

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

frontend/src/pages/callback.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ onMounted(async () => {
5454
['oauth-permissions', 'access_denied'].includes(error ?? '') &&
5555
provider
5656
) {
57-
useMiningConsentSidebar().show(provider as MiningSourceType, undefined, navigateToPage ?? undefined);
57+
useMiningConsentSidebar().show(
58+
provider as MiningSourceType,
59+
undefined,
60+
navigateToPage ?? undefined,
61+
);
5862
} else {
5963
showOAuthErrorNotification();
6064
}

micro-services/emails-fetcher/src/services/pst/PSTEmailsFetcher.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export default class PSTEmailsFetcher {
101101

102102
private readonly fetchedIds: Set<string>;
103103

104-
private readonly userEmail: string = '';
104+
private readonly userEmail: string;
105105

106106
public totalMessages = 0;
107107

@@ -120,10 +120,12 @@ export default class PSTEmailsFetcher {
120120
private readonly contactStream: string,
121121
private readonly signatureStream: string,
122122
private readonly fetchEmailBody: boolean,
123-
private readonly source: string
123+
private readonly source: string // userid/filename.ext
124124
) {
125-
// Generate a unique identifier for the user.
125+
// Source workaround: Set the userEmail to the filename messages and extractors receive the original filename as the identifier.
126+
this.userEmail = this.source.split('/')[1];
126127
this.userIdentifier = hashEmail(this.userEmail, userId);
128+
127129
// Set the key for the process set. used for caching.
128130
this.processSetKey = `caching:${miningId}`;
129131

@@ -168,8 +170,6 @@ export default class PSTEmailsFetcher {
168170
});
169171

170172
return header ?? null;
171-
172-
return header ?? null;
173173
} catch (error) {
174174
logger.error('Error when publishing email header', { error });
175175
throw error;

0 commit comments

Comments
 (0)