Double posting when suffering from internet connectivity issues

I’ve noticed many times that when connecting on Discourse via a mobile device suffering from a intermittent/bad internet connection, the user may post the same content twice. For the user, it’s as if he or she had posted only once, given that the console only closes once, thus displaying only one acknowledgement client-side.

Probably no-one is encountering this problem since the default “unique posts mins” and “rate limit create post” settings should prevent it from happening most of the time. I’ve set mine to 0 and 1 sec, respectively, for reasons I will not explain. However, I’m not even sure that setting this to a higher value will be enough if for instance the user modifies his/her post in-between “post failures”, and waits enough seconds to repost after some unpredictable timeout. Bottom-line, I’m not sure how and why this actually happens and little do I know about the current implementation, but I would like to know if anyone else has encountered this issue. I’m actually not comfortable with the idea that tuning a parameter is the only way to fix this problem.

If somebody else has encountered this problem with the default settings it would be nice to have a feature to prevent this happening that would be based on some unique client-side id generated for each post/topic that the user creates, thus not requiring rate-limiting workarounds. I realize my settings are quite rare, but I also think that a difference should be made between rate-limiting features and a double-post prevention feature. Nonetheless I also understand that such a feature might be hard to pull off properly, without too many side-effects, and might not be worth the effort.

2 Likes

Well, there’s your problem. You disabled protection for this.

1 Like
1 Like

Is it intended to letting those parameters go that low ? Do you know the minimum values that prevent such behavior?

Regardless, I still have a question : assuming the default parameters prevent this problem, is the client able to tell the difference between the server saying “some error occurred when posting” and “you’ve already posted this content”? Can this leave the client in a state where the “new post” console is still open but the server has already processed the post and even appeared on the client by means of long polling? Will the user be forced to manually cancel?

We plan to go through our site settings at some point and set sane mins and max values throughout. In this case I think it is fine for crazies to set the number that low but we should have a warning pop up.