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

🐛 Fixed editor 'are you sure?' modal displaying when no user changes occurred #20370

Merged
merged 12 commits into from
Jun 13, 2024

Conversation

9larsons
Copy link
Contributor

ref https://linear.app/tryghost/issue/ENG-661

  • added a dirty check to ignore the direction field from the lexical object; this is set dynamically and shouldn't be serialized, see Bug: serialized direction in headless editor is always null facebook/lexical#4998
  • fixed a bug where the modal wouldn't display on leaving the editor if the post had no revisions (e.g. import); this could result in content being saved over published content with no user action
  • added Sentry logging for the modal

We would sometimes see the "Are you sure?" modal pop up when opening a post in the editor and attempting to navigate away immediately, without any changes to the post. This appears to be an issue with the serialized Lexical data, which would change after loading into the editor, resulting in the scratch and model's lexical values to differ, making Admin think the user changed the content.

Ideally we'll see a fix upstream (or fix it ourselves). We may need to revisit this if we experience other such situations. It's awfully difficult to be able to set a flag saying 'the editor is done loading', so this seems to be the best path for the moment.

@github-actions github-actions bot added the affects:admin Anything relating to Ghost Admin label Jun 11, 2024
@9larsons 9larsons merged commit 59b304d into main Jun 13, 2024
19 checks passed
@9larsons 9larsons deleted the troubleshooting-editor-save-modal branch June 13, 2024 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects:admin Anything relating to Ghost Admin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant