Skip to content
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

Toggle endpoints are subject to race conditions #590

Open
brassy-endomorph opened this issue Sep 17, 2024 · 0 comments
Open

Toggle endpoints are subject to race conditions #590

brassy-endomorph opened this issue Sep 17, 2024 · 0 comments

Comments

@brassy-endomorph
Copy link
Collaborator

Is your feature request related to a problem? Please describe.

Users clicking a form button mutliple times may sent multiple requests that lead to undesired state where a boolean is twice flipped instead of twice idempotently set.

Describe the solution you'd like

Endpoints of the form:

entity.some_attr = not entity.some_attr
db.session.commit()

Should require a form to explicitly include if the field is being set to true or false to prevent multiple requests from undoing each other. The flashed message should also include the state the field is set to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant