π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Fix Space temp object cleanup race
Anand Baburajan1562e63d221f
diff --git a/server/space/repo/temp_objects.go b/server/space/repo/temp_objects.goindex cecf184b66..bc051847b1 100644--- a/server/space/repo/temp_objects.go+++ b/server/space/repo/temp_objects.go@@ -60,7 +60,8 @@ func (r *AssetsRepository) GetTempObject(ctx context.Context, objectKey, purposefunc ConsumeTempObjectTx(ctx context.Context, tx *sql.Tx, objectKey, purpose string, spaceID *string) error {args := []any{objectKey, purpose}- query := `DELETE FROM space_temp_objects WHERE object_key = $1 AND purpose = $2`+ // Cleanup changes cleanup_after before deleting from S3, claiming the object.+ query := `DELETE FROM space_temp_objects WHERE object_key = $1 AND purpose = $2 AND cleanup_after = expires_at`if spaceID != nil {args = append(args, *spaceID)query += fmt.Sprintf(" AND space_id = $%d", len(args))