-
Notifications
You must be signed in to change notification settings - Fork 1
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
fix/53: check content for Ctrl+S and Command+S #56
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Sidsector9, thanks for the PR! I have an issue testing this one. The warning appears when I hit Ctrl-S
but the content is still saved. We want to prevent post saving in this case too.
@dinhtungdu This is a work in progress PR, that's why the [WIP] in title 😄 |
Not viewing this as a blocker for v1 launch so punting to 1.1.0 so the v1 release can proceed. |
UpdateRaised an issue with the Gutenberg team - WordPress/gutenberg#34864 |
Upstream Gutenberg issue is resolved, what else is blocking progress on this @Sidsector9? |
@jeffpaul I've tried running with the upstream fix and that didn't work either and the reason is the sequence in which event listeners are registered. Gutenberg's listener for keypress Ctrl + S and Cmd + S runs before our logic to block post saving. |
@Sidsector9 @dinhtungdu any ideas then on how to resolve this issue within the plugin? |
@Sidsector9 is this PR worth keeping open to try and resolve the linked issue or are we blocked by upstream compatibility in Gutenberg? |
@jeffpaul we are blocked by upstream incompatibility with Gutenberg. It's been a while since I've looked into this, I'll spend a little more time on it this week and see what can be done about this PR. |
@Sidsector9 is there anything that could be done here or in Gutenberg to resolve this? If not, let's go ahead and close this out if we're not realistically going to be able to impact change on this issue (and can probably then close the related issue as wontfix). |
@jeffpaul before closing this, I would like to request @fabiankaegy to weigh in his thoughts on this issue, in case he may have a solution? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Sidsector9 a big thanks for your outstanding efforts on this PR.
I tested it on an M1 Mac Air with the Chrome browser, and the behavior was as expected. When I pressed Cmd+S, the warning appeared, preventing the post from being saved. Upon resolving the warning, the post saved successfully.
However, I noticed a number of changes that don't appear directly related to the fix, making the code review somewhat unclear.
Also, it seems the "E2E test / WP trunk" action check failed. Could you please take a look?
@faisal-alvi thanks for reviewing. I will look into the failing tests, we're facing similar failures in other repos as well.
I wasn't able to run linters before these changes due to incompatibilities between the NPM dependencies. Upon investigating I saw this repo had a large number of old and unused dependencies. In commit 1694ff0, I cleaned up the project so that it's aligned with the other projects we have. If you want to focus on reviewing just the feature, then this is the commit - 4a4d3ab |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Sidsector9 Thanks for the info, makes sense, approving.
Closes #53
Description of the Change
This PR enables the checks when saving through the
primary + S
shortcut.Benefits
This benefits the user from not saving insecure post content to the DB using the shortcut.
Verification Process
primary + S
and repeat step 4.primary + S
will save the post with insecure element.Credits
@Sidsector9 @dinhtungdu @jeffpaul @faisal-alvi
Checklist:
Changelog Entry
Fix: Issue with saving post with insecure element using the
primary + S
shortcut.