fix(backend): отдавать контрольную сумму оригинала в ответе на загрузку

Ответ на загрузку и публикуемое событие теперь несут хеш сохранённого
объекта, чтобы клиент синхронизации мог сверить принятые байты со своим
файлом и только после этого удалять прежнюю версию элемента.
This commit is contained in:
iu
2026-10-20 20:32:20 +03:00
parent 46d54b4b12
commit 97f8f4e768
2 changed files with 38 additions and 0 deletions
+3
View File
@@ -216,6 +216,9 @@ func (s *Service) Upload(ctx context.Context, in UploadInput) (*models.Photo, er
Height: height,
Checksum: hex.EncodeToString(hasher.Sum(nil)),
}
// The response and the published event carry the checksum the object ledger
// holds, so a client can match its local file against the stored bytes.
p.OriginalChecksum = obj.Checksum
// The metadata layer is the ledger of record: the row is written first,
// then the bytes are stored, then the object is activated.