Skip to content

[Shopify] Surface skipped records and sent JSONL for bulk price sync#9211

Open
onbuyuka wants to merge 2 commits into
mainfrom
bugs/641615-shopify-bulk-price-sync-feedback
Open

[Shopify] Surface skipped records and sent JSONL for bulk price sync#9211
onbuyuka wants to merge 2 commits into
mainfrom
bugs/641615-shopify-bulk-price-sync-feedback

Conversation

@onbuyuka

@onbuyuka onbuyuka commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

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's RevertFailedRequests logic 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

  1. Skipped record feedback on revert. Shpfy Bulk UpdateProductPrice.RevertFailedRequests now parses the per-line userErrors/errors from 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 existing LogSkippedRecord convention in Shpfy Product Export, so the user sees exactly which product failed and why. Logging respects the shop's Logging Mode (suppressed only when Disabled).

  2. Downloadable sent JSONL. Added a Sent JSONL blob field (13) to table Shpfy Bulk Operation with Set/GetSentJsonl helpers. Shpfy Bulk Operation Mgt.SendBulkMutation now 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 the Shopify Bulk Operations page 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's Table ID/Record ID resolve 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.

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>
@onbuyuka onbuyuka requested a review from a team July 8, 2026 09:04
@github-actions github-actions Bot added the AL: Apps (W1) Add-on apps for W1 label Jul 8, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone Jul 8, 2026
@onbuyuka onbuyuka enabled auto-merge July 8, 2026 09:12
Comment thread src/Apps/W1/Shopify/App/src/Bulk Operations/Pages/ShpfyBulkOperations.Page.al Outdated
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Copilot PR Review

Iteration 2 · Outcome: completed

Knowledge source: https://github.com/microsoft/BCQuality@822cae1b2771ac25f665f73369f69093bd4fd630

Findings by domain

Findings split into Knowledge-backed (cite a BCQuality article) and Agent (the agent's own judgement, no matching BCQuality rule).

Domain Findings Knowledge-backed Agent Inline Fallback
Style 1 1 0 1 0

Totals: 1 knowledge-backed · 0 agent findings.

Orchestrator pre-filter (13 file(s) excluded)

  • layer-disabled (knowledge) : 13 file(s)

Findings produced by the Copilot CLI agent against BCQuality at 822cae1b2771ac25f665f73369f69093bd4fd630. Reply 👎 on any inline comment to flag false positives.

- 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AL: Apps (W1) Add-on apps for W1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants