Skip to content

Commit

Permalink
Merge pull request #30 from utopia-php/feat-fix-source-errors
Browse files Browse the repository at this point in the history
Catch edge condition and ensure we set file status to success
  • Loading branch information
abnegate authored May 17, 2024
2 parents 117be70 + 758e905 commit 426306b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Migration/Destinations/Appwrite.php
Original file line number Diff line number Diff line change
Expand Up @@ -499,13 +499,13 @@ public function importFile(File $file): File
);

if ($file->getEnd() == ($file->getSize() - 1)) {
$file->setStatus(Resource::STATUS_SUCCESS);

// Signatures for Encrypted files are invalid, so we skip the check
if ($file->getBucket()->getEncryption() == false || $file->getSize() > (20 * 1024 * 1024)) {
if ($response['signature'] !== $file->getSignature()) {
$file->setStatus(Resource::STATUS_WARNING, 'File signature mismatch, Possibly corrupted.');
}
} else {
$file->setStatus(Resource::STATUS_SUCCESS);
}
}

Expand Down

0 comments on commit 426306b

Please sign in to comment.