Skip to content

Commit de9cb6f

Browse files
fix attachments not being loaded in dev enviornment
Refer to this discussion: https://discord.com/channels/1138230179878154300/1387703779662631004
1 parent 6a0836a commit de9cb6f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Sources/PowerSync/attachments/AttachmentQueue.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,11 @@ open class AttachmentQueue {
413413

414414
for attachment in attachments {
415415
guard let localUri = attachment.localUri else {
416+
// Redownload synced attachments with missing localUri.
417+
// Can happen when the app is reinstalled and a new sandbox is created in the iOS simulator.
418+
if attachment.state == AttachmentState.synced {
419+
updates.append(attachment.with(state: .queuedDownload))
420+
}
416421
continue
417422
}
418423

0 commit comments

Comments
 (0)