Random double posting with Perspective plugin

I’m getting reports on my forum of double posts appearing after users pressing the Create Post button (Also create topic).

rate limit create post and rate limit create topic are both set to 90 seconds.

I can’t see anything relevant in the logs.

Need repro steps on try.discourse.org to work with.

@jomaxro can you try some double posting tests to make sure we have not regressed here? Use the exact same post text and see what happens. Try across two different topics as well as the same topic.

I hit the “text too similar…” error earlier today testing something else. Will do some further testing.

Edit: removed from my list per Sam below.

3 Likes

This is already assigned to @tgxworld per: Body is too similar to what you previously posted - even when previous post didn't go through

3 Likes

We had the same thing happening in our forum. Eventually narrowed it down to the Google Perspective plugin. Disabled it and the issue stopped. Re-enabled and it immediately started back up again.

2 Likes

@Alexander_Wright Do you happen to be using the Google Perspective plugin as well?

3 Likes

I am indeed using Perspective.

The double postings also appear in direct messages, with nothing in the error log.

Would there be logs elsewhere?

Further info:

Perspective plugin is enabled, but not for direct messages, and I’ve had duplicate direct messages reported.

Edit: I’ve disabled it entirely, we’ll see what happens!

I didn’t see any logs, and I don’t know if we had any duplicate DMs while it was enabled. Definitely no complaints about it since though

I’ve since had a couple of examples after disabling the plugin. Not removed it entirely, however. Is disabling sufficient?

All I did was disable, it’s possible you have another add-on causing problems.

I found it by backing up my forums and uninstalling all my addons until I found the culprit. Then reinstalling the others to make sure the problem stayed gone.

3 Likes

Just to confirm, this plugin is definitely linked to this continuing problem. Having removed it for a while, the problem went away. When replaced, it came back again.

:frowning_face:

4 Likes

@fantasticfears is any ideas why perspective plugin could cause double postings?

2 Likes

The plugin works by hacking save in controller:composer. And it retains a state check in the controller. Some hypothesis. The state gets nulled in the ajax process so the controller saves the post twice. Or the worst case, the network fails and the user submitted twice which those requests reached the server. It looks likely the latter case if double posts weren’t observed by other users.

4 Likes

On my instance, a number of users have experienced the bug, using a variety of browsers.

Edit: Also experience on a variety of connections, from mobile data to Mac on a 68MB fibre (FTTC) connection.

I have double posted very rarely. My best guess is a buggy wifi connection was involved. What has happened is

  • I compose a reply and submit
  • the submit hangs and the topic isn’t updated to display my post
  • thinking the submit failed, I submit again
  • the topic updates and displays the post twice

My guess is that the submit succeeds as far as getting to the server, but the update response is what hung making it look like it was the submit that hung.

What I have learned to do when I experience slow wifi times, with more complex posts that I would rather not put together again, is to select all copy them, then refresh the page to see if the submit worked. If it did, fine, if not I simply paste into a new reply and submit again.

As stated above, the problem is limited to the Perspectives plugin at the moment to the best of our knowledge. I’ll edit the title to make this more clear.

5 Likes

Has this been confirmed, addressed, or fixed by the developer of the plugin meanwhile?

We’re just migrating to Discourse and have used Perspective on our old site to flag posts, too. But we used a backend process and did not do it on form-submit, as this also slowed down the posting of posts due to the API call to Google. We did before, but sometimes the API takes quite long and users then clicked multiple times on the submit button, leading to similar problems as described here.