Page MenuHomePhabricator

Half of the edit summary missing from topic posted with the New Topic Tool after restoring autosave
Closed, ResolvedPublicBUG REPORT

Description

Steps to reproduce

Not sure if it’s reproducible. This is what I did:

  1. Started a new topic on hi:सदस्य वार्ता:SM7.
  2. Started to draft the topic title using the New Topic Tool.
  3. Realized that this is the first time I use DiscussionTools on hiwiki, so I need to adjust my preferences. Opened the preferences on a new tab.
  4. After changing my preferences, I reloaded the talk page tab (simple F5, no cache bypassing or other fancy stuff).
  5. The New Topic Tool didn’t automatically re-open, but when I manually opened it, it restored the state as it was before reloading the page: the title being Google+ in and the body being empty.
  6. I finished drafting the title and then wrote the body.
  7. Before posting the new topic, I opened the Advanced drawer. I saw that the half of the topic title was missing from the summary, but I hoped that it’ll be fixed when actually posting the topic (as there’s some kind of autofix if I don’t touch the summary).
  8. After posting the topic and reviewing the diff, I realized that it wasn’t fixed.

Expected result

At the very least, the actually saved summary should be correct if I don’t touch the summary field. Preferably (and this may in fact be easier), the summary displayed in the advanced drawer should also be correct.

Other information

  • Firefox 91.12.0esr
  • No error messages on console, just a bunch of Empty string passed to getElementById() warnings, probably due to T315614. (I opened the console post mortem, so some log messages may be lost, but hopefully error messages aren’t.)

Event Timeline

I can reproduce.

When you're typing the "Subject", we usually immediately update the "Summary" as you type (you can see this happen if you have the "Advanced" drawer open), except if the "Summary" has been changed by the user rather than automatically generated. When restoring from autosave, it seems like we lose track of the fact that it was automatically generated, and stop updating it because of that.

The New Topic Tool didn’t automatically re-open, but when I manually opened it, it restored the state as it was before reloading the page

This also seems like a bug, we only restore from autosave if the comment body wasn't empty, but we also should do it if subject wasn't empty for new topics.

matmarex renamed this task from Half of the topic title missing from topic posted with the New Topic Tool to Half of the edit summary missing from topic posted with the New Topic Tool after restoring autosave.Aug 20 2022, 4:54 PM

When restoring from autosave, it seems like we lose track of the fact that it was automatically generated, and stop updating it because of that.

What if automatically generated summaries weren’t autosaved in the first place? Since they’re generated, no information is lost if they aren’t autosaved, and the lack of the autosaved summary could signal that the summary was generated.

What if automatically generated summaries weren’t autosaved in the first place? Since they’re generated, no information is lost if they aren’t autosaved, and the lack of the autosaved summary could signal that the summary was generated.

Thanks, that seems like a good idea.

Change 883168 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/DiscussionTools@master] Fix summary when topic title is changed after restoring from autosave

https://gerrit.wikimedia.org/r/883168

Change 883169 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/DiscussionTools@master] Restore autosave for new topic when only title was provided

https://gerrit.wikimedia.org/r/883169

Change 883168 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Fix summary when topic title is changed after restoring from autosave

https://gerrit.wikimedia.org/r/883168

Change 883169 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Restore autosave for new topic when only title was provided

https://gerrit.wikimedia.org/r/883169