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
| Input | Outcome |
|---|---|
| A ready page without math and a render that adds a formula | The shell keys differ and the whole page is assigned |
| A page where Mermaid appears or disappears | The shell keys differ and the whole page is assigned |
| A render that only changes text | The shell keys are equal, so the patch is used |
boundaryContent bounds
| Input | Outcome |
|---|---|
| New content that holds a script element or a nonce attribute | No patch is planned and the whole page loads |
| A content container of 20 MiB plus one character | The patch is refused, because MAX_PATCH_CONTENT_LENGTH is 20 MiB, and the whole page loads |
boundaryStatus line bounds
| Input | Outcome |
|---|---|
| A render with 501 diagnostics | diagnosticsFitPatch is false and the whole page loads |
| A render with exactly 500 short diagnostics | The patch is used |
| A status line longer than 20000 characters | diagnosticsFitPatch is false and the whole page loads |
| A severity longer than 50 characters | diagnosticsFitPatch is false and the whole page loads |
refusalAnother document, folders or startup setting
| Input | Outcome |
|---|---|
| A change of scrollPreviewWithEditor, scrollEditorWithPreview, markEditorSelection or stickyHeadingDepth, then the next render is shown | The 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 file | A new document is loaded the same way |
| The new render uses other resource folders | A new document is loaded the same way |
| A change of showComments, which the page follows through a message | The context key is not affected and a patch stays possible |
refusalPage not ready for the previous render
| Input | Outcome |
|---|---|
| A render shown while the page of the previous render has not reported ready, then a newer render finishes | The whole page is assigned |
| A patch posted and not yet acknowledged, then a newer render finishes | A 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
| Input | Outcome |
|---|---|
| A posted patch and a page that never answers, 2000 ms pass | The page document is assigned for the stage |
| A page that reports ready in time | The page keeps its document |
| Three patches posted in a row and a ready report for the first | The 2 second wait restarts for the newest stage |
| A ready report that names the newest stage | The 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