使用 Perspective 插件随机重复发帖

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 个赞

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 个赞

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 个赞

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

3 个赞

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 个赞

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 个赞

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

2 个赞

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 个赞

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 个赞

插件开发者是否已确认、处理或修复了此问题?

我们正迁移到 Discourse,并在旧站点上使用 Perspective 来标记帖子。但我们采用的是后端处理流程,而非在表单提交时执行,因为调用 Google API 会拖慢发帖速度。我们之前曾尝试在提交时处理,但有时 API 响应较慢,导致用户多次点击提交按钮,从而引发与此处描述类似的问题。