Skip to content

fix(bbb-export-annotations): set xml:space through the XML namespace - #25923

Merged
antobinary merged 1 commit into
bigbluebutton:v3.0.x-developfrom
antobinary:fix-export-text-xml-space-30
Oct 1, 2026
Merged

antobinary merged 1 commit into
bigbluebutton:v3.0.x-developfrom
antobinary:fix-export-text-xml-space-30

Conversation

@antobinary

Copy link
Copy Markdown
Member

What

On v3.0.x-develop, exporting a presentation that has a text annotation crashes the export service. The process worker dies with an uncaught

Error: Invalid State Error
    at ensureXMLSerializableName (svgdom/src/utils/tagUtils.js)

the service exits and is restarted by systemd, and the job is lost: the "Sending to chat" toast stays on "Extracting slide N of N..." and no download link reaches the chat.

Why

#25857 bumped svgdom from 0.1.20 to 0.1.29. The new version refuses to serialize an attribute whose local name contains a colon, which is what a namespace-unaware setAttribute creates. TextShape set xml:space that way.

No release contains the bump yet. 4.0 is still on svgdom 0.1.20 and is not affected today, but has the same line.

Fix

Pass the XML namespace so svg.js uses setAttributeNS:

-        .attr({'xml:space': 'preserve'})
+        .attr('xml:space', 'preserve', XML_NAMESPACE)

The serialized element is unchanged (<text ... xml:space="preserve">) on both svgdom 0.1.20 and 0.1.29.

Testing

Found through the "Exported text annotations do not overlap" test added in #25917, which times out in CI waiting for the download link.

On a 3.0 server with the dependencies from v3.0.x-develop installed in bbb-export-annotations:

Export service Result
without this change FAIL - same timeout as CI, Invalid State Error and service restart in the journal
with this change PASS - export completes, test passes 4 of 4 runs

This PR's CI does not cover the change; the test is in #25917, which should pass once this is merged.

🤖 Generated with Claude Code

Exporting a presentation that carries a text annotation crashes the
export service on v3.0.x-develop since svgdom was bumped from 0.1.20 to
0.1.29 (bigbluebutton#25857). The process worker dies with an uncaught

    Error: Invalid State Error
        at ensureXMLSerializableName (svgdom/src/utils/tagUtils.js)

the service exits and is restarted by systemd, and the job is lost: the
"Sending to chat" toast stays on "Extracting slide N of N..." and no
download link ever reaches the chat.

svgdom 0.1.29 refuses to serialize an attribute whose local name
contains a colon, which is what a namespace-unaware setAttribute
creates. TextShape set xml:space that way. Pass the XML namespace so
svg.js uses setAttributeNS and the attribute gets the xml prefix with
the local name "space".

The serialized element is unchanged (<text ... xml:space="preserve">)
on both svgdom 0.1.20 and 0.1.29, so the rendered text is the same.

Found through the "Exported text annotations do not overlap" test added
by the bigbluebutton#25722 backport (bigbluebutton#25917), which times out in CI on the missing
download link. With develop's dependencies installed on a 3.0 server
the test reproduces that timeout and the crash above; with this change
the export completes and the test passes (4 of 4 runs).
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

✅ Automated tests have passed!

@antobinary
antobinary merged commit d53aee4 into bigbluebutton:v3.0.x-develop Oct 1, 2026
32 checks passed
@antobinary
antobinary deleted the fix-export-text-xml-space-30 branch October 1, 2026 23:48
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.

1 participant