[Shopify] Surface skipped records and sent JSONL for bulk price sync#9211
Open
onbuyuka wants to merge 2 commits into
Open
[Shopify] Surface skipped records and sent JSONL for bulk price sync#9211onbuyuka wants to merge 2 commits into
onbuyuka wants to merge 2 commits into
Conversation
When a bulk productVariantsBulkUpdate completes with per-variant Shopify errors (e.g. a product deleted on the Shopify side), the connector reverted the variant price silently, causing an invisible infinite retry loop with no user feedback. - Log a Shopify Skipped Record for every variant reverted after a Shopify error, mapping each result line back to its variant via __lineNumber and attaching the Shopify error message. The skipped record references the linked BC Item Variant (preferred) or Item so the user sees which product failed and why. - Persist the JSONL request sent to Shopify on the Shpfy Bulk Operation record (only when Logging Mode = All) and add a Download Sent Data action on the Shopify Bulk Operations page for troubleshooting. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Copilot PR ReviewIteration 2 · Outcome: completed Knowledge source: https://github.com/microsoft/BCQuality@822cae1b2771ac25f665f73369f69093bd4fd630 Findings by domainFindings split into Knowledge-backed (cite a BCQuality article) and Agent (the agent's own judgement, no matching BCQuality rule).
Totals: 1 knowledge-backed · 0 agent findings. Orchestrator pre-filter (13 file(s) excluded)
Findings produced by the Copilot CLI agent against BCQuality at |
- GetBCRecordId now calls SetLoadFields() before the Item Variant / Item GetBySystemId lookups, since only RecordId is needed (avoids transferring full rows inside the revert loop). - Move SentDataFileNameLbl from the GetSentData OnAction trigger to the page object-scope var block for reliable XLIFF extraction. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
nikolakukrika
approved these changes
Jul 9, 2026
AndreiPanko
approved these changes
Jul 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes AB#641615
Problem
When a bulk price sync (
productVariantsBulkUpdate) completes but Shopify returns a per-variant error — for example a product that was deleted on the Shopify side ("Product does not exist") — the connector'sRevertFailedRequestslogic reverted the affected variant back to its old price silently. On the next Sync Prices run the same item is picked up again, producing an invisible infinite retry loop with no skipped-record entry, no log, and nothing in the UI to tell the user what failed.Changes
Skipped record feedback on revert.
Shpfy Bulk UpdateProductPrice.RevertFailedRequestsnow parses the per-lineuserErrors/errorsfrom the result JSONL and maps each result line back to its request-data entry via__lineNumber(base-agnostic: derived from the minimum observed line number, so it works whether Shopify numbers from 0 or 1). Every reverted variant gets a Shopify Skipped Record with the Shopify error message. The entry references the linked BC Item Variant (preferred) or Item — resolved from the Shopify variant's SystemIds — matching the existingLogSkippedRecordconvention inShpfy Product Export, so the user sees exactly which product failed and why. Logging respects the shop's Logging Mode (suppressed only when Disabled).Downloadable sent JSONL. Added a
Sent JSONLblob field (13) to tableShpfy Bulk OperationwithSet/GetSentJsonlhelpers.Shpfy Bulk Operation Mgt.SendBulkMutationnow stores the JSONL request that was sent to Shopify — only when Logging Mode = All, to avoid growing the table with a payload blob on every price sync — and a new Download Sent Data action on theShopify Bulk Operationspage exposes it for troubleshooting.Test plan
Added to
Shpfy Bulk Operations Test:TestBulkOperationRevertFailedLogsSkippedRecords— completes a bulk op where two of four variants fail; asserts a skipped record is logged for each failed variant with the correct Shopify error message, and that the entry'sTable ID/Record IDresolve to the linked BC Item (item-level) and Item Variant (variant-level); asserts no skipped record for the successful variants.TestSendBulkOperationStoresSentJsonl— with Logging Mode = All, asserts the sent JSONL is stored on the bulk operation record.TestSendBulkOperationDoesNotStoreSentJsonlWhenNotLoggingAll— with Logging Mode = Error Only, asserts nothing is stored.