Comments (3)
It's rare to see a double form submit prevention scheme that isn't crappy. Doing this requires a bit of work and something I hesitant to recommend we work on. Especially because we plan on re-doing the entire front end of AMO next year to have a different structure, this is one of those things that wouldn't last the transition.
from addons.
Closing based on last comment.
from addons.
@andymckay
I agree that a general form submission prevention scheme takes a lot of work and rarely results in the desired result, that's why I scoped this bug report to the use case. At the review dashboard on AMO, I frequently see double (and triple!!!) submissions (not just by others, I also commit multiple submissions due to the lag on AMO). The URL is at https://addons.mozilla.org/en-US/editors/review/[addon-id]`
The back-end logic would be something along the lines of:
- At form creation time: Include an identifier of the last message (all messages are printed, so this comes at no cost).
- At form submission: Query the last row of the message sequence.
- If 2 differs from 1, show the form again and ask the user to confirm the submission.
If implemented at the front-end, then I would do:
- At
form.onsubmit
, useevent.preventDefault()
and request the page using AJAX. - If the last item in the form is equal to the current last element, use an unchecked
form.submit()
. - Otherwise show a warning and request a confirmation.
In both implementations I assume that the data is up-to-date (and not some old cached value).
The logic is not that difficult. If I knew a bit more about the stack that you're using for the backend, then I would have submitted a patch. Given that you're already familiar with the code, is it possible to fix it?
from addons.
Related Issues (20)
- [Task]: Reviewer Tools Pastebin Re-implementation HOT 1
- [Task]: DevHub Pastebin Re-implementation
- [Task]: Reviewer tools: Support attaching a zip file to a review HOT 3
- [Task]: Handle orphaned cinder policies on AMO HOT 2
- [Bug]: Flag for human review is not cleared after making a reviewer decision HOT 2
- [Bug]: Validation is failing, but not giving a reason why HOT 3
- [Task]: rm crontab.tpl and gen-cron.py HOT 1
- [Bug]: Bad link in extension approval email HOT 4
- [Task]: Please replace the old data source in the grafana dashboards
- [Bug]: admin tools dev - not opening modules HOT 1
- [Bug]: 404 when following link in "Mozilla Add-ons: $EXTENSION_NAME" email HOT 3
- [Bug]: glob dependency is missing in addons-server HOT 1
- [Bug]: Unlisted versions have NHR for add-ons with mixed versions when reporting without a version HOT 1
- [Bug]: Rename "Cinder policys" to "Cinder policies" in the django admin HOT 1
- [Task]: Implement soft-blocking backend
- [Task]: Make it possible to add or edit soft-blocks in the admin
- [Task]: Generate separate bloomfilter for soft-blocks HOT 1
- [Task]: Expose whether a version is soft or hard-blocked in the blocked API
- [Task]: Expose whether a version is soft or hard-blocked in the blocked page
- [Task]: Expose whether a version is soft (and hard?) blocked in devhub
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from addons.