fix: attachments broken
Some checks failed
Build Android APK / build-android-apk (push) Failing after 3m5s
Queue Release Build / prepare (push) Successful in 32s
Deploy Web Apps / deploy (push) Successful in 9m30s
Queue Release Build / build-windows (push) Successful in 28m7s
Queue Release Build / build-linux (push) Successful in 47m6s
Queue Release Build / finalize (push) Successful in 58s
Some checks failed
Build Android APK / build-android-apk (push) Failing after 3m5s
Queue Release Build / prepare (push) Successful in 32s
Deploy Web Apps / deploy (push) Successful in 9m30s
Queue Release Build / build-windows (push) Successful in 28m7s
Queue Release Build / build-linux (push) Successful in 47m6s
Queue Release Build / finalize (push) Successful in 58s
This commit is contained in:
@@ -148,6 +148,7 @@ export class AttachmentTransferService {
|
||||
attachment.requestError = isUploader
|
||||
? UPLOADER_LOCAL_FILE_MISSING_ERROR
|
||||
: NO_CONNECTED_PEERS_REQUEST_ERROR;
|
||||
|
||||
this.runtimeStore.touch();
|
||||
console.warn('[Attachments] No connected peers to request file from');
|
||||
return;
|
||||
@@ -236,8 +237,8 @@ export class AttachmentTransferService {
|
||||
attachment,
|
||||
attachment.filePath,
|
||||
this.attachmentStorage.canCopyFiles()
|
||||
)) {
|
||||
const savedPath = await this.persistence.persistUploadCopyFromSourcePath(attachment, attachment.filePath!);
|
||||
) && attachment.filePath) {
|
||||
const savedPath = await this.persistence.persistUploadCopyFromSourcePath(attachment, attachment.filePath);
|
||||
|
||||
if (savedPath) {
|
||||
const fileUrl = await this.attachmentStorage.getFileUrl(savedPath);
|
||||
@@ -659,20 +660,11 @@ export class AttachmentTransferService {
|
||||
this.runtimeStore.deleteChunkCount(assemblyKey);
|
||||
|
||||
if (shouldPersistDownloadedAttachment(attachment)) {
|
||||
const diskPath = await this.persistence.saveFileToDisk(attachment, blob);
|
||||
const fileUrl = diskPath && this.isPlayableMedia(attachment)
|
||||
? await this.attachmentStorage.getFileUrl(diskPath)
|
||||
: null;
|
||||
|
||||
if (fileUrl) {
|
||||
attachment.objectUrl = fileUrl;
|
||||
} else {
|
||||
attachment.objectUrl = URL.createObjectURL(blob);
|
||||
}
|
||||
} else {
|
||||
attachment.objectUrl = URL.createObjectURL(blob);
|
||||
await this.persistence.saveFileToDisk(attachment, blob);
|
||||
}
|
||||
|
||||
attachment.objectUrl = URL.createObjectURL(blob);
|
||||
|
||||
attachment.available = true;
|
||||
this.runtimeStore.touch();
|
||||
void this.persistence.persistAttachmentMeta(attachment);
|
||||
@@ -745,14 +737,14 @@ export class AttachmentTransferService {
|
||||
return;
|
||||
}
|
||||
|
||||
const fileUrl = await this.attachmentStorage.getFileUrl(assembly.path);
|
||||
attachment.savedPath = assembly.path;
|
||||
|
||||
if (!fileUrl) {
|
||||
const restoredForDisplay = await this.persistence.ensureInlineDisplayObjectUrl(attachment);
|
||||
|
||||
if (!restoredForDisplay) {
|
||||
throw new Error('Could not open completed media download from disk.');
|
||||
}
|
||||
|
||||
attachment.savedPath = assembly.path;
|
||||
attachment.objectUrl = fileUrl;
|
||||
attachment.available = true;
|
||||
this.diskReceiveAssemblies.delete(assemblyKey);
|
||||
this.runtimeStore.touch();
|
||||
|
||||
Reference in New Issue
Block a user