Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-LIFE-071

A render that cannot patch loads a new page document

When a render changes the page shell, for example a diagram engine or math appears or disappears, or cannot otherwise be applied to the loaded page as a content patch, the extension SHALL load a new page document instead of a content patch.

Another outcome at step 2 of path 1 in StRS-MDOKFSTUDIO-LIFE-005, in the state “A new render is done”.

Scenarios 7

The situations the tests check; open one to read it.

nominalShell change
InputOutcome
A ready page without math and a render that adds a formulaThe shell keys differ and the whole page is assigned
A page where Mermaid appears or disappearsThe shell keys differ and the whole page is assigned
A render that only changes textThe shell keys are equal, so the patch is used
boundaryContent bounds
InputOutcome
New content that holds a script element or a nonce attributeNo patch is planned and the whole page loads
A content container of 20 MiB plus one characterThe patch is refused, because MAX_PATCH_CONTENT_LENGTH is 20 MiB, and the whole page loads
boundaryStatus line bounds
InputOutcome
A render with 501 diagnosticsdiagnosticsFitPatch is false and the whole page loads
A render with exactly 500 short diagnosticsThe patch is used
A status line longer than 20000 charactersdiagnosticsFitPatch is false and the whole page loads
A severity longer than 50 charactersdiagnosticsFitPatch is false and the whole page loads
refusalAnother document, folders or startup setting
InputOutcome
A change of scrollPreviewWithEditor, scrollEditorWithPreview, markEditorSelection or stickyHeadingDepth, then the next render is shownThe runtime context key differs, so the page document is assigned again and the new value reaches the page in its boot context
The new render shows another document or source fileA new document is loaded the same way
The new render uses other resource foldersA new document is loaded the same way
A change of showComments, which the page follows through a messageThe context key is not affected and a patch stays possible
refusalPage not ready for the previous render
InputOutcome
A render shown while the page of the previous render has not reported ready, then a newer render finishesThe whole page is assigned
A patch posted and not yet acknowledged, then a newer render finishesA further patch is addressed to the identifiers the page will have, because pageHasStage accepts the patched request id
boundaryThe wait of 2 seconds for a patched page
InputOutcome
A posted patch and a page that never answers, 2000 ms passThe page document is assigned for the stage
A page that reports ready in timeThe page keeps its document
Three patches posted in a row and a ready report for the firstThe 2 second wait restarts for the newest stage
A ready report that names the newest stageThe timer is cleared and the document is kept
nominalPage created again by VS Code
Givena page patched several times whose webview is created again when the editor moves to another window
Whenthe new page reports ready with the identifiers of the last assignment, not those of the current render
Thenthe host recognizes it and assigns the current document again; a report with the identifiers of the current render triggers no reload

Implemented in 3

Tested by 2