WordPress.org

Make WordPress Core

Opened 8 weeks ago

#54522 new defect (bug)

unsaved edits should consistently trigger pop-up alert

Reported by: tiger40490 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: major Version: 5.6
Component: Editor Keywords:
Focuses: Cc:

Description

https://wordpress.org/support/topic/unsaved-content-and-autosave/ described the steps to reproduce the bug.

Background: I use the classic editor to write posts every day. Like many users, I often forget my unsaved edits, and try to leave the edit page. This is such a common user error that WP has multiple protections. The autosave is one protection but I won't talk about it.

A second protection is a local cache in my browser. This is the (unsatisfactory) protection used in the current WP version (5.8.2). It's unsatisfactory because the forgetful user is allowed to leave the edit page with unsaved changes. When she returns to edit the same post, she may fail to notice a warning message in a banner.

This warning is triggered presumably because the local cached version differs from the latest saved version in MySQL.

I have seen (or missed) this banner warning more than 100 times. Not as good as the traditional protection that I have seen in 5.5.3.

The traditional protection is a pop-up alert whenever user attempts to "leave" the post-edit page.

(Leaving means Either closing the browser, or going to another website, or clicking on a link.)

Whenever the editor content differs from the last published version, the alert would reliably pop up. I would either hit cancel then save my changes, or hit Leave to discard my change knowingly.

Needless to say, the pop-up protection is more proactive, more preemptive than the second protection (local cache). That's why current WP version still uses this pop-up protection, but unreliable. In https://wordpress.org/support/topic/unsaved-content-and-autosave/ I discussed when the pop-up shows/doesn't show. To reproduce the bug (no pop-up) you need to be patient.

Even if you can't reproduce the bug, I can guarantee that it does exist. The attached screenshot is the banner warning in 5.8.2. It won't show up if the pop-up has always worked. In 5.5.3 I have not seen this banner.

Attachments (1)

banner_warning.png (47.3 KB) - added by tiger40490 8 weeks ago.

Download all attachments as: .zip

Change History (1)

Note: See TracTickets for help on using tickets.