Open kidhab opened 9 months ago
I have almost no insights into sharedlist yet, but maybe I can help debugging by digging into it a bit ...
So the unit_quantity is stored correctly in the sharedlists db, right? So I guess the bug is somewhere on the foodsoft side synchronizing the articles.
Because in the request params is already the wrong unit_quantity, I guess that the bug must be somewhere before update_synchronized
is called. Was the unit_quantity correct in the sync
form view? I think that must be the screen that shows the differences of the updated articles ... I'd guess that it's already wrong here?
can you maybe also provide the article details before syncing?
I think this could happen when the foodcoop article unit is much smaller than the shared_list unit? e.g.
article.update!(unit: '0.1ml', unit_quantity: 1)
shared_article.update!(unit: '100ml', unit_quantity: 1.0)
updated_article = supplier.sync_all[0].select { |s| s[0].id == article.id }.first[0]
article.update(updated_article.attributes.reject { |k, _v| %w[id type].include?(k) })
will give the same out of range error when calling article.update
Any progress on this? We still can’t synchronize our prices…
thanks for pinging again! My messy mind completely forgot about it, sorry! I already managed to reproduce the error in ab1fc34 I'll look into it again!
A foodcoop at app.foodcoops.net tries to synchronize articles from the external (Sharedlists) database. It fails for one supplier with the following error message:
Looking at the parameters from this request it shows entries like this one:
There are others entries which have
unit_quantity"=>"6000000000.0
The XML file from the supplier lists the unit_quantity as
<sve>6</sve>
which is then saved to the Sharedlists database as6.0
.Any idea why this error happened?