-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 unbounded growth of number media observers in Post Editor #21352
Conversation
@@ -154,9 +154,6 @@ class GutenbergMediaInserterHelper: NSObject { | |||
} | |||
|
|||
func syncUploads() { | |||
if mediaObserverReceipt != nil { |
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.
I think it meant to be mediaObserverReceipt == nil
.
Generated by 🚫 dangerJS |
📲 You can test the changes from this Pull Request in WordPress Alpha by scanning the QR code below to install the corresponding build.
|
📲 You can test the changes from this Pull Request in Jetpack Alpha by scanning the QR code below to install the corresponding build.
|
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.
Nice catch! Can you update the release notes to capture this change? Thanks!
I update them right before the merge to avoid merge conflicts 😅 |
0606531
to
ce6895d
Compare
I was working on #21190 and noticed that the media observer callback was getting called more times than expected:
It turned out, the longer you edit the post, the more media observers it adds. So, in my case, it was redrawing the image block 20 times instead of one 🫠
GutenbergMediaInserterHelper
registers the observer on init and removes it on deinit.To test:
Regression Notes
PR submission checklist:
RELEASE-NOTES.txt
if necessary.UI Changes testing checklist: