cb4d0ad1

By: Jörg Thalheim <joerg@thalheim.io>

server,client: record uploads at completion with real refs and size

Register objects with the refs and size from their pending_objects row
instead of empty refs and unknown size, so object_stats stays accurate.
Fail the multipart completion request if registration fails, before the
tracking row is dropped, so a client retry can re-attempt the idempotent
insert.

Add POST /api/uploads/complete so presigned (non-multipart) uploads --
narinfos, listings, build logs, realisations, small NARs -- are also
recorded when they finish. Otherwise a closure that never commits leaves
them unknown to the objects table and every later closure re-uploads
them. The client notifies the server best-effort after each presigned
PUT.
devShell-defaultgo-unit-testsgolangci-lintnixos-test-niks3nixos-test-niks3-lixnixos-test-read-proxypackage-benchmark-closurepackage-benchmark-disk-imagepackage-defaultpackage-mock-oidc-serverpackage-niks3package-niks3-dockerpackage-niks3-hookpackage-niks3-serverpackage-niks3-testspackage-rustfstreefmtconfiguredevShellbenchmark-closurebenchmark-disk-imagedefaultmock-oidc-serverniks3niks3-dockerniks3-hookniks3-serverniks3-testsrustfsx86_64-linux