Skip to content

Conversation

@bevzzz
Copy link
Collaborator

@bevzzz bevzzz commented Sep 12, 2025

This PR brings several QoL changes to how the metadata can be requested.

  1. Query metadata will always include UUID. Deleted Metadata.UUID to avoid suggesting that returning it is optional.
  2. Metadata.ALL is a shorthand for including all metadata fields.
  3. Method .includeVector() as a shorthand for .returnMetadata(Metadata.VECTOR) to mimic a similar functionality in the other clients

This should also fix an issue where Pagination could continue to run forever when any metadata was requested explicitly.

// We previously had a check like:
//   if (returnMetadata.isEmpty()) returnMetadata.add(Metadata.UUID);
// Which meant that query below never gets a UUID from a server.
// Because the "last UUID" is null in this case we always try to fetch the first page
// and never advance the cursor.
things.paginate(p -> p.returnMetadata(Metadata.CREATION_TIME_UNIX)).forEach(...);

Always including the object's UUID addressed that bug.

@bevzzz bevzzz self-assigned this Sep 12, 2025
Copy link

@orca-security-eu orca-security-eu bot left a comment

Choose a reason for hiding this comment

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

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca

Assert cursor is always advancing after an iteration
@bevzzz bevzzz force-pushed the v6-pagination-metadata branch from 8c599ca to 34b411b Compare September 12, 2025 15:16
@bevzzz bevzzz merged commit e7c1101 into v6 Sep 15, 2025
2 checks passed
@bevzzz bevzzz deleted the v6-pagination-metadata branch September 15, 2025 16:04
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