[BUG] Incorrect Metafield value from wrong discountNode

Hey there,

A pretty worrying bug. It appears that different discount instances are pulling metafield values from different function types.

Metafields belong to the a Discount resource, so should never be shared across other discount instances.

For example a customer has one instance of Discount type A, and one of Discount type B.

We are seeing RuntimeErrors, whereby the deserialisation of the configuration is failing. In reality, it’s failing correctly, because Discount A is trying to run a configuration from Discount B.

We’ve only seen this fail across a couple of brands, but I do wonder if this is happening much more frequently, but doesn’t throw error because the deserialisation works (the discount types match).

My gut also says that this is only happening where the discount target is the same (e.g delivery-options from two different types of discount).

We are also experiencing the same for some brands using our app, where two product discount metafields getting interchanged

We’re seeing the same issue on some stores — the discount node is pulling different discount metafields.

Can confirm this is happening for multiple brands but this bug started appearing only in the last 24 hours. In our case, the Function input is reading metafields of DiscountNodes to which we add some config, but this is coming into the function as NULL.

On checking the DiscountNode, via Shopify admin API, the config is all there (and well within the size limits).

Started around 3AM IST on Sep 10th, spiked and came down to close to 200 error instances per hour, but I see a slight uptick at the end which is concerning.

Thanks to Shopify team for mitigating this issue! Error graph has now normalized.