Creating new Variables in the Database
As mentioned in my proposal[1] I will create new variables and modify the schema of how we save things in the database. Here I am facing issues (most probably because I am a newbie in SQL Alchemy). I am not able to understand how to exactly implement this. Relevant searches in the docs provided nothing substantial ( If there is then provide the appropriate link in the reply )
If there is not then GSoD guys take note, we can have a doc page on how to modify database if the admin wants to according to its needs( although it is highly rare for someone to do that so not that much priority upon this ).
Apparently, I think there is a minor bug in hyperkitty/postorious I suppose
When I created the message to post into the list I accidentally clicked the "Send" button twice and then the page loaded so there were two copies of the exact same message, the URL is also different so I think it created two different entities in hyperkitty. Does anybody know the reason?
Here is the link for those two https://mail.python.org/archives/list/mailman-developers@python.org/thread/T...
https://mail.python.org/archives/list/mailman-developers@python.org/thread/Y...
On 5/15/19 1:37 PM, Aaryan Bhagat wrote:
Apparently, I think there is a minor bug in hyperkitty/postorious I suppose
When I created the message to post into the list I accidentally clicked the "Send" button twice and then the page loaded so there were two copies of the exact same message, the URL is also different so I think it created two different entities in hyperkitty. Does anybody know the reason?
You sent the message twice. The message composition page has a Send button which posts the message to <https://example.com/archives/list/list_id/message/new>
You clicked the button and your browser sent the POST. Before the screen refreshed, you clicked the button again, and your browser sent the same POST data a second time.
I've seen lots of sites, mostly having to do with purchasing or donating money that warn you that clicking whatever more than once will result in a duplicate charge.
If you really think this is a bug in HyperKitty rather than a bug in your browser or just user error, how do you suggest we fix it.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Mark thanks for the clarification, I understand the principle now for this behaviour. It would be sort of nitpicking but is it good enough to open an issue so that this behaviour should be avoidable?( I do not know the exact way to avoid it yet).
Alteast we can write a Disclaimer something like "Do not click the Send button twice" ( In a more soft and pleasing way, not like this exactly )
On 5/15/19 2:01 PM, Aaryan Bhagat wrote:
Mark thanks for the clarification, I understand the principle now for this behaviour. It would be sort of nitpicking but is it good enough to open an issue so that this behaviour should be avoidable?( I do not know the exact way to avoid it yet).
Alteast we can write a Disclaimer something like "Do not click the Send button twice" ( In a more soft and pleasing way, not like this exactly )
It would be appropriate to add a warning, particularly if response can be slow. You can open an issue for that.
Maybe something like "Please do not press Send more than once. Doing so will create a duplicate post."
Actually modifying HyperKitty to detect that such a post is a duplicate would I think be quite cumbersome. Hyperkitty would have to remember all the posts to check for a dup. It is not enough to check the archive because Hyperkitty sends the post to core and doesn't archive it until it returns which may not yet have happened at the time of the second Send.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On 5/15/2019, 4:56:22 PM, Mark Sapiro <mark@msapiro.net> wrote:
I've seen lots of sites, mostly having to do with purchasing or donating money that warn you that clicking whatever more than once will result in a duplicate charge.
If you really think this is a bug in HyperKitty rather than a bug in your browser or just user error, how do you suggest we fix it.
I've always wondered about this.
It seems to me that code could be written to put the interface in somce kind of state where it wouldn't accept another click once a successful click > transaction had been initiated.
Maybe there are technical reasons this isn't as easy as it sounds like it would be?
On 5/17/19 10:49 AM, Tanstaafl wrote:
On 5/15/2019, 4:56:22 PM, Mark Sapiro <mark@msapiro.net> wrote:
I've seen lots of sites, mostly having to do with purchasing or donating money that warn you that clicking whatever more than once will result in a duplicate charge.
If you really think this is a bug in HyperKitty rather than a bug in your browser or just user error, how do you suggest we fix it. I've always wondered about this.
It seems to me that code could be written to put the interface in somce kind of state where it wouldn't accept another click once a successful click > transaction had been initiated.
Maybe there are technical reasons this isn't as easy as it sounds like it would be?
The only real solution that I can think of would require javascript code that would on pressing the button, make the button now unpressable, and then submit the page. One issue with this is that if javascript isn't enabled, the page may be unusable as the button now requires javascript to do anything, and while javascript is largely usable, some browsers still don't support it, and many users intentionally disable it.
I suppose you could have some javascript on the page that, if javascript is enabled, changes the button to use the javascript to disable it, and if javascript is disabled it works as current (where two presses cause the problem).
The only other solution I can think of would be to give each page served a unique id, and remember all the unique ids that have sent you a request 'recently', and do something about repeats (and figure out how long recent might need to be), the bigest issue here is that almost by definition, the earlier request is still 'in process' (as the user still has the old page), so you are dealing with a 'race' condition, and may create a bigger delay in order to try and handle the issue.
-- Richard Damon
On 5/15/19 1:27 PM, Aaryan Bhagat wrote:
As mentioned in my proposal[1] I will create new variables and modify the schema of how we save things in the database. Here I am facing issues (most probably because I am a newbie in SQL Alchemy). I am not able to understand how to exactly implement this. Relevant searches in the docs provided nothing substantial ( If there is then provide the appropriate link in the reply )
You need to modify the appropriate interface and model. For example, to add something to the mailinglist object you would add it appropriately in mailman/interfaces/mailinglist.py and add a column for it in the MailingList model in model/mailinglist.py. Depending on what it is, other things may be required in model/mailinglist.py.
Finally, you need to create a migration in mailman/database/alembic/versions/ with appropriate upgrade and downgrade functions for existing databases. See <https://alembic.sqlalchemy.org/en/latest/tutorial.html> and the existing migrations in mailman/database/alembic/versions/.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (4)
-
Aaryan Bhagat
-
Mark Sapiro
-
Richard Damon
-
Tanstaafl