chat: virtualize message-to-json conversion

Bad `@t` text might crash and fully halt the json conversion, preventing any
data from being delivered to the frontend.

Fixes #2878.
This commit is contained in:
Fang 2020-05-08 19:50:31 +02:00 committed by GitHub
parent 69b6495d3d
commit 7152cb74a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,9 +41,16 @@
(fall ((ot output+(ar dank) ~) a) ~)
::
++ lett
=, enjs:format
|= =letter
^- json
=, enjs:format
=; result=(each json tang)
?- -.result
%& p.result
%| (frond %text s+'[[json rendering error]]')
==
%- mule
|.
?- -.letter
%text
(frond %text s+text.letter)