Skip to content

Suggestions#302

Merged
dcalhoun merged 2 commits intofix/mitigate-crash-from-unsafe-assetsfrom
suggestions/301
Jan 28, 2026
Merged

Suggestions#302
dcalhoun merged 2 commits intofix/mitigate-crash-from-unsafe-assetsfrom
suggestions/301

Conversation

@jkmassel
Copy link
Contributor

@jkmassel jkmassel commented Jan 27, 2026

I had a bunch of suggestions for #301, so consider this a very large "suggest" review block.

Namely:

  1. Fetching anything from the remote should be done by an EditorHttpClient because it'll automatically deal with stuff like "make sure there's an auth header included for private sites".
  2. Now that we're doing IO, the EditorAssetBundleProvider needs synchronization, so it's all @MainActor now. This means we don't need to do log coalescing (or locking) because it's all on the main thread. This also removes concurrency warnings.

I tested this against jetpack.wpmt.co using the demo app and it still works ok.

@jkmassel jkmassel requested a review from dcalhoun January 27, 2026 23:23
Copy link
Member

@dcalhoun dcalhoun left a comment

Choose a reason for hiding this comment

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

Works well in my testing. Thank you for sharing these suggestions. Very helpful for me. I learned valuable iOS practices.

}
task.resume()

self.runningTasks.append(taskHandle)
Copy link
Member

Choose a reason for hiding this comment

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

I perceive these are never removed/emptied. Is there a memory leak concern? Should we concern ourselves with cleaning these up at some point or is the risk negligible?

@dcalhoun dcalhoun merged commit f706cb9 into fix/mitigate-crash-from-unsafe-assets Jan 28, 2026
@dcalhoun dcalhoun deleted the suggestions/301 branch January 28, 2026 15:31
dcalhoun added a commit that referenced this pull request Jan 29, 2026
* fix: Mitigate crashes from unsafe assets

Check for valid asset paths before attempting to access them.

* fix: Fetch remote site asset when local cache is unavailable

Ensure assets not cached locally still load in the editor. E.g., we do
not download and cache images loaded within CSS files.

* Suggestions (#302)

* Suggestions

* docs: Fix inline comment typo

---------

Co-authored-by: David Calhoun <github@davidcalhoun.me>

---------

Co-authored-by: Jeremy Massel <1123407+jkmassel@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants