Open wuast94 opened 4 months ago
Looks like one of the providers changed something. I'm also having this issue. If I have time I'll see if it can be fixed. Either way a broken provider shouldn't break in this way
Will look into this.
I could be way off base, but as I was looking through the code in OpenFoodFactsProductProvider.cs, it appears to be looking for the JSON to come in as product.code, product.ProductName and product.CategoriesTags (as the OpenFoodFacts V2 API documentation states) however, when I was playing around with it, it seemes to be coming in as products.code, products.ProductName...etc (Notice the "S" at the end of product)
Again, I could be wayyyy off base, but I thought it was worth passing along to save you guys time if this was the issue.
This is what I tested...
{ "count": 1, "page": 1, "page_count": 1, "page_size": 20, "products": [ { "categories_tags": [ "en:plant-based-foods-and-beverages", "en:plant-based-foods", "en:snacks", "en:cereals-and-potatoes", "en:salty-snacks", "en:appetizers", "en:chips-and-fries", "en:crisps", "en:potato-crisps" ], "code": "0028400189224", "product_name": "Potato chips" } ], "skip": 0 }
So when it comes to coop request for that product, the logs say its this URL: https://www.coop.ch/de/dynamic-pageload/searchresultJson?componentName=searchresultJson&url=%2Fde%2Fsearch%2F%3Ftext%3D4104420031326&displayUrl=%2Fde%2Fsearch%2F%3Ftext%3D4104420031326&compiledTemplates%5B%5D=productTile-new&compiledTemplates%5B%5D=sellingBanner&_=1724517556832
Running this in a regular browser works fine.
Tt does not find the product: Leider keine Treffer für \"4104420031326\"
but the error still happens with a product that is in their database.
If I run a curl
however, I get the same as the error message:
<html><head><title>coop.ch</title><style>#cmsg{animation: A 1.5s;}@keyframes A{0%{opacity:0;}99%{opacity:0;}100%{opacity:1;}}</style></head><body style="margin:0"><p id="cmsg">Please enable JS and disable any ad blocker</p><script data-cfasync="false">var dd={'rt':'c','cid':'AHrlqAAAAAMAu_bs3UZxaO0AUVO16g==','hsh':'4E2D21855D176C1885A97CE16C8EC3','t':'bv','s':49043,'e':'abedece9c06f121ba3667587a50a98752519a9b2d91689a9d68833c9a9cb25ab','host':'geo.captcha-delivery.com'}</script><script data-cfasync="false" src="https://ct.captcha-delivery.com/c.js"></script></body></html>
Maybe they've implemented more protections against crawling? I'm also not the most knowledgeable about this.
In any case: This error is entirely unrelated to the bug. I've run the debugger and I've even disabled the coop provider and the button remains grayed out.
I found the issue. Im working on a PR fix but git is fighting me
Thanks a lot. I will review asap. I'm currently so busy at work that I can't focus on this project. Sorry.
@wuast94 can you pull the latest docker and confirm that it's working for you now? If so, I think we can close this issue.
I've just discovered a new regression: now products that are in grocy get the grayed out. Will send a fix soon
as you can see i cant click on the button sadly