Repository navigation
Retire the manifest cloud-reference workaround (#986) - #989
stevevanhooser wants to merge 1 commit into
Conversation
updateFileInfoForLocalFiles no longer writes a second 'ndicloud' location alongside the local 'file' location on a series manifest. That workaround existed to give DID's customFileHandler a non-'file' sourcePath for member fetches, because sqlitedb.download_file_from_cloud raised NDI:Didsqlite:UnsupportedFileLocationType on a plain local path -- so every member of a downloaded series read as absent, silently (NDI-matlab#966). DID-matlab#191 taught the read path to reach a local-file manifest directly, and DID-matlab#201 closed the last case (cloud-only manifest fetched through the same handler). The workaround became "belt and suspenders" and has been dead weight since #201 landed. Both sides of the cloud round trip have coverage now: SyncFiles=true via testMembersSurviveADownloadFromTheCloud (existing) and SyncFiles=false via testMembersSurviveADownloadFromTheCloudWithSyncFilesFalse (NDI-matlab#988). The offline test that pinned the workaround (TestDownloadedSeriesManifestKeepsItsCloudLocation) is removed -- its whole subject was the second location. In its place, TestUpdateFileInfoPreservesSeries.testSeriesManifestHasExactlyOneLocation guards the new invariant: exactly one location, type 'file'. Reintroducing a second ndic:// location would fail that test immediately. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015dKpDXCo8VTS4AHiibNnCp
Test Results1 386 tests - 3 1 353 ✅ - 3 4m 38s ⏱️ -13s Results for commit 2ad46c0. ± Comparison against base commit aea0c72. This pull request removes 4 and adds 1 tests. Note that renamed tests count towards both. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #989 +/- ##
==========================================
- Coverage 29.79% 29.79% -0.01%
==========================================
Files 857 857
Lines 43723 43720 -3
==========================================
- Hits 13029 13026 -3
Misses 30694 30694 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Closing — the workaround is not retirable, my audit note was wrongCloud CI 1 failed on
What I missedI misread what DID-matlab#191 gives us. Reading DID more carefully:
So DID#191 is a necessary but not sufficient condition. The retirement is only safe if the handler can service a local sourcePath OR if the manifest is guaranteed to also carry an What #201 does and doesn't coverDID#201's fetch is for the manifest itself when it's cloud-only. In the SyncFiles=false shape, the manifest starts as The SyncFiles=true shape is different: the manifest bytes come down on disk, Paths forwardTwo real options; both are follow-ups, not this PR:
I'll re-comment on #986 with this analysis so the "workaround retirement is pending" item can be reframed accurately. Closing this PR without merging. The offline test I removed ( Generated by Claude Code |
Summary
Closes the last item on #986. Removes the "belt and suspenders" workaround at
updateFileInfoForLocalFiles.m:96-101, which used to write a secondndicloudlocation alongside the localfilelocation on every downloaded series manifest.Why the workaround existed
Before DID-matlab#191, DID's read path could not reach a manifest that lived on the local disk directly — its customFileHandler only got called for non-
filelocations. So whenupdateFileInfoForLocalFilesre-pointed a downloaded manifest at its local copy, DID would try to open a member of the series, hand the local path todownload_file_from_cloud, and hitNDI:Didsqlite:UnsupportedFileLocationType. DID treats a handler that fails as a plain miss (deliberately, since it resolves speculatively), so every member of a downloaded series read as absent — silently. See #966.The workaround: keep the cloud reference alongside the local one, so the handler always had an
ndic://path to work with, whichever DID reached for first.Why it can be retired now
Two DID-side fixes closed both sides of the gap:
ndic://.testMembersSurviveADownloadFromTheCloudWithSyncFilesFalse(Cloud companion: SyncFiles=false round-trip in FileSeriesRoundTripTest (#986) #988, just merged).The full cloud round trip now has coverage on both sides:
SyncFiles=true→testMembersSurviveADownloadFromTheCloud(pre-existing).SyncFiles=false→testMembersSurviveADownloadFromTheCloudWithSyncFilesFalse(Cloud companion: SyncFiles=false round-trip in FileSeriesRoundTripTest (#986) #988).Either would fail if this retirement regressed member reads.
What's in the diff
src/ndi/+ndi/+cloud/+sync/+internal/updateFileInfoForLocalFiles.m— remove the 30-line block that wrote the second location (both the code and the long comment explaining why the workaround existed). ThereconstructSeriesIngestLocationscall for DID#185's guard stays; that's unrelated.tests/+ndi/+unittest/TestDownloadedSeriesManifestKeepsItsCloudLocation.m— deleted. Its whole subject was pinning the second location; with the workaround gone, its assertions describe behavior we deliberately no longer have.tests/+ndi/+unittest/+database/TestUpdateFileInfoPreservesSeries.m— addtestSeriesManifestHasExactlyOneLocation. Guards the new invariant: afterupdateFileInfoForLocalFiles, the manifest'sfile_infohas exactly one location, and it's the local file. Reintroducing anndic://second location trips this test immediately.Related
Test plan
ndi.unittest.database.TestUpdateFileInfoPreservesSeries— the newtestSeriesManifestHasExactlyOneLocationshould pass; the other three (from NDI-matlab#945) should keep passing.ndi.unittest.cloud.FileSeriesRoundTripTest.testMembersSurviveADownloadFromTheCloud(SyncFiles=true) — must keep passing after the workaround is gone. This is the real regression guard.ndi.unittest.cloud.FileSeriesRoundTripTest.testMembersSurviveADownloadFromTheCloudWithSyncFilesFalse— must keep passing.Cannot run MATLAB locally in this session — please review and validate before merging.
🤖 Generated with Claude Code
https://claude.ai/code/session_015dKpDXCo8VTS4AHiibNnCp
Generated by Claude Code