@social-mail/social-mail-web-server 1.4.727 → 1.4.729

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.4.727",
3
+ "version": "1.4.729",
4
4
  "description": "## Phase 1",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -391,7 +391,7 @@ export default class SnapshotService {
391
391
  const url = new URL(link, "https://a");
392
392
  const tokens = url.pathname.substring(1).split("/");
393
393
  const fileID = tokens[5];
394
- const fileContent = await this.downloadFileContent(fileID);
394
+ const fileContent = await this.downloadFileContent(fileID, link);
395
395
  e.parentElement.replaceChildren(...fileContent);
396
396
  updated = true;
397
397
  }
@@ -451,9 +451,13 @@ export default class SnapshotService {
451
451
  }
452
452
 
453
453
  @cacheFor()
454
- async downloadFileContent(fileID) {
454
+ async downloadFileContent(fileID, link) {
455
455
  const file = await this.db.appFiles.where({ fileID }, (p) => (x) => x.appFileID === p.fileID)
456
+ .include((x) => x.fileContent)
456
457
  .first();
458
+ if (!file?.fileContent) {
459
+ console.error(`File ${fileID} not found for ${link}`);
460
+ }
457
461
  const localFile = await this.tempFileService.downloadAppFile(file);
458
462
  const text = await localFile.readAsText();
459
463
  await localFile.delete();