Skip to content

Conversation

@robcaruso
Copy link
Collaborator

Issue

Bulk export with _includeHistory=true fails to export history records for resources that have client-assigned string IDs (forced IDs). The export
completes successfully but history versions are missing from the output for any resources with client-assigned IDs.

Cause

When performing a bulk export with history enabled, the processHistoryResources() method was converting resource PIDs to their forced ID strings via
convertToStringIds() before querying for history. However, history records in the database are indexed by numeric PIDs, not forced IDs. This causes
the history query (IBulkDataExportHistoryHelper.fetchHistoryForResourceIds()) to return no results for resources with client-assigned IDs.

Fix

Modified ExpandResourceAndWriteBinaryStep.processHistoryResources() (line 225) to use numeric PIDs directly by calling
typePidJsonList.stream().map(TypedPidJson::getPid).toList() instead of convertToStringIds(). The bulk export history helper can work with PIDs
natively, making the forced ID conversion unnecessary and incorrect for history queries.

Added test testSystemBulkExportWithHistory_WithClientAssignedIds() that validates all history versions are exported for resources with forced IDs.

Closes #7296

@robogary
Copy link
Contributor

robogary commented Oct 14, 2025

Formatting check succeeded!

Copy link
Collaborator

@jdar8 jdar8 left a comment

Choose a reason for hiding this comment

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

Left a suggestion on the changelog. Other than that, looks good to me!

Requires a senior+ approval

rob-caruso and others added 4 commits October 23, 2025 15:04
@robcaruso robcaruso changed the base branch from master to rel_8_6 October 24, 2025 18:08
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.

If resource id is string, failed bulk export resources with _includeHistory parameter

7 participants