Skip to content

fix(webinar): filter hash tree sync response to requested dataset - #5136

Open
WeijuanShao wants to merge 3 commits into
webex:nextfrom
WeijuanShao:fix/hashtree-metrics-issue
Open

fix(webinar): filter hash tree sync response to requested dataset#5136
WeijuanShao wants to merge 3 commits into
webex:nextfrom
WeijuanShao:fix/hashtree-metrics-issue

Conversation

@WeijuanShao

@WeijuanShao WeijuanShao commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

A sync request is scoped to a single dataset, but Locus may include additional datasets in the response (e.g. "unjoined" shares core Locus elements with "main" and advances to the same version). Processing the response as-is applied the shared elements once per dataset, producing duplicate LOCUS objects and triggering the LOCUS_HASH_TREE_UNSUPPORTED_OPERATION metric.

Filter the sync response down to the requested dataset before processing.

COMPLETES # https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-841547

This pull request addresses

filter the sync response data

by making the following changes

When we send a sync request for the main dataset, the response may contain both the main and unjoin datasets. To ensure the data is processed correctly, we should first filter the returned datasets based on the requested dataset, and then process only the filtered results.

Change Type

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Tooling change
  • Internal code refactor

The following scenarios were tested

< ENUMERATE TESTS PERFORMED, WHETHER MANUAL OR AUTOMATED >

The GAI Coding Policy And Copyright Annotation Best Practices

  • GAI was not used (or, no additional notation is required)
  • Code was generated entirely by GAI
  • GAI was used to create a draft that was subsequently customized or modified
  • Coder created a draft manually that was non-substantively modified by GAI (e.g., refactoring was performed by GAI on manually written code)
  • Tool used for AI assistance (GitHub Copilot / Other - specify)
    • Github Copilot
    • Other - Please Specify
  • This PR is related to
    • Feature
    • Defect fix
    • Tech Debt
    • Automation

I certified that

  • I have read and followed contributing guidelines
  • I discussed changes with code owners prior to submitting this pull request
  • I have not skipped any automated checks
  • All existing and new tests passed
  • I have updated the documentation accordingly

Make sure to have followed the contributing guidelines before submitting.

A sync request is scoped to a single dataset, but Locus may include additional
datasets in the response (e.g. "unjoined" shares core Locus elements with
"main" and advances to the same version). Processing the response as-is applied
the shared elements once per dataset, producing duplicate LOCUS objects and
triggering the LOCUS_HASH_TREE_UNSUPPORTED_OPERATION metric.

Filter the sync response down to the requested dataset before processing.
@WeijuanShao
WeijuanShao requested review from a team as code owners July 31, 2026 06:36
@aws-amplify-us-east-2

Copy link
Copy Markdown

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-5136.d3m3l2kee0btzx.amplifyapp.com

@WeijuanShao WeijuanShao added the validated If the pull request is validated for automation. label Jul 31, 2026
* @returns {HashTreeMessage} a new message containing only the requested dataset
*/
private filterMessageToDataSet(message: HashTreeMessage, dataSetName: string): HashTreeMessage {
return {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this is good, but I think it would be useful to add a log that prints what data we are filtering out (dataset name, element types, ids, versions)

@github-actions github-actions Bot removed the validated If the pull request is validated for automation. label Aug 5, 2026
@WeijuanShao WeijuanShao added the validated If the pull request is validated for automation. label Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

validated If the pull request is validated for automation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants