Skip to content

Commit d55222e

Browse files
committed
fixup! fixup! feat(snowflake): Use string as type for snowflake ids
1 parent 9599eab commit d55222e

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

.github/workflows/phpunit-32bits.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,4 @@ jobs:
6969
php -f tests/enable_all.php
7070
7171
- name: PHPUnit
72-
run: composer run test -- --exclude-group PRIMARY-azure,PRIMARY-s3,PRIMARY-swift,Memcached,Redis,RoutingWeirdness
72+
run: lib/composer/bin/phpunit --fail-on-warning --fail-on-risky --display-warnings --display-deprecations --display-phpunit-deprecations --colors=always --configuration tests/phpunit-autotest.xml --exclude-group PRIMARY-azure,PRIMARY-s3,PRIMARY-swift,Memcached,Redis,RoutingWeirdness ../tests/lib/Preview/

lib/private/Preview/Db/Preview.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
* @method void setOldFileId(int $oldFileId)
3030
* @method string getLocationId() Get the location id in the preview_locations table. Only set when using an object store as primary storage.
3131
* @method void setLocationId(string $locationId)
32-
* @method string getBucketName() Get the bucket name where the preview is stored. This is stored in the preview_locations table.
33-
* @method string getObjectStoreName() Get the object store name where the preview is stored. This is stored in the preview_locations table.
32+
* @method string|null getBucketName() Get the bucket name where the preview is stored. This is stored in the preview_locations table.
33+
* @method string|null getObjectStoreName() Get the object store name where the preview is stored. This is stored in the preview_locations table.
3434
* @method int getWidth() Get the width of the preview.
3535
* @method void setWidth(int $width)
3636
* @method int getHeight() Get the height of the preview.

lib/private/Preview/Generator.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,8 @@ public function savePreview(Preview $previewEntry, IImage $preview): Preview {
542542
}
543543
$previewEntry->setSize($size);
544544

545+
echo "Inserting preview with id: " . $previewEntry->getId() . PHP_EOL;
546+
545547
return $this->previewMapper->insert($previewEntry);
546548
}
547549
}

lib/private/Preview/Storage/ObjectStorePreviewStorage.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ public function readPreview(Preview $preview): mixed {
7777

7878
#[Override]
7979
public function deletePreview(Preview $preview): void {
80+
if ($preview->getLocationId() === null) {
81+
// Should only be the case in unit tests when adding dummy previews.
82+
return;
83+
}
84+
8085
[
8186
'urn' => $urn,
8287
'store' => $store,
@@ -100,8 +105,8 @@ public function migratePreview(Preview $preview, SimpleFile $file): void {
100105
* @return ObjectStoreDefinition
101106
*/
102107
private function getObjectStoreInfoForExistingPreview(Preview $preview): array {
103-
assert(!empty($preview->getObjectStoreName()));
104-
assert(!empty($preview->getBucketName()));
108+
assert($preview->getObjectStoreName() !== null);
109+
assert($preview->getBucketName() !== null);
105110

106111
$config = $this->objectStoreConfig->getObjectStoreConfiguration($preview->getObjectStoreName());
107112
$config['arguments']['bucket'] = $preview->getBucketName();

0 commit comments

Comments
 (0)