Self-hosted diagrams.net URLs never match the embed — settings key mismatch
Is there an existing issue for this?
- I have searched the existing issues
This is not related to configuring Outline
- The issue is not related to self-hosting config
This is a code-level key mismatch, not a configuration problem: the settings screen writes one key shape and the embed matcher reads another, so a correctly configured value can never be used.
Current Behavior
With a self-hosted diagrams.net instance configured under Settings → Integrations → Diagrams.net,
pasting a URL from that instance into a document shows "Embed · not supported" (disabled) in the
paste menu. Only viewer.diagrams.net URLs are recognized.
Expected Behavior
A URL from the configured self-hosted instance should be offered as an embed, the same way
viewer.diagrams.net URLs are.
Steps To Reproduce
- Settings → Integrations → Diagrams.net → set installation URL to e.g.
https://drawio.example.com/ - Open any document, paste
https://drawio.example.com/?lightbox=1#R<compressed-xml>on its own line - The paste menu shows "Embed · not supported"; pasting
https://viewer.diagrams.net/?lightbox=1#R<...>in the same document offers "Embed" normally
Root cause
The settings screen stores the URL nested under the service name:
// plugins/diagrams/client/Settings.tsx
await integrations.save({
service: IntegrationService.Diagrams,
settings: {
diagrams: { url: data.url.replace(/\/?$/, "/") },
},
});useEmbeds assigns those settings to the descriptor verbatim:
// app/hooks/useEmbeds.ts
if (integration?.settings) {
e.settings = integration.settings; // => { diagrams: { url } }
}but the matcher reads a flat url:
// shared/editor/embeds/index.tsx
matcher(url) {
const settingsDomainRegex = this.settings?.url // always undefined
? urlRegex(this.settings?.url)
: undefined;
...
}So settingsDomainRegex is never built and only the built-in
/^https:\/\/viewer\.diagrams\.net\/(?!proxy).*/ regex remains.
I verified this against a live instance: rewriting the stored settings to the flat shape
({"url": "https://drawio.example.com/"}) via integrations.update did not help either, which
suggests a second factor — useEmbeds(loadIfMissing = false) means the document editor never fetches
embed integrations, so the settings may not reach the descriptor at all in that view. I could not
confirm the second part conclusively; the key mismatch above is unambiguous from the source.
Suggested fix
Make the two sides agree — either
// shared/editor/embeds/index.tsx
const settingsDomainRegex = this.settings?.diagrams?.url ? urlRegex(this.settings.diagrams.url) : undefined;or store the flat shape in plugins/diagrams/client/Settings.tsx.
Environment
- Version: 1.9.2 (self-hosted); the same code is present on
mainas of 2026-08 - Browser: Chrome
Source: outline/outline