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.

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

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.

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

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.

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:

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

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.

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.

그동안 플러그인 개발자가 이를 확인했거나, 조치했거나, 수정했나요?

우리는 현재 Discourse로 이사를 오고 있으며, 이전 사이트에서는 Perspective를 사용하여 게시물도 플래그 처리했습니다. 다만 백엔드 프로세스를 사용했고, 폼 제출 시점에 처리하지 않았습니다. Google로의 API 호출 때문에 게시물 작성 속도가 느려졌기 때문입니다. 이전에는 그렇게 했었지만, API 응답이 상당히 오래 걸리는 경우가 있어 사용자가 제출 버튼을 여러 번 클릭하는 문제가 발생했고, 이는 여기에서 설명된 것과 유사한 문제를 야기했습니다.