- Issue created by @dragos-dumi
- 🇩🇪Germany Anybody Porta Westfalica
Logically, it makes sense to me, what you're writing. On the other hand, I'm also wondering if nobody else ran into this yet.
For the effect of this possible bug, I'm setting priority to major to gain attention. Best would be to create a test case first, which reproduces this issue?Sadly I'm not very experienced with caching-enabled tests, but perhaps someone can help here? Or with the general issue?
- 🇩🇪Germany Anybody Porta Westfalica
Another thing just came to my mind: Does the regular "Added to cart" confirmation (Drupal message) appear?
If not, this would mean that all commerce installations would be affected by this bug, which seems quite unrealistic?Can you reproduce this issue in a more or less vanilla environment or simplytest.me just using the essentially needed modules for reproduction?
- 🇷🇴Romania dragos-dumi
So I tracked down the initial issue to the fact that I had in the cart view, the remove button. This was, for some weird reason, messing up with the bubbling of cache metadata when having big pipe. This prevented the page to get cart context and commerce_order:ID tags which would have made the page dynamic cache invalid (assuming that the cart block is in all pages from where you can add a product)
So the confirmation message works, as it seems, only if you have the cart block in the page, which would make the cache invalid when cart changes.
Now there's a second issue as I see, which makes sense to be happening. The confirmation does show up now and gets cached in the page.
This I replicated in having a clean commerce demo kickstart installed + this module.for this 2nd issue I attach a patch with max-age 0 when there's settings appended.
for the 1st issue, I guess we should state in the modules page that it 'requires' cart block to be in the page? or somethign like that?
An alternative would be to enforce the cache tags and context via this modules hook, but it would be bit weird as it would affect all pages, and one might not want that.
An alternative would be to have been a block with lazy builder and the user 'can choose' which pages gets this feature.