Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

todo-widget: Add TODO for inbound/outbound data schema refactor.

Lauryn Menardfa36c7ffde1e
diff --git a/web/src/todo_widget.ts b/web/src/todo_widget.ts
index 8a65ead7c5c..47b118bedc3 100644
--- a/web/src/todo_widget.ts
+++ b/web/src/todo_widget.ts
@@ -30,6 +30,10 @@ const todo_widget_inbound_data = z.intersection(
z.record(z.string(), z.unknown()),
);
+// TODO: This schema is being used to parse two completely
+// different types of things (inbound and outbound data),
+// which should be refactored so that the code here is
+// clearer and less confusing.
const new_task_inbound_data_schema = z.object({
type: z.literal("new_task").optional(),
key: z.number().int().nonnegative().max(MAX_IDX),