From 84e9ad273ab1bc9c9c7bf52e2ab71227a9629eb9 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Wed, 23 Jun 2021 17:38:30 +0200 Subject: [PATCH] Document the use of data: Some(b"") for clearing data --- SEMANTICS.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SEMANTICS.md b/SEMANTICS.md index 53b8950e7e..5b4d10c38c 100644 --- a/SEMANTICS.md +++ b/SEMANTICS.md @@ -292,7 +292,9 @@ to the caller of `execute` (either the client or another transaction), just as if the original `execute` and returned `data: Some(b"better idea")`. If `reply` returns `data: None`, it will not modify any previously set data state. If there are multiple submessages all setting this, only the last one is used (they all -overwrite any previous `data` value). +overwrite any previous `data` value). As a consequence, you can use +`data: Some(b"")` to clear previously set data. This will be represented as a +JSON string instead of `null` and handled as any other `Some` value. #### Order and Rollback