Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URGENT: If user clicks 'refresh' in validation error state, the page refreshes without warning leading to data loss. #10492

Open
JayBox325 opened this issue Jan 10, 2025 · 1 comment
Labels
status: needs-triage Possible bug which hasn't been reproduced yet

Comments

@JayBox325
Copy link

Describe the Bug

I'm marking this as urgent, as this is a very poor AX and will lead to accidental data loss.

If an author populates fields and refreshes their browser, they correctly get this browser warning:
Image

However, if an author tries to save a page and receives validation errors to get the following, then they refresh the browser, the browser warning modal no longer pops up.
Image

Proposed solution:

Instead of using browser-level modals, there should be a built in modal (much like the logged out one) that really gets the attention of the author to notify them that refreshing or leaving the current state will end in data loss.

Link to the code that reproduces this issue

Don't need one. This is platform-wide on all builds.

Reproduction Steps

  1. Create a new post
  2. Populate content
  3. Make sure to leave validation errors
  4. Save, to trigger validation warnings
  5. Refresh to see the lack of data-loss warning

Which area(s) are affected? (Select all that apply)

area: core

Environment Info

Node: 22.12.0
payload: 3.9.0
next: 15.1.0
@JayBox325 JayBox325 added status: needs-triage Possible bug which hasn't been reproduced yet validate-reproduction labels Jan 10, 2025
Copy link
Contributor

Please add a reproduction in order for us to be able to investigate.

Depending on the quality of reproduction steps, this issue may be closed if no reproduction is provided.

Why was this issue marked with the invalid-reproduction label?

To be able to investigate, we need access to a reproduction to identify what triggered the issue. We prefer a link to a public GitHub repository created with create-payload-app@beta -t blank or a forked/branched version of this repository with tests added (more info in the reproduction-guide).

To make sure the issue is resolved as quickly as possible, please make sure that the reproduction is as minimal as possible. This means that you should remove unnecessary code, files, and dependencies that do not contribute to the issue. Ensure your reproduction does not depend on secrets, 3rd party registries, private dependencies, or any other data that cannot be made public. Avoid a reproduction including a whole monorepo (unless relevant to the issue). The easier it is to reproduce the issue, the quicker we can help.

Please test your reproduction against the latest version of Payload to make sure your issue has not already been fixed.

I added a link, why was it still marked?

Ensure the link is pointing to a codebase that is accessible (e.g. not a private repository). "example.com", "n/a", "will add later", etc. are not acceptable links -- we need to see a public codebase. See the above section for accepted links.

Useful Resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs-triage Possible bug which hasn't been reproduced yet
Projects
None yet
Development

No branches or pull requests

1 participant