Behaviour SwRS-MDOKFSTUDIO-REVIEW-004
A review comments file with any problem or over its limits is ignored with one warning
When any part of the review comments file of a shown document is not valid or goes over one of its limits, the extension SHALL read no thread from it, show one warning naming the file and the first problem once for each distinct content of the file, and refuse every change to it.
Another outcome at step 1 of path 1 in StRS-MDOKFSTUDIO-REVIEW-001, in the state “A document with a review comments file is shown”.
Part of StRS-MDOKFSTUDIO-REVIEW-003, outside the paths drawn on its map.
Scenarios 7
The situations the tests check; open one to read it.
refusalWrong shape of the file
| Input | Outcome |
|---|---|
| An empty file | Error "the sidecar is not valid JSON"; no thread is returned |
| A file that is not JSON | Error "the sidecar is not valid JSON"; no thread is returned |
| A JSON array | Error "the sidecar must be a JSON object"; no thread is returned |
| A file of version 2 | Error "unsupported sidecar version (expected 1)"; no thread is returned |
| A file without a document name | Error "the sidecar needs a document name"; no thread is returned |
| A file without a threads list | Error "the sidecar needs a threads array"; no thread is returned |
refusalOne bad thread rejects the whole file
Givena file with one valid thread and a second thread with an empty id, a non-boolean resolved flag, a non-string body, a creation date that is not an ISO 8601 date-time with a zone ("yesterday", "2026-13-45T99:00:00Z" or "2026-02-30T10:00:00Z", a day that does not exist in its month; 2024-02-29 is a real day, 2026-02-29 is not), no comment, a line of 0, an endLine before its line, or the id of an earlier thread
Whenthe file is read
Thenan error is reported, the whole file is rejected and the valid thread is not returned either
boundaryLimits of the file
| Input | Outcome |
|---|---|
| A text of exactly 2 MiB or less | Read |
| A text of more than 2 MiB | Error "the sidecar is larger than 2097152 bytes"; no thread is returned |
| A comments file on disk larger than 2 MiB | The host does not read the file but hands the parser a stub of the limit length plus one, so the same error appears |
| Exactly 1000 valid threads | No error; 1000 threads are returned |
| 1001 threads | Error; no thread is returned |
| A thread with exactly 200 comments | No error |
| A thread with 201 comments | Error; no thread is returned |
| A comment body of exactly 10 000 characters | No error |
| A comment body of 10 001 characters | Error; no thread is returned |
refusalFirst sight of an invalid file
Givena comments file that is not valid JSON
Whenits document is rendered
Thenthe warning "The review comments file {name} is not valid and is ignored: the sidecar is not valid JSON." is shown once and no thread is posted
boundarySame content again
Giventhe same invalid content read again on the next render
Whenthe threads are posted again
Thenno second warning appears; changed invalid content warns again
refusalChange while the file is not valid
Givena comments file holding {not json
Whena comment is saved
Thenthe page is told the comments file is not valid and is left untouched, and the file text is unchanged
nominalChange when the file is valid
Givena valid comments file
Whena comment is saved
Thenthe change is written