Bug: Inventory level resource timestamp delay

Highlighted
Explorer
80 0 23

Whenever we fetch a `ProductVariant` resource, we also fetch its corresponding `InventoryLevel` resource as such:

 

 

{
  "id": 32177501732969,
  "product_id": 4581834227817,
  "title": "Original Cherry",
  "price": "3.00",
  "sku": "",
  "position": 3,
  "inventory_policy": "deny",
  "compare_at_price": null,
  "fulfillment_service": "manual",
  "inventory_management": "shopify",
  "option1": "Original Cherry",
  "option2": null,
  "option3": null,
  "created_at": "2020-04-13T17:01:32-04:00",
  "updated_at": "2020-04-24T10:54:25-04:00",
  "taxable": true,
  "barcode": "",
  "grams": 30,
  "image_id": 14843910422633,
  "weight": 0.03,
  "weight_unit": "kg",
  "inventory_item_id": 33936787505257,
  "inventory_quantity": 44,
  "old_inventory_quantity": 44,
  "requires_shipping": true,
  "admin_graphql_api_id": "gid://shopify/ProductVariant/32177501732969"
}

{
  "inventory_item_id": 33936787505257,
  "location_id": 11690698,
  "available": 44,
  "updated_at": "2020-04-24T10:54:25-04:00",
  "admin_graphql_api_id": "gid://shopify/InventoryLevel/737674?inventory_item_id=33936787505257"
}

Notice the `updated_at` timestamp for both is `2020-04-24T10:54:25-04:00`. A few moments later, when we fetch again, we see that the quantity has changed for `InventoryLevel` to `42` but it seems the `ProductVariant`'s quantity lags behind and is still `44`

 

{
  "id": 32177501732969,
  "product_id": 4581834227817,
  "title": "Original Cherry",
  "price": "3.00",
  "sku": "",
  "position": 3,
  "inventory_policy": "deny",
  "compare_at_price": null,
  "fulfillment_service": "manual",
  "inventory_management": "shopify",
  "option1": "Original Cherry",
  "option2": null,
  "option3": null,
  "created_at": "2020-04-13T17:01:32-04:00",
  "updated_at": "2020-04-24T10:54:25-04:00",
  "taxable": true,
  "barcode": "",
  "grams": 30,
  "image_id": 14843910422633,
  "weight": 0.03,
  "weight_unit": "kg",
  "inventory_item_id": 33936787505257,
  "inventory_quantity": 44,
  "old_inventory_quantity": 44,
  "requires_shipping": true,
  "admin_graphql_api_id": "gid://shopify/ProductVariant/32177501732969"
}

{
  "inventory_item_id": 33936787505257,
  "location_id": 11690698,
  "available": 42,
  "updated_at": "2020-04-24T10:54:25-04:00",
  "admin_graphql_api_id": "gid://shopify/InventoryLevel/737674?inventory_item_id=33936787505257"
}

The real issue is the `InventoryLevel` `updated_at` is still `2020-04-24T10:54:25-04:00` even though its quantity has changed. This is a rare occurrence but seems to happen a few times a day for us. If we crawl everything a bit later, the timestamps are finally updated properly (`2020-04-24T10:54:45-04:00`):

 

{
  "id": 32177501732969,
  "product_id": 4581834227817,
  "title": "Original Cherry",
  "price": "3.00",
  "sku": "",
  "position": 3,
  "inventory_policy": "deny",
  "compare_at_price": null,
  "fulfillment_service": "manual",
  "inventory_management": "shopify",
  "option1": "Original Cherry",
  "option2": null,
  "option3": null,
  "created_at": "2020-04-13T17:01:32-04:00",
  "updated_at": "2020-04-24T10:54:45-04:00",
  "taxable": true,
  "barcode": "",
  "grams": 30,
  "image_id": 14843910422633,
  "weight": 0.03,
  "weight_unit": "kg",
  "inventory_item_id": 33936787505257,
  "inventory_quantity": 42,
  "old_inventory_quantity": 42,
  "requires_shipping": true,
  "admin_graphql_api_id": "gid://shopify/ProductVariant/32177501732969"
}

{
  "inventory_item_id": 33936787505257,
  "location_id": 11690698,
  "available": 42,
  "updated_at": "2020-04-24T10:54:45-04:00",
  "admin_graphql_api_id": "gid://shopify/InventoryLevel/737674?inventory_item_id=33936787505257"
}

This feels like a race condition on your guys' end. Can you verify this is an issue or do we just need to handle this gracefully on our end?

⚡Sync your stock levels + bundles/kits in real-time between any number of Shopify, Amazon, eBay, Etsy, Faire, Squarespace, Square stores with Trunk
0 Likes