fix(app): set lone-surrogate texts aside or refuse them with a message (L1)
A draft the core refuses as lone_surrogate is unreadable content: it
goes to osteo:quarantine:draft verbatim with the existing notice. An
import is refused as ImportError('lone_surrogate') with the owner's
wording (home.import.error_lone_surrogate, FR/EN), the file untouched.
The publish gate reads the kind as invalid_shape. Tests on the real
core: quarantine keeps the exact text, an editor action leaves the
report as it was, normal text with pairs and literal backslashes reads
unchanged.
This commit is contained in:
1 parent
20d03cf7fd
commit
da8a0370cb
12 files changed
+151
-11
No files matched your search
@@ -4,7 +4,7 @@
|
||||
* then `importAttachment`, the core's layered read and rebase on the loaded
|
||||
* sheet): the migration alert (degraded headline, then the count), the three
|
||||
* ImportError kinds plus the generic error mapped to the FR messages, and the
|
||||
* navigation to /editor on success.
|
||||
* navigation to /editor on success; `lone_surrogate` (L1) has its own message.
|
||||
*/
|
||||
import {
|
||||
describe,
|
||||
@@ -171,6 +171,11 @@ describe('HomeRoute import: error paths', () => {
|
||||
new ImportError('no_attachment'),
|
||||
fr['home.import.error_no_attachment']!,
|
||||
],
|
||||
[
|
||||
'lone_surrogate → malformed text message, file untouched',
|
||||
new ImportError('lone_surrogate'),
|
||||
fr['home.import.error_lone_surrogate']!,
|
||||
],
|
||||
[
|
||||
'generic Error → generic message',
|
||||
new Error('disk on fire'),
|
||||
|
||||
Reference in new issue
Block a user