Skip to content

getRecordsByIds silently omits records when a batch spans multiple pages #7641

Description

@dakjdakd

getRecordsByIds() is expected to return every stored record whose ID was requested. The response budget introduced in #6187 lets the records service shorten a response to stay within RECORDS_MAX_RESPONSE_SIZE_BYTES and return a next_cursor for the remaining records. The SDK currently makes one request per group of 100 IDs, then moves to the next group even when that response has a cursor. Within a single group, the remaining records are silently omitted from the returned map.

For example, with two stored records and a response budget that fits only one, getRecordsByIds(['a', 'b'], model) returns a map containing a only. The records response includes a cursor, but the SDK does not request its next page. This occurs when the byte budget is enabled and RECORDS_MAX_RESPONSE_SIZE_DRY_RUN is false.

The SDK should keep the same set of external IDs while following every cursor for that group, then start the next group without carrying over the previous cursor. The returned map should contain both records in the example above. A regression test covering a shortened page and the transition to the next ID group would protect both parts of the behavior.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions