# 编辑维基时，一次编辑计为两次

**URL:** <https://meta.discourse.org/t/when-editing-a-wiki-one-edit-counts-as-two/151586>\
**Category:** Bug\
**Created:** [2020年五月15日 08:45 UTC](https://meta.discourse.org/t/when-editing-a-wiki-one-edit-counts-as-two/151586 "2020-05-15T08:45:12Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thomas\_G](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thomas_g/32/200158_2.png) [@Thomas\_G](https://meta.discourse.org/u/Thomas_G)\
**Post date:** [2020年五月15日 08:45 UTC](https://meta.discourse.org/t/when-editing-a-wiki-one-edit-counts-as-two/151586/1 "2020-05-15T08:45:12Z")

</div>

编辑 Wiki 主题时，编辑历史通知会显示 2 次编辑。第一次编辑未显示任何内容，而第二次编辑则显示了具体的编辑内容及其理由。

### 问题一

上述提到的就是第一个问题。

* * *

### 问题二

当不是通过标题旁的铅笔图标，而是通过 Wiki 编辑功能修改标题时，同样会出现 2 条通知：一条关于标题的修改，另一条关于修改理由（ℹ）。

示例：我想修改标题，同时让所有人了解我修改标题的原因。但这无法实现，因为系统生成了两条不同的通知，而不是一条包含所有信息的通知。

* * *

我认为所有编辑操作都应合并显示在一条“历史编辑”通知中，而不是分成两条独立的通知。再次说明，我不确定这是否是预期行为…

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [2020年五月16日 01:25 UTC](https://meta.discourse.org/t/when-editing-a-wiki-one-edit-counts-as-two/151586/2 "2020-05-16T01:25:52Z")

</div>

我们周一能在 @osioke 那里复现这个问题吗？

---

<div class="post-metadata">

**Author:** ![Pad\_Pors](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pad_pors/32/52016_2.png) [@Pad\_Pors](https://meta.discourse.org/u/Pad_Pors)\
**Post date:** [2020年五月17日 15:42 UTC](https://meta.discourse.org/t/when-editing-a-wiki-one-edit-counts-as-two/151586/3 "2020-05-17T15:42:42Z")

</div>

> [@Thomas\_G](#):
>
> 编辑维基主题时，编辑历史通知显示有 2 次编辑。第一次编辑没有任何显示，第二次编辑则显示了具体的编辑内容及其理由。

这种情况出现在 **所有帖子** 中，而不仅限于维基帖子。据我所知， **只有当编辑耗时较长时才会发生** 。也就是说，当你点击编辑按钮并进行修改，如果耗时超过 5-10 分钟，然后你才完成更改并提交。

---

<div class="post-metadata">

**Author:** ![osioke](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/osioke/32/238946_2.png) [@osioke](https://meta.discourse.org/u/osioke)\
**Post date:** [2020年五月18日 14:46 UTC](https://meta.discourse.org/t/when-editing-a-wiki-one-edit-counts-as-two/151586/5 "2020-05-18T14:46:37Z")

</div>

> [@Thomas\_G](#):
>
> 编辑 Wiki 主题时，编辑历史通知会显示 2 次编辑。第一次编辑未显示任何内容，第二次编辑则显示了具体的编辑内容及其原因。
> 
> ### 第一个问题
> 
> 第一个问题就是上述提到的情况。

我无法复现此问题：

 ![post edit notification](https://global.discourse-cdn.com/meta/original/3X/1/a/1a25f49d4df9e8e33a4cc88383ed30cc24992a3d.gif)

@Thomas_G 你能分享一下复现过程的录屏或视频吗？

> [@Thomas\_G](#):
>
> 如果不是通过标题旁的铅笔图标，而是通过 Wiki 编辑功能修改标题，会出现 2 条通知。一条是关于标题的，另一条是关于原因的 (ℹ)。

我可以稳定复现此问题。为 Wiki 帖子标题添加编辑原因时，会生成 2 条编辑通知：一条针对原因，另一条针对编辑内容：

编辑标题前：

 ![image](https://global.discourse-cdn.com/meta/original/3X/6/8/68becd32b4531e464b08b406769d9191cf4a78f1.png)

编辑标题后：

 ![image](https://global.discourse-cdn.com/meta/original/3X/e/d/ed0de22cee6af7d66551cdd04225089605e62677.png)

---

<div class="post-metadata">

**Author:** ![Thomas\_G](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thomas_g/32/200158_2.png) [@Thomas\_G](https://meta.discourse.org/u/Thomas_G)\
**Post date:** [2020年五月18日 16:25 UTC](https://meta.discourse.org/t/when-editing-a-wiki-one-edit-counts-as-two/151586/6 "2020-05-18T16:25:33Z")

</div>

@osioke - 没问题：

[![](https://img.youtube.com/vi/EvZpsfFdMWc/maxresdefault.jpg "Wiki edit bug") ](https://www.youtube.com/watch?v=EvZpsfFdMWc)

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [2020年五月18日 19:38 UTC](https://meta.discourse.org/t/when-editing-a-wiki-one-edit-counts-as-two/151586/7 "2020-05-18T19:38:13Z")

</div>

这可能是一个需要分配给 @eviltrout 的 bug？

---

<div class="post-metadata">

**Author:** ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)\
**Post date:** [2020年六月15日 21:08 UTC](https://meta.discourse.org/t/when-editing-a-wiki-one-edit-counts-as-two/151586/14 "2020-06-15T21:08:03Z")

</div>

嗯，看起来 JS 客户端实际上在这里提交了两项更新。由于包含了编辑原因，服务器无法将它们合并，因此会生成两个修订版本。

---

<div class="post-metadata">

**Author:** ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)\
**Post date:** [2020年六月15日 21:33 UTC](https://meta.discourse.org/t/when-editing-a-wiki-one-edit-counts-as-two/151586/15 "2020-06-15T21:33:41Z")

</div>

有趣的额外 Bug：

- 编辑帖子并填写标题修改原因。（#6）
- 仅编辑标题，但使用不同的原因。（#7）

#7 中的标题变更被错误地关联到了修订版 #6。修订版 #7 仅包含原因，未包含其他变更。

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [2020年六月15日 21:41 UTC](https://meta.discourse.org/t/when-editing-a-wiki-one-edit-counts-as-two/151586/17 "2020-06-15T21:41:06Z")

</div>

这真是一个值得修复的问题，@riking，它一直是我们的一大顽疾 👏

---

<div class="post-metadata">

**Author:** ![Thomas\_G](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thomas_g/32/200158_2.png) [@Thomas\_G](https://meta.discourse.org/u/Thomas_G)\
**Post date:** [2020年八月15日 22:21 UTC](https://meta.discourse.org/t/when-editing-a-wiki-one-edit-counts-as-two/151586/19 "2020-08-15T22:21:02Z")

</div>

附注：编辑标题时，编辑历史功能正常。问题出在其他所有方面 😂

---

<div class="post-metadata">

**Author:** ![osioke](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/osioke/32/238946_2.png) [@osioke](https://meta.discourse.org/u/osioke)\
**Post date:** [2020年八月17日 10:12 UTC](https://meta.discourse.org/t/when-editing-a-wiki-one-edit-counts-as-two/151586/20 "2020-08-17T10:12:23Z")

</div>

别担心，Thomas，@riking 还在处理中，修复这个问题需要更深入地排查。
