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
If someone in debt is presented with the two-step purchase/logout and clicks "Purchase" but never clicks "Logout", when the system attempts to do the auto-logout after the timeout expires the "Logout" button is disabled but the screen never changes.
After local debugging, I discovered that the problem lies in how the cart is handled; after completing a purchase by clicking "Purchase", the cart still exists but the id field is invalid/unknown. The timeout function then detects a non-empty cart (since there are still items visible in the webpage) and runs the purchase_submit function, which throws an exception upon discovering that the "id" field is undefined in this line:
As a temporary fix I added a try-catch block around the purchase_submit function which simply switches the screen if an exception is thrown, but that is not a long-term solution.
The text was updated successfully, but these errors were encountered:
I updated the fix in commit 6283f57 to be a bit less hacky; it now checks if the purchase is complete along with the "are any items in the cart" check when processing a timeout. Since the purchase was completed in this situation, it will see that and ignore the fact that there are "items" in the cart. Still not perfect, but at least it doesn't throw exceptions for now.
If someone in debt is presented with the two-step purchase/logout and clicks "Purchase" but never clicks "Logout", when the system attempts to do the auto-logout after the timeout expires the "Logout" button is disabled but the screen never changes.
After local debugging, I discovered that the problem lies in how the cart is handled; after completing a purchase by clicking "Purchase", the cart still exists but the id field is invalid/unknown. The timeout function then detects a non-empty cart (since there are still items visible in the webpage) and runs the purchase_submit function, which throws an exception upon discovering that the "id" field is undefined in this line:
chez-betty/chezbetty/static/js/chezbetty-terminal.js
Line 597 in 6eff7e6
As a temporary fix I added a try-catch block around the purchase_submit function which simply switches the screen if an exception is thrown, but that is not a long-term solution.
The text was updated successfully, but these errors were encountered: