Skip to content

Comments

CMP-9545: Cache Storage API extra check for protocol #5516

Merged
eymar merged 2 commits intoJetBrains:masterfrom
Maxi937:master
Jan 20, 2026
Merged

CMP-9545: Cache Storage API extra check for protocol #5516
eymar merged 2 commits intoJetBrains:masterfrom
Maxi937:master

Conversation

@Maxi937
Copy link
Contributor

@Maxi937 Maxi937 commented Jan 16, 2026

Compose Multiplatform v1.10.0 introduced the use of the Cache Storage API to avoid repeat http requests for resources on Web (#5379).

In a VsCode Extension Environment, the protocol of a Web View Panel that gets used is "vscode-webview:". This does not work with the Cache Storage API and results in an error when trying to load any compose resources. This PR just ensures the protocol is http/https in order to use Cache Storage API on Web Target.

Fixes https://youtrack.jetbrains.com/issue/CMP-9545/ComposeResources-on-Web-not-loading-because-Cache-Storage-API-is-not-supported-everywhere

Testing

Describe how you tested your changes (provide a snippet or/and steps)

  • I ran my vscode extension with the change and without the change

without
image

with
image

  • I ran a regular browserDevelopmentRun to ensure caching still worked as expected
image

Release Notes

Fixes - Resources

Fixes an issue where web resources failed to load when calling the Cache Storage API with unsupported protocols (e.g., vscode-webview: in VS Code webviews).

@Maxi937 Maxi937 changed the title CMP-9545 - Cache Storage API extra check for protocol CMP-9545: Cache Storage API extra check for protocol Jan 16, 2026
@eymar eymar self-requested a review January 20, 2026 13:41

suspend fun load(path: String, onNoCacheHit: suspend (path: String) -> Response): Response {
if (!supportsCacheApi) return onNoCacheHit(path)
if (!supportsCacheApi) {
Copy link
Member

Choose a reason for hiding this comment

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

Hello! The change at this line seems to be unrelated to the fix. Could you please revert it here? This helps us when we use git history / git blame.

@eymar
Copy link
Member

eymar commented Jan 20, 2026

hey @Maxi937 ! I noticed that you closed the PR. Do you plan to re-open it?

@Maxi937 Maxi937 reopened this Jan 20, 2026
@Maxi937
Copy link
Contributor Author

Maxi937 commented Jan 20, 2026

Apologies @eymar, I reverted wrong so just nuked back to the original and added back my changes.

image

@eymar eymar merged commit 89f6aea into JetBrains:master Jan 20, 2026
1 check passed
Copy link
Member

@eymar eymar left a comment

Choose a reason for hiding this comment

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

Thank you for contribution!

eymar pushed a commit that referenced this pull request Jan 20, 2026
Compose Multiplatform v1.10.0 introduced the use of the Cache Storage
API to avoid repeat http requests for resources on Web
([#5379](#5379)).

In a VsCode Extension Environment, the protocol of a Web View Panel that
gets used is "vscode-webview:". This does not work with the Cache
Storage API and results in an error when trying to load any compose
resources. This PR just ensures the protocol is http/https in order to
use Cache Storage API on Web Target.

Fixes
https://youtrack.jetbrains.com/issue/CMP-9545/ComposeResources-on-Web-not-loading-because-Cache-Storage-API-is-not-supported-everywhere

## Testing
**Describe how you tested your changes (provide a snippet or/and
steps)**
- I ran my vscode extension with the change and without the change

**without**
<img width="1658" height="753" alt="image"
src="https://github.com/user-attachments/assets/367f5a41-4b0b-4262-9d38-3baca1ce0125"
/>

**with**
<img width="1658" height="885" alt="image"
src="https://github.com/user-attachments/assets/b06415df-1388-45c2-a439-21e604fc2e54"
/>

- I ran a regular browserDevelopmentRun to ensure caching still worked
as expected
<img width="1863" height="942" alt="image"
src="https://github.com/user-attachments/assets/54e7dd47-084c-4514-b79b-32f35577dc92"
/>

## Release Notes
### Fixes - Resources
Fixes an issue where web resources failed to load when calling the Cache
Storage API with unsupported protocols (e.g., vscode-webview: in VS Code
webviews).

(cherry picked from commit 89f6aea)
siarb added a commit that referenced this pull request Jan 20, 2026
Cherry pick from
#5516

Fixes

https://youtrack.jetbrains.com/issue/CMP-9545/ComposeResources-on-Web-not-loading-because-Cache-Storage-API-is-not-supported-everywhere

## Testing
This should be tested by QA

## Release Notes
### Fixes - Resources
Fixes an issue where web resources failed to load when calling the Cache
Storage API with unsupported protocols (e.g., vscode-webview: in VS Code
webviews).
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