Skip to content

Failing backend test: copyPadWithoutHistory produces empty/wrong body for nested lists #7787

@JohnMcLear

Description

@JohnMcLear

Failing test: copyPadWithoutHistory > creates a new pad with the same content as the source pad and copyPadWithoutHistory > source and destination attribute pools are independent
File: src/tests/backend/specs/api/pad.ts:609-707
Status on develop HEAD (b96e262): failing — reproducible locally.

What the test does

Creates a source pad with ulHtml (nested ordered + unordered lists), calls copyPadWithoutHistory to clone it, then fetches the destination via getHTML and asserts the HTML round-trips.

What happens

Same <ol> start-attribute drift as #7786 (cross-reference): the destination pad's exported HTML drops start="2" from the inner nested <ol>:

+ actual:    <ol start="1" class="number"><li>item<ol class="number"><li>item1
- expected:  <ol start="1" class="number"><li>item<ol start="2" class="number"><li>item1

The earlier returns a successful response test (the same describe block) succeeds, so copyPadWithoutHistory does write something — but the resulting content doesn't round-trip cleanly through getHTML.

Likely shared root cause

Probably the same export-side bug as #7786. The copyPadWithoutHistory path serialises the source's atext into an HTML changeset via the import pipeline, then exports it back via the same nested-<ol> walker. Fixing #7786 (export-side start attribute propagation) probably fixes this too — worth verifying with the same fix.

Reproduction

NODE_ENV=production npx mocha --import=tsx --require ./tests/backend/diagnostics.ts \
    --timeout 60000 tests/backend/specs/api/pad.ts

Look under copyPadWithoutHistory.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions