Random double posting with Perspective plugin

(Alexander Wright) #1

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.

(Jeff Atwood) #2

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.

(Joshua Rosenfeld) #3

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.

(Sam Saffron) #5

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

(Will) #6

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.

(Alan Tan) #7

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

(Alexander Wright) #8

I am indeed using Perspective.

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

Would there be logs elsewhere?

(Alexander Wright) #9

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!

(Will) #10

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

(Alexander Wright) #11

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

(Will) #12

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.

(Alexander Wright) #13

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.


(Sam Saffron) #14

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

(Erick Guan) #15

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.

(Alexander Wright) #16

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.

(Mittineague) #17

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.

(Jeff Atwood) #18

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.