Skip to content

Conversation

@google-labs-jules
Copy link
Contributor

This change enhances the listDatasetDocumentsAll function by adding a mechanism to check for and retrieve new documents that are added during the function's execution. This is controlled by three new optional parameters: checkForUpdates, waitForUpdates, and maximumNumberUpdateReads. The implementation includes de-duplication logic to prevent duplicate entries. This change also includes comprehensive help documentation and a critical bug fix for handling empty datasets.


PR created automatically by Jules for task 6382899028806208480

This commit introduces a new feature to the `ndi.cloud.api.documents.listDatasetDocumentsAll` function and its implementation class. The function now includes an optional mechanism to check for and retrieve new documents that may have been added to the dataset while the function was executing.

The following new name-value pair arguments have been added:
- `checkForUpdates`: (Default `true`) Enables or disables the update-checking feature.
- `waitForUpdates`: (Default `5` seconds) The duration to pause before re-checking for new documents.
- `maximumNumberUpdateReads`: (Default `100`) A limit to prevent infinite re-reading loops.

The implementation now includes a de-duplication mechanism to prevent duplicate entries when re-reading pages that may contain a mix of old and new documents. The code has also been refactored to improve readability and reduce duplication.

This commit also includes comprehensive help documentation for the new feature and addresses a critical bug where the function would crash if called on an empty dataset.
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

if ~page_succeeded
b = false; % Mark overall operation as failed
break; % Exit the main page loop
if ~b, break; end;

Check notice

Code scanning / Code Analyzer

Extra semicolon is unnecessary. Note

Extra semicolon is unnecessary.
[b_page, ans_page, resp_page, url_page] = ndi.cloud.api.documents.listDatasetDocuments(...
this.cloudDatasetID, 'page', page_num, 'pageSize', this.pageSize);

apiURL(end+1) = url_page;

Check notice

Code scanning / Code Analyzer

Variable appears to change size on every loop iteration. Consider preallocating for speed. Note

Variable appears to change size on every loop iteration. Consider preallocating for speed.
this.cloudDatasetID, 'page', page_num, 'pageSize', this.pageSize);

apiURL(end+1) = url_page;
apiResponse(end+1) = resp_page;

Check notice

Code scanning / Code Analyzer

Variable appears to change size on every loop iteration. Consider preallocating for speed. Note

Variable appears to change size on every loop iteration. Consider preallocating for speed.
@stevevanhooser stevevanhooser self-requested a review November 1, 2025 22:24
Copy link
Contributor

@stevevanhooser stevevanhooser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@stevevanhooser stevevanhooser marked this pull request as ready for review November 1, 2025 22:25
@stevevanhooser stevevanhooser merged commit c75dcdb into main Nov 1, 2025
1 check failed
@stevevanhooser stevevanhooser deleted the feature-NDI-123-update-document-list branch November 1, 2025 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants