多次编辑帖子后,用户界面不更新

我注意到这种情况很多次了,但它并不一致。

当我创建回复帖子并发布它。然后立即返回编辑并点击保存。然后再做一次,有时 UI 不会显示最新的编辑。编辑已保存在服务器上,因为当我刷新页面时会显示出来,但问题是它并不总是显示出来,直到页面刷新。这种情况会发生在新的回复帖子中,以及在帖子注册编辑修订标签之前的 2-3 分钟内被编辑多次时。

在升级到 3.1.0 版本(目前运行 3.1.2,1 GB RAM 和 1 Unicorn)后,在使用 Chrome 浏览器(Win 10)和 iPhone Safari(iOS 17.0.3)时,我看到了这种情况。这种情况发生得相当频繁,所以我才报告它。

这种情况以前没有发生过。自从它开始发生以来,只有 2 个变化:

  1. discourse 升级到 3.x
  2. 将 Unicorn 的数量从 2 个减少到 1 个
2 个赞

这有一个简单的重现方法:让管理员/TL4 同时编辑帖子的标题和内容,只有其中一个编辑(通常是帖子编辑)会显示出来,另一个会被标记出来,但无法看到。

2 个赞

谢谢你的报告…… :slight_smile: \n\n你能不能顺便录制一个展示此行为的短视频?

如果在 Chrome 开发者工具中查看,是否会看到很多错误,请求不是 200?

在 Chrome 开发者工具控制台中,我看到这个,它似乎是 429(我不知道 404 是什么):

content-script.js:1 cornhusk, shared-service, error: TypeError: Failed to construct 'URL': Invalid URL无效的 URL:
extractOriginPath @ content-script.js:1
Show 1 more frame
Show less
content-script.js:1 cornhusk, shared-service, error: TypeError: Failed to construct 'URL': Invalid URL无效的 URL:
extractOriginPath @ content-script.js:1
Show 1 more frame
Show less
video.google.com/get_player?docid=1wQ5F_aEDhPpC8sW7ZTrAhbNVrSOAXsXr&ps=docs&partnerid=30&cc_load_policy=1:1

       Failed to load resource: the server responded with a status of 404 ()
content-script.js:1 cornhusk, shared-service, error: TypeError: Failed to construct 'URL': Invalid URL无效的 URL:
extractOriginPath @ content-script.js:1
Show 1 more frame
Show less
content-script.js:1 cornhusk, shared-service, error: TypeError: Failed to construct 'URL': Invalid URL无效的 URL:
extractOriginPath @ content-script.js:1
Show 1 more frame
Show less
content-script.js:1 cornhusk, shared-service, error: TypeError: Failed to construct 'URL': Invalid URL无效的 URL:
extractOriginPath @ content-script.js:1
Show 1 more frame
Show less
content-script.js:1 cornhusk, shared-service, error: TypeError: Failed to construct 'URL': Invalid URL无效的 URL:
extractOriginPath @ content-script.js:1
fingerprintPage @ content-script.js:1
observeCheckoutMutations @ content-script.js:1
Show 3 more frames
Show less
content-script.js:1 cornhusk, shared-service, error: TypeError: Failed to construct 'URL': Invalid URL无效的 URL:
extractOriginPath @ content-script.js:1
fingerprintPage @ content-script.js:1
observeCheckoutMutations @ content-script.js:1
Show 3 more frames
Show less
jquery.js:9930

       POST https://xxxx.com/message-bus/2089d5dd986440908b29e8064c58d208/poll 429 (Too Many Requests)
send @ jquery.js:9930
ajax @ jquery.js:9511
s @ message-bus.js:22
n.baseUrl.n.ajax @ message-bus.js:88
k @ chunk.660.3ca404a8b6b50dfefca7.js:2
n @ chunk.660.3ca404a8b6b50dfefca7.js:2
(anonymous) @ chunk.660.3ca404a8b6b50dfefca7.js:2
setTimeout (async)
complete @ chunk.660.3ca404a8b6b50dfefca7.js:2
e.complete @ message-bus.js:17
l @ jquery.js:3213
fireWith @ jquery.js:3343
E @ jquery.js:9632
abort @ jquery.js:9332
unsubscribe @ chunk.660.3ca404a8b6b50dfefca7.js:2
unsubscribe @ presence.js:179
_unsubscribe @ presence.js:397
unsubscribe @ presence.js:101
_setupChannel @ composer-presence-display.js:81
_setupChannels @ composer-presence-display.js:93
b @ index.js:207
l @ index.js:423
p.invoke @ queue.ts:201
p.flush @ queue.ts:98
h.flush @ deferred-action-queues.ts:75
$._end @ index.ts:616
_boundAutorunEnd @ index.ts:257
Promise.then (async)
n @ platform.ts:28
flush @ index.js:41
$._scheduleAutorun @ index.ts:803
$._end @ index.ts:623
_boundAutorunEnd @ index.ts:257
Promise.then (async)
n @ platform.ts:28
flush @ index.js:41
$._scheduleAutorun @ index.ts:803
$._end @ index.ts:623
_boundAutorunEnd @ index.ts:257
Promise.then (async)
n @ platform.ts:28
flush @ index.js:41
$._scheduleAutorun @ index.ts:803
$._end @ index.ts:623
_boundAutorunEnd @ index.ts:257
Promise.then (async)
n @ platform.ts:28
flush @ index.js:41
$._scheduleAutorun @ index.ts:803
$._end @ index.ts:623
_boundAutorunEnd @ index.ts:257
Promise.then (async)
n @ platform.ts:28
flush @ index.js:41
$._scheduleAutorun @ index.ts:803
$._ensureInstance @ index.ts:791
$.ensureInstance @ index.ts:579
scheduleRevalidate @ index.js:5390
dirtyTag @ validator.js:411
R @ validator.js:486
F @ index.js:497
z @ index.js:533
De @ index.js:1409
Te @ index.js:1385
set @ observable.js:175
save @ composer.js:707
saveAction @ composer.js:554
_triggerAction @ d-button.js:178
click @ d-button.js:144
jquery.js:9930

       POST https://xxxx.com/message-bus/2089d5dd986440908b29e8064c58d208/poll?dlp=t 429 (Too Many Requests)
send @ jquery.js:9930
ajax @ jquery.js:9511
s @ message-bus.js:22
n.baseUrl.n.ajax @ message-bus.js:88
k @ chunk.660.3ca404a8b6b50dfefca7.js:2
n @ chunk.660.3ca404a8b6b50dfefca7.js:2
(anonymous) @ chunk.660.3ca404a8b6b50dfefca7.js:2
setTimeout (async)
complete @ chunk.660.3ca404a8b6b50dfefca7.js:2
e.complete @ message-bus.js:17
l @ jquery.js:3213
fireWith @ jquery.js:3343
E @ jquery.js:9632
(anonymous) @ jquery.js:9878
load (async)
send @ jquery.js:9897
ajax @ jquery.js:9511
s @ message-bus.js:22
n.baseUrl.n.ajax @ message-bus.js:88
k @ chunk.660.3ca404a8b6b50dfefca7.js:2
n @ chunk.660.3ca404a8b6b50dfefca7.js:2
document.addEventListener.e.onVisibilityChange @ chunk.660.3ca404a8b6b50dfefca7.js:2
callback @ message-bus.js:49
d @ user-presence.js:90
p @ user-presence.js:103
m @ user-presence.js:110
22:1 Error handling response: TypeError: Cannot read properties of undefined (reading 'isCheckout')
    at chrome-extension://clmkdohmabikagpnhjmgacbclihgmdje/content-script.js:1:5043
22:1 Unchecked runtime.lastError: A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received

这意味着您的操作速度太快,需要放慢速度。这是一种保护机制,可防止有人用脚本淹没您的论坛。许多 Web 应用程序会在您操作速度过快时告知您,然后拒绝您的操作。

4 个赞

我从 429 中了解到这一点。如果您看到上面的视频示例,它看起来快吗?论坛应该能够区分同一帐户/IP 快速创建帖子与用户大约 5 秒后编辑帖子。

另外:我没有看到任何问题,可以每 5 秒左右编辑一次此帖子。这是我一分钟内进行的第 5 次编辑。

第 6 次:因此,在 3.1.x 升级后某些东西发生了变化,因为它以前运行正常。或者 429 阈值是否取决于独角兽的数量?

429 是否与配置的独角兽数量(1 个或多个)有关?我在我的网站上一直遇到此问题,但在该网站上没有看到。

那么这不影响这个网站吗?我可以在这里每隔几秒钟编辑我的帖子,没有任何问题(我尝试在几秒钟内编辑多达 8 次),但在我的网站上似乎是个问题(即使只编辑 2 次)。

1 个赞