π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[server] Add missing check for stale file entries
Neeraj Gupta47c12251ae3f
diff --git a/server/pkg/controller/collections/cast.go b/server/pkg/controller/collections/cast.goindex 1c8525e278..b1f6980a6b 100644--- a/server/pkg/controller/collections/cast.go+++ b/server/pkg/controller/collections/cast.go@@ -47,6 +47,14 @@ func (c *CollectionController) GetCastDiff(ctx *gin.Context, sinceTime int64) ([}diff[idx].Action = nildiff[idx].ActionUserID = nil+ if diff[idx].Metadata.EncryptedData == "-" && !diff[idx].IsDeleted {+ // This indicates that the file is deleted, but we still have a stale entry in the collection+ reqContextLogger.WithFields(log.Fields{+ "file_id": diff[idx].ID,+ "updated_at": diff[idx].UpdationTime,+ }).Warning("stale collection_file found")+ diff[idx].IsDeleted = true+ }}return diff, hasMore, nil}diff --git a/server/pkg/controller/collections/share.go b/server/pkg/controller/collections/share.goindex 81cdc8111e..3e9206e778 100644--- a/server/pkg/controller/collections/share.go+++ b/server/pkg/controller/collections/share.go@@ -318,6 +318,14 @@ func (c *CollectionController) GetPublicDiff(ctx *gin.Context, sinceTime int64)}diff[idx].Action = nildiff[idx].ActionUserID = nil+ if diff[idx].Metadata.EncryptedData == "-" && !diff[idx].IsDeleted {+ // This indicates that the file is deleted, but we still have a stale entry in the collection+ reqContextLogger.WithFields(log.Fields{+ "file_id": diff[idx].ID,+ "updated_at": diff[idx].UpdationTime,+ }).Warning("stale collection_file found")+ diff[idx].IsDeleted = true+ }}return diff, hasMore, nil}