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

fix: Prevent Gutenberg connection logic from crashing Aztec #20053

Merged

Conversation

dcalhoun
Copy link
Member

@dcalhoun dcalhoun commented Jan 26, 2024

Description

A network connectivity subscriber was added to the post activity in: #19692

However, it was not scoped to only run in the Gutenberg editor. Because
no guard was in place, the subscriber attempted to invoke a non-existent
method on the Aztec editor, resulting in a crash.

Fixes #20052

To Test:

  1. Enable the Classic editor plugin for a site.
  2. Create a post with the classic editor on the web.
  3. Open the post in the Android app.
  4. Disable your device's network connection (e.g., enable airplane mode).
  5. Verify the editor does not crash.
  6. Enable your device's network connection (e.g., disable airplane mode).
  7. Verify the editor does not crash.

Regression Notes

  1. Potential unintended areas of impact
    Regressions could be introduced to the Gutenberg or Aztec editor.
  2. What I did to test those areas of impact (or what existing automated tests I relied on)
    Manual tested both editors for basic usage; e.g., text entry, toggling network
    connectivity.
  3. What automated tests I added (or what prevented me from doing so)
    None. Lack of existing Aztec tests boilerplate and unfamiliarity with the
    testing infrastructure.

PR Submission Checklist:

  • I have completed the Regression Notes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

UI Changes Testing Checklist:

  • Portrait and landscape orientations.
  • Light and dark modes.
  • Fonts: Larger, smaller and bold text.
  • High contrast.
  • Talkback.
  • Languages with large words or with letters/accents not frequently used in English.
  • Right-to-left languages. (Even if translation isn’t complete, formatting should still respect the right-to-left layout)
  • Large and small screen sizes. (Tablet and smaller phones)
  • Multi-tasking: Split screen and Pop-up view. (Android 10 or higher)

@dcalhoun dcalhoun marked this pull request as ready for review January 26, 2024 17:22
@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jan 26, 2024

Jetpack📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack Jetpack
FlavorJalapeno
Build TypeDebug
Versionpr20053-a931b5d
Commita931b5d
Direct Downloadjetpack-prototype-build-pr20053-a931b5d.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jan 26, 2024

WordPress📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress WordPress
FlavorJalapeno
Build TypeDebug
Versionpr20053-a931b5d
Commita931b5d
Direct Downloadwordpress-prototype-build-pr20053-a931b5d.apk
Note: Google Login is not supported on these builds.

@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented Jan 26, 2024

Warnings
⚠️ This PR is assigned to a milestone which is closing in less than 4 days Please, make sure to get it merged by then or assign it to a later expiring milestone
⚠️

This PR contains changes to RELEASE_NOTES.txt.
Note that these changes won't affect the final version of the release notes as this version is in code freeze.
Please, get in touch with a release manager if you want to update the final release notes.

Generated by 🚫 dangerJS

@dcalhoun dcalhoun added this to the 24.0 milestone Jan 26, 2024
@dcalhoun dcalhoun requested a review from justtwago January 26, 2024 18:29
Copy link
Contributor

@justtwago justtwago left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested the Classic editor on trunk, and could reproduce the crash when going offline with an opened editor. Tested it again, running this fix, and the crash did not occur. 🎉
Thank you for the quick fix, David! 🚀

@dcalhoun dcalhoun enabled auto-merge January 26, 2024 18:53
@dcalhoun dcalhoun disabled auto-merge January 26, 2024 19:20
@dcalhoun dcalhoun changed the base branch from trunk to release/24.0.2 January 26, 2024 19:29
A network connectivity subscriber was added to the post activity in: #19692

However, it was not scoped to only run in the Gutenberg editor. Because
no guard was in place, the subscriber attempted to invoke a non-existent
method on the Aztec editor, resulting in a crash.
@dcalhoun dcalhoun force-pushed the fix/prevent-gutenberg-connection-logic-crashing-aztec branch from ab18f0e to a931b5d Compare January 26, 2024 19:35
@dangermattic
Copy link
Collaborator

1 Warning
⚠️ This PR is assigned to the milestone 24.0. The due date for this milestone has already passed.
Please make sure to get it merged by then or assign it to a milestone with a later deadline.

Generated by 🚫 Danger

@dcalhoun dcalhoun merged commit d4a24a9 into release/24.0.2 Jan 26, 2024
21 checks passed
@dcalhoun dcalhoun deleted the fix/prevent-gutenberg-connection-logic-crashing-aztec branch January 26, 2024 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants