Skip to content

Conversation

@dcalhoun
Copy link
Member

What?

Ensures that EditorAssetBundleProvider always calls the replyHandler when handling JavaScript message requests, even when an error occurs.

Why?

When getEditorRepresentation() throws an error, the replyHandler was not being called. This would leave JavaScript waiting indefinitely for a response that never comes, potentially causing the editor to hang or behave unexpectedly.

How?

Added the missing replyHandler(nil, error.localizedDescription) call in the catch block of userContentController(_:didReceive:replyHandler:).

Testing Instructions

No specific reproduction steps are known. This fix was identified during code review.

Accessibility Testing Instructions

N/A - This is an internal fix with no UI changes.

Screenshots or screencast

N/A

Avoid indefinite hangs for the JavaScript runtime.
@dcalhoun dcalhoun added the [Type] Code Quality Issues or PRs that relate to code quality label Jan 26, 2026
replyHandler(reply, nil)
} catch {
Logger.assetLibrary.error("📚 Failed to fetch asset manifest: \(error.localizedDescription)")
replyHandler(nil, error.localizedDescription)
Copy link
Member Author

Choose a reason for hiding this comment

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

This absence did not create an observed issue, but it seems like we should invoke replyHandler here.

@dcalhoun dcalhoun marked this pull request as ready for review January 26, 2026 23:54
@dcalhoun dcalhoun requested a review from jkmassel January 26, 2026 23:55
@dcalhoun
Copy link
Member Author

Noticed a Sentry report. It could be unrelated, but this might fix it: JETPACK-IOS-1JEE

Copy link
Contributor

@jkmassel jkmassel left a comment

Choose a reason for hiding this comment

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

Oof nice fix, thanks for dealing with it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Code Quality Issues or PRs that relate to code quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants