Keep asset:// as the only user-visible and persisted asset reference in editor flows#34
Closed
Keep asset:// as the only user-visible and persisted asset reference in editor flows#34
asset:// as the only user-visible and persisted asset reference in editor flows#34Conversation
Co-authored-by: erseco <1876752+erseco@users.noreply.github.com> Agent-Logs-Url: https://github.com/ateeducacion/exelearning/sessions/5e9ed5fc-eda8-4d78-a513-52c712226203
Copilot
AI
changed the title
[WIP] Fix exposure of blob URLs to users
Keep Mar 24, 2026
asset:// as the only user-visible and persisted asset reference in editor flows
Co-authored-by: erseco <1876752+erseco@users.noreply.github.com> Agent-Logs-Url: https://github.com/ateeducacion/exelearning/sessions/78181992-5256-440b-9611-bedd402a53b0
Co-authored-by: erseco <1876752+erseco@users.noreply.github.com> Agent-Logs-Url: https://github.com/ateeducacion/exelearning/sessions/78181992-5256-440b-9611-bedd402a53b0
Co-authored-by: erseco <1876752+erseco@users.noreply.github.com> Agent-Logs-Url: https://github.com/ateeducacion/exelearning/sessions/c0899424-193e-40ec-b9d2-426f0e814e68
Co-authored-by: erseco <1876752+erseco@users.noreply.github.com> Agent-Logs-Url: https://github.com/ateeducacion/exelearning/sessions/c0899424-193e-40ec-b9d2-426f0e814e68
Co-authored-by: erseco <1876752+erseco@users.noreply.github.com> Agent-Logs-Url: https://github.com/ateeducacion/exelearning/sessions/f7fbb101-6107-44c0-886f-88cbc57af6d8
Co-authored-by: erseco <1876752+erseco@users.noreply.github.com> Agent-Logs-Url: https://github.com/ateeducacion/exelearning/sessions/f7fbb101-6107-44c0-886f-88cbc57af6d8
Co-authored-by: erseco <1876752+erseco@users.noreply.github.com> Agent-Logs-Url: https://github.com/ateeducacion/exelearning/sessions/f7fbb101-6107-44c0-886f-88cbc57af6d8
Co-authored-by: erseco <1876752+erseco@users.noreply.github.com> Agent-Logs-Url: https://github.com/ateeducacion/exelearning/sessions/f7fbb101-6107-44c0-886f-88cbc57af6d8
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
asset://failures in edit modeasset://before runtime resolutionsetContent()input is converted to runtime URLs before the browser parses it, whilegetContent()still returns canonicalasset://asset://HTML is not eagerly loaded thereBeforeSetContentasset resolution and text iDevice wrapper handling withasset://contentmake fix,make bundle, andmake test-frontendOriginal prompt
This section details on the original issue you should resolve
<issue_title>Do not expose blob: URLs to users; keep asset:// as the only user-visible and persisted asset reference exelearning#1598</issue_title>
<issue_description>### Summary
Users should never see or copy
blob:URLs inside eXeLearning editors or HTML source views.blob:URLs are browser-temporary runtime URLs. They are not stable project references, they are not portable, and users can mistakenly copy them into their content thinking they are the real asset path.The editor should expose only
asset://...references to users and internally translate them to temporaryblob:URLs only when needed for rendering or preview.Problem
At the moment, users can end up seeing
blob:URLs such as:This is misleading because:
blob:URLs are temporary and browser/session-specific.From a user perspective, the only meaningful reference should be something stable and project-aware, for example:
or, in a friendlier future form:
with the application internally resolving that to the current asset UUID and to a runtime
blob:URL when rendering.Current architecture context
The current codebase already seems aligned with this direction:
asset://...URLs as the content-addressable reference format.AssetManageralso documents that assets are referenced withasset://URLs in HTML.URL.createObjectURL(...).That means this issue is less about changing the storage model and more about enforcing a stricter boundary between:
asset://...blob:...Proposal
Phase 1: low-risk fix
Ensure that users never see
blob:URLs in editable content.Concretely:
Do not write
blob:URLs into the persisted HTML/Yjs contentasset://...URL.Do not show
blob:URLs in source/code editing dialogsasset://...references.Do not insert
blob:URLs when using media/file pickersasset://...directly into the editor model.blob:only in the rendering layer.Add a defensive cleanup step on paste/import/save
blob:references in HTML.asset://....Phase 2: optional usability improvement
Introduce a friendlier alias format for display, while keeping the UUID-based model internally:
Possible behavior:
asset://folder/image.jpgThis would be more understandable for non-technical users than a raw UUID.
Suggested implementation approach
A simple implementation path could be:
A. Enforce canonicalization in one place
Create a single utility responsible for normalizing asset references in HTML:
asset://...referencesThis utility could:
blob:URLs using the existing reverse blob cache / asset metadataasset://...referenceshttp:,https:,data:, anchors, etc.blob:referencesThis avoids scattering the logic across multiple editors.
B. Apply normalization at the boundary points
Use that normalization in these moments:
C. Keep runtime translation separate
Rendering layers can still resolve
asset://...toblob:internally for preview, iframe rendering, or local display.That preserves the current runtime behavior while making the persisted/user-facing format predictable.
Why this is a good fit for the current design
This proposal works well with the current architecture because the project alre...
📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.