---
id: change/bcapps/9313
type: change
title: "#9313 [Shopify] Fix Product Sync deleting mapped variants on stale Updated At timestamp"
summary: The Shopify variant sync now correctly distinguishes between variants that have stale local timestamps (should be kept) and variants deleted on Shopify (should be removed), preventing incorrect deletion of mapped variants during asynchronous bulk operations.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - codeunit shpfy variant api
system: integration
review:
  state: reviewed
  by: opus
  at: "2026-10-08T02:13:12.353Z"
  flags: []
generated:
  at: "2026-10-08T01:26:53.141Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 210794a77602ec9ebc13cee12097d3c68f6c4871
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/9313
    title: "microsoft/BCApps#9313: [Shopify] Fix Product Sync deleting mapped variants on stale Updated At timestamp"
    date: "2026-07-13"
    commit: 210794a77602ec9ebc13cee12097d3c68f6c4871
    t: null
    quote: null
links:
  learn: []
  objects:
    - object/codeunit/30189
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
number: 9313
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/9313
kind: pr
base_branch: main
major: "30"
merged_at: "2026-07-13T09:25:52Z"
author: onbuyuka
author_type: User
community_contribution: false
labels:
  - "AL: Apps (W1)"
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 2
  additions: 154
  deletions: 6
  al: 1
apps:
  - Shopify
objects_touched:
  - key: codeunit/30189
    page: codeunit/30189
    type: codeunit
    id: 30189
    name: Shpfy Variant API
    app: Shopify
    status: modified
objects_unjoined: []
obsoletions: []
backports: []
fixes_issues: []
work_items:
  - 641922
systems:
  - integration
quote: null
joined_against:
  major: "30"
  commit: ecbc028c25dbe83b61313bc566e6c1d41184bb1c
---

# #9313 [Shopify] Fix Product Sync deleting mapped variants on stale Updated At timestamp

> The Shopify variant sync now correctly distinguishes between variants that have stale local timestamps (should be kept) and variants deleted on Shopify (should be removed), preventing incorrect deletion of mapped variants during asynchronous bulk operations.

[Pull request](https://github.com/microsoft/BCApps/pull/9313) · merged into `main` (BC30) on 2026-07-13 by onbuyuka · 2 files (+154 -6), 1 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- RetrieveShopifyVariant now returns true when the Shopify variant exists regardless of timestamp comparison, and false only when the variant is genuinely absent
- UpdateShopifyVariantFields no longer returns a Boolean since the timestamp guard skip is no longer interpreted as a deletion signal
- Fixed a logic conflict where skipping a field update due to a stale local timestamp was incorrectly treated as evidence the variant was deleted on Shopify
- Added comprehensive unit tests using HttpClientHandler mocking to verify correct behavior for both stale timestamps and actual deletions
- Behaviour changes for users or extensions.

## AL objects touched

- [Codeunit 30189 "Shpfy Variant API"](../../objects/codeunit/30189.md), Shopify: modified

## Context

- Work items: AB#641922
- Labels: AL: Apps (W1)
- Systems: integration

Source: metadata of a merged pull request in microsoft/BCApps (bcapps): title, labels, changed paths and counts, with a summary in our words. No source text and no description beyond one short quote (D10, D61).
