I have custom Drupal commerce price resolver that changes the base price for a product based on the value of a cookie (or absence of one). The resolver adds appropriate cookie cache context to the purchaseable entity. For debugging purposes, cookie expiry is 5 minutes.
Prices are rendered by the Calculated Price Formatter, which adds the cookie cache context from the purchaseable entity to the render element metadata.
This works as expected anywhere the product variation price is displayed directly. When the cookie expires, the displayed price is reset.
But for order items in the cart (block, form or summary), which have a line price using the ORDER ITEM total rendered via the Calculated Price Formatter, the cached render element is not being expired with the cookie, and these continue to show the modified price until something else happens to force a cache rebuild.
Does anyone have any ideas about how to ensure the cookie cache context gets bubbled up and expired appropriately for order items with calculated prices that have cache dependencies?