Skip to content

Commit 2318c9d

Browse files
authored
Bump package:gcloud, make metadata updates non-critical (#8298)
* Bump package:gcloud, make metadata updates non-critical * Bump pubspec.lock
1 parent e476150 commit 2318c9d

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed

app/lib/package/api_export/exported_api.dart

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,14 @@ final class ExportedBlob extends ExportedObject {
631631
// _retouchDeadline
632632
final retouchDeadline = clock.agoBy(_updateValidatedAfter);
633633
if (destinationInfo.metadata.validated.isBefore(retouchDeadline)) {
634-
await _owner._bucket.updateMetadata(dst, _metadata());
634+
try {
635+
await _owner._bucket.updateMetadata(dst, _metadata());
636+
} catch (e, st) {
637+
// This shouldn't happen, but if a metadata update does fail, it's
638+
// hardly the end of the world.
639+
// We might detect stray files later as a result of this.
640+
_log.warning('Failed to updateMetadata on "$dst" failed', e, st);
641+
}
635642
}
636643
return;
637644
}
@@ -659,7 +666,14 @@ extension on Bucket {
659666
if (info.isSameContent(bytes)) {
660667
if (info.metadata.validated
661668
.isBefore(clock.agoBy(_updateValidatedAfter))) {
662-
await updateMetadata(name, metadata);
669+
try {
670+
await updateMetadata(name, metadata);
671+
} catch (e, st) {
672+
// This shouldn't happen, but if a metadata update does fail, it's
673+
// hardly the end of the world.
674+
// We might detect stray files later as a result of this.
675+
_log.warning('Failed to updateMetadata on "$name" failed', e, st);
676+
}
663677
}
664678
return;
665679
}

app/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ dependencies:
1717
fake_async: ^1.2.0
1818
fake_gcloud:
1919
path: ../pkg/fake_gcloud
20-
gcloud: ^0.8.17
20+
gcloud: ^0.8.18
2121
googleapis: ^13.0.0
2222
googleapis_auth: ^1.1.0
2323
html: ^0.15.0

pkg/fake_gcloud/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ environment:
77
resolution: workspace
88

99
dependencies:
10-
gcloud: ^0.8.17
10+
gcloud: ^0.8.18
1111
logging: '>=0.11.3 <2.0.0'
1212
clock: ^1.1.0
1313

pubspec.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,10 +314,10 @@ packages:
314314
dependency: transitive
315315
description:
316316
name: gcloud
317-
sha256: "4023f8f3dde8324ca8d17bd419767986764ac90a1173b207d4bc0e1784e9095f"
317+
sha256: c63576bbd60b7dccd1548d51286e1c5b82e26b62440372a09c2aad0785d2e9f4
318318
url: "https://pub.dev"
319319
source: hosted
320-
version: "0.8.17"
320+
version: "0.8.18"
321321
glob:
322322
dependency: transitive
323323
description:

0 commit comments

Comments
 (0)