Commit 5e49878
committed
feat(scheduler): marshal task properties as empty JSON not null
Task properties typing is problematic. Within SM server codebase,
they are json.RawMessage. When returned to sctool or apps using SM
client, they are interface{} which is carelessly cast to map[string]any.
The problem is that nil task properties can't be cast to map[string]any.
This results in unexpected errors and panics on sctool or apps using SM
client side. Within SM codebase, we also make those such assumptions
and sometimes ad-hoc replace nil properties with json.RawMessage("").
This commit doesn't fix anything on its own, but it makes it less
likely that sctool or app using SM client breaks in those silly
places by marshaling nil task properties as empty JSON object.1 parent f5302a5 commit 5e49878
1 file changed
Lines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
262 | | - | |
| 262 | + | |
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
| |||
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
271 | 283 | | |
272 | 284 | | |
273 | 285 | | |
| |||
0 commit comments