-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
don't buy what is no longer for sale #58
Comments
It bug was discovered by the reviewer w3f/Grant-Milestone-Delivery#1170 (comment) |
I just tested again and the anomaly is confirmed. |
@AltiMario I tested as well and noticed that the kitty doesn't just remain on sale in the fronted, the backend continues to have it marked for sale after the transfer of ownership. However, it can be purchased as expected when switching accounts (after refreshing the page). A quick fix would be to optimistically update the kitty on the frontend so that the owner updates immediately after the purchase transaction is submitted. This would prevent someone from seeing the option to buy after they've already purchased. However, this approach has a couple limitations:
A more robust solution would be to update the backend logic so that the kitty is marked as not for sale after a purchase, and to also improve communication between backend and frontend, such that things remain in a pending status while transactions are being confirmed, update afterwards, etc. But I assume that is out of scope for now. Would you like me to proceed with the simple optimistic update on the frontend? |
hi @nrutledge I believe fixing the frontend first is the best approach. Well done on sharing the concerns 1 and 2. |
@AltiMario that's correct, the backend changes wouldn't conflict directly with the frontend changes. However, for now I would just optimistically update the owner and not the "for sale" status (to be consistent with current backend behavior). After fixing on the backend, there would just be a slight discrepancy with the status, but it would go away on refresh. I'll create a PR with the frontend change today. |
There is one issue in the frontend as it shows Kitties that already have been bought still as "for sale" so the UI support you in creating a TX to buy this even though it has just been bought and is actually no longer for sale. These transactions fail and it doesn't change the owner again.
The text was updated successfully, but these errors were encountered: