Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,27 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### Added

- **File uploads confirm NDI Cloud recorded every file, and resend what it
did not** (`ndi.cloud.upload.confirmFilesRecorded`,
`uploadFilesForDatasetDocuments(verify_uploads=..., verify_stall_timeout=...)`,
MATLAB VH-Lab/NDI-matlab#1297). A batch (zip) upload reported success once
the zips reached S3, but the server records their files in a later step
that can fail unheard (a dataset lost 327 files this way,
ndi-cloud-node#175). After both the `'batch'` and `'serial'` strategies the
sent files are now waited for while records keep arriving (up to
`verify_stall_timeout`, default 900 s, without progress), any still
unrecorded are uploaded again one at a time, and files never recorded
count as failed, so their documents are kept out of the sync index.
`'serial'` previously waited 120 s and failed without resending.

- **File batch uploads are capped at 2000 files** (new preference
`Cloud.Upload.Max_File_Batch_Count`; `zipForUpload(count_limit=...)`, MATLAB
VH-Lab/NDI-matlab#1297). Batches were capped only by bytes (250 MB), so
10,000 small files went up as one zip, and NDI Cloud never recorded any of
them: it unpacks and records a batch in one time-limited step. Files still
unrecorded after an upload are resent as capped zip batches, or one at a
time when there are at most 20.

- **Navigator: NDI Cloud login indicator** (`ndi.gui.nav.cloud_pane`, MATLAB
VH-Lab/NDI-matlab@579176c88). The NDI Cloud pane gains a small button that is
green when logged in (an unexpired `NDI_CLOUD_TOKEN`), yellow when a profile
Expand Down
94 changes: 92 additions & 2 deletions src/ndi/cloud/ndi_matlab_python_bridge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,7 @@ functions:

- name: zipForUpload
matlab_path: "+ndi/+cloud/+upload/zipForUpload.m"
matlab_last_sync_hash: "7180cc8"
matlab_last_sync_hash: "0be6cfed3"
python_path: "ndi/cloud/upload.py"
input_arguments:
- name: file_manifest
Expand All @@ -1005,6 +1005,10 @@ functions:
type_matlab: "double (SizeLimit)"
type_python: "float | None"
default: "None"
- name: count_limit
type_matlab: "double (CountLimit)"
type_python: "int | None"
default: "None"
- name: number_retries
type_matlab: "double (numberRetries)"
type_python: "int"
Expand All @@ -1026,6 +1030,11 @@ functions:
- name: report
type_python: "dict[str, Any]"
decision_log: >
2026-11-21: NDI-matlab 0be6cfed3 (VH-Lab/NDI-matlab#1297). A batch also ends
at count_limit files (None = the Cloud.Upload.Max_File_Batch_Count
preference, 2000): NDI Cloud never recorded a zip of 10,165 small
files (84 MB, under the size cap). MATLAB also dropped an unused read
of D.path; Python's port never took a dataset.
2026-10-17: REPLACED. The function that lived here zipped document JSON,
had no caller in src, and so was a port of nothing (see the 2026-09-08
note below). It is now a port of what MATLAB's zipForUpload actually
Expand Down Expand Up @@ -1075,7 +1084,7 @@ functions:

- name: uploadFilesForDatasetDocuments
matlab_path: "+ndi/+cloud/+sync/+internal/uploadFilesForDatasetDocuments.m"
matlab_last_sync_hash: "293ec411"
matlab_last_sync_hash: "63e56ae14"
python_path: "ndi/cloud/upload.py"
input_arguments:
- name: org_id
Expand All @@ -1102,13 +1111,27 @@ functions:
type_matlab: "logical (Verbose)"
type_python: "bool"
default: "False"
- name: verify_uploads
type_matlab: "logical (VerifyUploads)"
type_python: "bool"
default: "True"
- name: verify_stall_timeout
type_matlab: "double (VerifyStallTimeout)"
type_python: "float"
default: "900.0"
- name: client
type_python: "CloudClient | None"
default: "None"
output_arguments:
- name: result
type_python: "dict[str, Any]"
decision_log: >
2026-11-20: NDI-matlab 63e56ae14 (VH-Lab/NDI-matlab#1297). After both
strategies the files sent are checked with confirmFilesRecorded (a
zip reaching S3 is not the server recording its files,
ndi-cloud-node#175); files still unrecorded after a resend count as
failed and their documents go into failed_document_ids. For 'batch',
the files of batches zipForUpload already failed are not checked.
2026-10-18: NDI-matlab 293ec411 (VH-Lab/NDI-matlab#1037) only rewrote a Verbose error message
(it now names the user's organizations instead of
NDI_CLOUD_ORGANIZATION_ID). Python's org_id may now be "" to look the
Expand Down Expand Up @@ -1978,6 +2001,73 @@ porting_deferred:
1-based; the batches themselves are identical. Non-positive caps raise
ValueError (MATLAB's arguments block rejects them with mustBePositive).

- name: confirmFilesRecorded
matlab_path: "+ndi/+cloud/+upload/+internal/confirmFilesRecorded.m"
matlab_last_sync_hash: "0be6cfed3"
python_path: "ndi/cloud/upload.py"
input_arguments:
- name: dataset_id
type_matlab: "string"
type_python: "str"
- name: uids
type_matlab: "string (1,:)"
type_python: "list[str]"
- name: paths
type_matlab: "cell"
type_python: "list[str]"
- name: org_id
type_python: "str"
default: "''"
- name: stall_timeout
type_matlab: "double (StallTimeout)"
type_python: "float"
default: "900.0"
- name: resend_timeout
type_matlab: "double (ResendTimeout)"
type_python: "float"
default: "300.0"
- name: single_file_limit
type_matlab: "double (SingleFileLimit)"
type_python: "int"
default: "20"
- name: verbose
type_matlab: "logical (Verbose)"
type_python: "bool"
default: "False"
- name: wait_fcn
type_matlab: "function_handle (WaitFcn)"
type_python: "Callable | None"
default: "None"
- name: resend_fcn
type_matlab: "function_handle (ResendFcn)"
type_python: "Callable | None"
default: "None"
- name: resend_batch_fcn
type_matlab: "function_handle (ResendBatchFcn)"
type_python: "Callable | None"
default: "None"
- name: client
type_python: "CloudClient | None"
default: "None"
output_arguments:
- name: result
type_matlab: "[ok, report]"
type_python: "dict[str, Any]"
decision_log: >
2026-11-21: NDI-matlab 0be6cfed3. More than single_file_limit unrecorded
files are resent as zip batches (zipForUpload, capped by count and
size) instead of one at a time, which did not finish 10,165 files in
40 minutes; after resending it waits while records keep arriving.
2026-11-20: new in NDI-matlab 63e56ae14 (VH-Lab/NDI-matlab#1297). Waits
while NDI Cloud keeps recording the files an upload sent, uploads again
(one at a time) any it stops recording, and reports those still
missing. MATLAB returns [ok, report]; Python returns one dict with ok
folded in, and resend_errors for MATLAB's resendErrors. wait_fcn
returns waitForFileUpload's dict (state, pending) where MATLAB's
WaitFcn returns [b, answer]. org_id is Python-only: the resend's
upload URL needs it, and "" looks it up from the dataset record. Lives
in ndi.cloud.upload beside its caller, like documentBatchRanges.

- name: zip_documents_for_upload
matlab_path: "+ndi/+cloud/+upload/+internal/zip_documents_for_upload.m"
matlab_last_sync_hash: "ec25d3c"
Expand Down
Loading
Loading