Closed sentry-io[bot] closed 2 years ago
@teolemon Could not reproduce it. Is that systematic? And where the hell does 9135720000775320488
come from: is that a product you created?
Perhaps a "bad luck" bug, as in product list there are 3 fields...
List<String> barcodes
Map<String, Product> products
Map<String, ProductExtra> productExtras
... and maybe at the moment you go to the page, while loading the product list and before it's over, the display is refreshed for some reason, asking for not fully completed data regarding those 3 fields (loaded one by one).
Automatically closed... I've just reopened it, as I'm not sure my fix (which was a safer code anyway) was good enough. It's merged now (#689): please @teolemon @M123-dev try to reproduce the crash with that new code.
Still crashing here. Going to look into additional traces.
@teolemon I still find that barcode 9135720000775320488
fishy. Do you know where it comes from?
No idea, It's something that I scanned, somehow (like those special logistic barcodes) Exactly the same trace as before.
@teolemon I think I understand what's going on. One day you scanned your blablabla barcode. That obviously did not match a product. But still, you did scan that barcode. In the database we store the fact that you scanned that barcode at that moment. But we cannot store a corresponding product. And in the product list, we want a list of actual products, not a list of potentially failed attempts to find products that match barcodes. I'm about to PR.
Automatically closed again... I reopen it: @teolemon would you please test again, with #696 being merged? There might be useful logs printed - and no more crash.
fixed @monsieurtanuki
That's good news @teolemon!
There are maybe some fine-tunings to code later as we are in a grey zone with the carousel
While we're in a session, the carousel will (probably) display the barcodes with no products (as "not found"), but when we restart the app, the unknown barcodes will disappear because of the initial carousel reload excluding them as without product.
Beyond the fix that prevents the crash, there's now a debug print for those "disappearing" unknown barcodes.
It looks like we're ready to close the issue.
Ok, I scanned a QR code, and it's back
_Exception
product_list.dart in ProductList.getList
Exception: no product for barcode https://qrco.de/bbrpYf
Fixed for me. Thanks @monsieurtanuki , closing again :-)
@teolemon The good news is that it's fixed. The bad news is that we still don't know why it crashed - probably because there was no product related to the barcode, but why did we land in those situations?
The fix was to say: if there's no actual product, we ignore the barcode.
To be tested: stupid barcodes (e.g. 11111111111111111111111) and unknown products (e.g. shampoo). There's a high probability that on those cases, the product is not really put in the list (e.g. history). Is that really a problem? In some cases I guess.
Sentry Issue: SMOOTHIE-ANDROID-1R