Skip to content

[BUG] Retrieve by Customer Key fails for paginated results #2628

Description

@kacperkruger

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Components (e.g. fileTransfer, dataExtract) cannot be retrieved by Customer Key if they are not included in the first page of the API response.
Retrieving all components works correctly.

Expected Behavior

Components should be retrievable by Customer Key regardless of pagination

Steps To Reproduce

  1. Create more than 25 File Transfers or Data Extracts
  2. Try to retrieve a component that would appear on the second (or later) page

Version

9.0.3

Environment

  • OS: Windows
  • Node: 24.16.0
  • npm: 11.13.0

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

The issue comes from the fact that the API response is paginated, but only the first page is currently checked when retrieving a component by Customer Key.

I was able to resolve this locally by changing this condition in MetadataType.js (around retrieveREST, line ~1458):

this.definition.restPagination && !singleRetrieve

to

this.definition.restPagination

This ensures all pages are retrieved, so the component can be found reliably.
However, it downloads all components on every retrieve so can increase execution time

Metadata

Metadata

Assignees

No one assigned

    Labels

    NEWnot yet analyzed new issues get this labelbugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions