@social-mail/social-mail-web-server 1.8.440 → 1.8.442

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@social-mail/social-mail-web-server",
3
- "version": "1.8.440",
3
+ "version": "1.8.442",
4
4
  "description": "## Phase 1",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -35,6 +35,12 @@ export default class IndexEmailService {
35
35
  const attachments = await db.appFiles.where({ emailID}, (p) => (x) => x.emailID === p.emailID)
36
36
  .toArray();
37
37
  for(const att of attachments) {
38
+ const txt = await db.textDocuments
39
+ .statements.select({}, { textDocumentID: att.fileContentID});
40
+ if (txt) {
41
+ await this.insertText(emailID, txt.searchable, "attachment");
42
+ continue;
43
+ }
38
44
  const tf = await this.tempFileService.downloadAppFile(att);
39
45
  const textFile = await this.te.extract(tf);
40
46
  for await(const line of textFile.lines()) {
@@ -57,7 +57,7 @@ export default class DailyWorkflow extends Workflow<any,any> {
57
57
 
58
58
  await PendingPostReceiveWorkflow.queue(this.context);
59
59
  await PendingReferencesWorkflow.queue(this.context);
60
- await IndexEmailContentWorkflow.queue(this.context);
60
+ await IndexEmailContentWorkflow.queue(this.context, this.currentTime);
61
61
  await IndexEmailAddressWorkflow.queue(this.context);
62
62
 
63
63
  const all = await db.mailboxSyncTargets
@@ -10,10 +10,9 @@ export default class IndexEmailContentWorkflow extends Workflow {
10
10
 
11
11
  static taskGroup = "batch";
12
12
 
13
- static queue(context: WorkflowContext) {
14
- const now = DateTime.now;
13
+ static queue(context: WorkflowContext, time: DateTime) {
15
14
  return context.queue(IndexEmailContentWorkflow, "", {
16
- id: `index-email-${now.msSinceEpoch.toString(36)}`
15
+ id: `index-email-${time.msSinceEpoch.toString(36)}`
17
16
  });
18
17
  }
19
18