You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Found while conformance-testing exported archives against the BCF-XML 3.0 schemas (release_3_0). All three verified in the published bundle of @thatopen/[email protected] (dist/index.mjs); line refs below are from that file.
1. Extensions written as bcf.extensions — spec requires extensions.xml
export() writes zip.file("bcf.extensions", this.serializeExtensions()) (~line 19528). BCF 3.0 requires the file to be named extensions.xml at archive root (an empty <Extensions/> is valid). Strict readers that resolve the required file by name will not find it.
2. bcf.version VersionId serialized as "3" — spec examples use "3.0"
The template writes VersionId="${this.config.version}" with the BCFVersion type value "3". The official 3.0 test files and documentation use VersionId="3.0". Clients doing exact-match version detection mis-detect the archive.
3. Topic children serialized as CreationAuthor before CreationDate — xs:sequence violation
Topic.serialize() builds the element list from an object literal with CreationAuthor before CreationDate (~lines 19042-19043). markup.xsd defines the Topic child order as xs:sequence (… Labels, CreationDate, CreationAuthor, ModifiedDate …), so schema-validating consumers reject the markup. This is the deviation most likely to break real interop.
All three confirmed and fixed in a7958045, shipping in the next release. Excellent report, the line refs into the published bundle made this quick.
bcf.extensions is now written as extensions.xml at the archive root, and VersionId is now "3.0". While in there I also noticed bcf.version was pointing its noNamespaceSchemaLocation at release_3_0 even when exporting 2.1, so that follows the version now too.
You were right that the Topic ordering was the one most likely to break real interop, and it turned out to be worse than the one field you spotted. Checked against the xs:sequence in markup.xsd, Priority and Labels also belong before CreationDate, Stage before Description, and Comments before Viewpoints. So rather than swap the two fields, I put the whole thing in schema order. 2.1 shares the same sequence for the elements we write, and it was doubly broken there: Labels and DocumentReference were being appended to the object after construction, which pushed them to the end of the output.
One thing worth flagging for anyone reading this later. Both of the first two fixes would have broken our own importer, which looked the extensions file up by .extensions and required VersionId to be exactly "2.1" or "3". It now accepts extensions.xml alongside the legacy name and treats "3.0" and "3" as the same, so archives exported by older versions of the library still load.
Verified end to end: the archive carries extensions.xml and no bcf.extensions, declares VersionId="3.0", emits Topic's children in schema sequence, and still round-trips through our own importer.
Thanks for the offer of a PR, and for doing the conformance testing in the first place. That's exactly the kind of thing we don't catch on our own.
Activity
agviegas commentedon Jul 14, 2026
All three confirmed and fixed in
a7958045, shipping in the next release. Excellent report, the line refs into the published bundle made this quick.bcf.extensionsis now written asextensions.xmlat the archive root, andVersionIdis now"3.0". While in there I also noticedbcf.versionwas pointing itsnoNamespaceSchemaLocationatrelease_3_0even when exporting 2.1, so that follows the version now too.You were right that the
Topicordering was the one most likely to break real interop, and it turned out to be worse than the one field you spotted. Checked against thexs:sequenceinmarkup.xsd,PriorityandLabelsalso belong beforeCreationDate,StagebeforeDescription, andCommentsbeforeViewpoints. So rather than swap the two fields, I put the whole thing in schema order. 2.1 shares the same sequence for the elements we write, and it was doubly broken there:LabelsandDocumentReferencewere being appended to the object after construction, which pushed them to the end of the output.One thing worth flagging for anyone reading this later. Both of the first two fixes would have broken our own importer, which looked the extensions file up by
.extensionsand requiredVersionIdto be exactly"2.1"or"3". It now acceptsextensions.xmlalongside the legacy name and treats"3.0"and"3"as the same, so archives exported by older versions of the library still load.Verified end to end: the archive carries
extensions.xmland nobcf.extensions, declaresVersionId="3.0", emitsTopic's children in schema sequence, and still round-trips through our own importer.Thanks for the offer of a PR, and for doing the conformance testing in the first place. That's exactly the kind of thing we don't catch on our own.
fix(bcf): conform to the BCF-XML schemas on export (#760)