jack2
2019 年12 月 20 日 11:05
1
How to reproduce:
Go to one of your post and click Edit to open the composer. Don’t type anything.
Press the Esc key => as expected, the composer disappears completely (it isn’t minimized, because the post hasn’t been modified).
Refresh the browser page => the composer comes back.
In step 2, if you click the Cancel button instead of pressing the Esc key, the behavior is correct, i.e. the composer doesn’t come back after browser refresh.
5 个赞
@jack2
I just did it, Yes it does exactly what you say. Not sure if it’s a bug or its suppose to do this actually.
3 个赞
j.jaffeux
(Joffrey Jaffeux)
2020 年3 月 29 日 08:46
4
我已经无法复现这个问题了,请问您还能在 try.discourse.org 上复现吗?
jack2
2020 年3 月 29 日 09:32
5
是的,我刚刚在 try.discourse.org 上复现了这个问题。
等等!这是随机的!有时它不会出现。
j.jaffeux
(Joffrey Jaffeux)
2020 年3 月 29 日 09:34
6
您能找到一致的复现步骤吗?我有一个修复思路,但最好能有稳定的复现方法。拜托了。
1 个赞
j.jaffeux
(Joffrey Jaffeux)
2020 年3 月 29 日 12:39
9
这比预期的要棘手得多,我想这应该能解决问题:
master ← jjaffeux:draft-escape-fix
closed 06:41AM - 30 Mar 20 UTC
This fix will also make sure the bootbox will be correctly shown when using esca… pe.
Test cases:
- edit post, wait for draft check, escape => should totally hide composer
- edit post, add a char, escape => should show bootbox, and reduce or hide depending on choice
Same behavior is expected when pressing on cancel.
我已经请求了多次代码审查,合并可能需要一些时间。再次感谢您提供详细的复现步骤:+1
5 个赞
j.jaffeux
(Joffrey Jaffeux)
2020 年3 月 30 日 06:44
10
快速更新:我刚关闭了 PR。修复方案是有效的,但我们打算在更高层级进行修复。
这可能需要一些时间
4 个赞
sam
(Sam Saffron)
2020 年3 月 31 日 00:51
11
我做了这个修复:
committed 12:49AM - 31 Mar 20 UTC
When editing a post we were incorrectly saving a draft prior to user typing
Thi… s caused a bloat in the amount of drafts saved per user and inconsistency
around behavior of "escape" button.
It also lead to lots of warnings about draft conflicts when copying stuff
between posts.
The code is improved to use promises more appropriately, however further
changes are needed to clean up internals so methods consistently return
promises.
Too many methods in the controller sometimes return a promise and sometimes
an object. Long term the methods will become async and all of this will be
corrected.
这个文件超级棘手 @eviltrout ……我们真希望能尽快支持 async,因为一大堆方法有时返回 Promise,有时返回对象,这让逻辑变得非常难以理解。
目前,我引入了一些 Promise 和绕过机制,确保在点击编辑按钮后不会立即 保存草稿。这也让 @supermathie 抓狂,因为它使得从 N 条回复中复制文本到原帖变得非常复杂和烦人。
7 个赞
j.jaffeux
(Joffrey Jaffeux)
关闭
2020 年4 月 4 日 02:57
13
此主题在最后一次回复后 4 天自动关闭。不再允许新回复。