You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Write some name, and change the offer type to "discounted shipping"
Write some discount value and hit save
see error below
the reason is that phoenix expects
discountedShipping: {
discount: someNumberHere
}
but receives
discountedShipping: {
setPrice: someNumberHere
}
This happens only when specifying the offer type to discounted shipping right first, if you edit other offer type, then change the type to discounted shipping, it doesnt throws any errors, cause frontend sends data structure like this
So phoenix accepts the data, stores bot set price and discount (dunno why) and frontend visualises setPrice, but discount is what really matters.
This issue left unnoticed cause phoenix stores and then returns any additional keys in offer object it receives. cc @jmataya@Anna-ZZZ@mempko
This particular bug is already fixed in scope of this PR - #2207 (see last commit, data structure generated by FE was originally wrong) but still I think its bad that we store any additional data passed as offers object - if not that we could have noticed this bug much earlier.
Second issue is with setPrice offer.
I see that frontend sends this as offer object
setPrice: {
setPrice: someValue,
}
and if you set offer type as setPrice, specify some value, and hit save, you'll see that it want save with error
failed to compile offer setPrice, couldn't extract attributes: No usable value for numUnits Did not find value which can be converted into int
which means that phoenix expects numUnits key in offer object, which is not set anywhere in frontend, so its not sent.
see error below

the reason is that phoenix expects
but receives
This happens only when specifying the offer type to discounted shipping right first, if you edit other offer type, then change the type to discounted shipping, it doesnt throws any errors, cause frontend sends data structure like this
So phoenix accepts the data, stores bot set price and discount (dunno why) and frontend visualises setPrice, but discount is what really matters.
This issue left unnoticed cause phoenix stores and then returns any additional keys in offer object it receives. cc @jmataya @Anna-ZZZ @mempko
This particular bug is already fixed in scope of this PR - #2207 (see last commit, data structure generated by FE was originally wrong) but still I think its bad that we store any additional data passed as offers object - if not that we could have noticed this bug much earlier.
Second issue is with setPrice offer.
I see that frontend sends this as offer object
and if you set offer type as setPrice, specify some value, and hit save, you'll see that it want save with error
which means that phoenix expects numUnits key in offer object, which is not set anywhere in frontend, so its not sent.
Not sure how exactly this shall be fixed.
https://docs.google.com/document/d/18GMxZ1_VxbeXF6EOr0xEdz0_Ye6fXP5qPyjhRnqP4cI/edit#heading=h.i3wt1qemqb5d
Its not clear for me when I read this doc.
https://docs.google.com/document/d/18GMxZ1_VxbeXF6EOr0xEdz0_Ye6fXP5qPyjhRnqP4cI/edit#heading=h.i3wt1qemqb5d
The text was updated successfully, but these errors were encountered: