fix: heal corrupt objects on push — on_conflict_do_update in wire_push_objects and wire_push_object_pack
Previously, both push paths used on_conflict_do_nothing when inserting MusehubObject rows. If a corrupted DB row already existed (bytes in R2 don't match the object_id), any fresh push of the correct bytes would be silently dropped because the DB row already existed.
Changed both paths to on_conflict_do_update: - wire_push_object_pack: updates content_cache + resets storage_uri to 'pending' so the background R2 upload re-runs with the correct bytes. - wire_push_objects (presigned path): updates storage_uri to the new R2 URI (correct bytes were already uploaded to R2 before the DB insert) and clears content_cache.
Content-addressed objects are immutable by definition: sha256(content) == object_id is verified by _verify_object_hash before storage, so overwriting is always safe and idempotent.
This prevents silent data corruption where an object pushed with wrong bytes in a previous session could never be repaired by a subsequent correct push.
0 comments
muse hub commit comment sha256:7dfb3db13f9bec7339bd0ae4177b6d1fd90c484db9bcbeac1b2e6027f421bac5 --body "your comment"
No comments yet. Be the first to start the discussion.