Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
server_events_dispatch: Throw blueslip from typing based on event.op.
YashRE42abd959cf6a77
diff --git a/frontend_tests/node_tests/dispatch.js b/frontend_tests/node_tests/dispatch.jsindex 74fdfa9951b..1bb729e460d 100644--- a/frontend_tests/node_tests/dispatch.js+++ b/frontend_tests/node_tests/dispatch.js@@ -877,7 +877,7 @@ run_test("realm_export", (override) => {assert.equal(args.exports, event.exports);});-run_test("server_event_dispatch_op_errors", () => {+run_test("server_event_dispatch_op_errors", (override) => {blueslip.expect("error", "Unexpected event type subscription/other");server_events_dispatch.dispatch_normal_event({type: "subscription", op: "other"});blueslip.expect("error", "Unexpected event type reaction/other");@@ -896,4 +896,13 @@ run_test("server_event_dispatch_op_errors", () => {server_events_dispatch.dispatch_normal_event({type: "realm_user", op: "other"});blueslip.expect("error", "Unexpected event type stream/other");server_events_dispatch.dispatch_normal_event({type: "stream", op: "other"});+ blueslip.expect("error", "Unexpected event type typing/other");+ server_events_dispatch.dispatch_normal_event({+ type: "typing",+ sender: {user_id: 5},+ op: "other",+ });+ override(settings_user_groups, "reload", noop);+ blueslip.expect("error", "Unexpected event type user_group/other");+ server_events_dispatch.dispatch_normal_event({type: "user_group", op: "other"});});diff --git a/static/js/server_events_dispatch.js b/static/js/server_events_dispatch.jsindex 71c1bf40ca2..621e1890f38 100644--- a/static/js/server_events_dispatch.js+++ b/static/js/server_events_dispatch.js@@ -528,6 +528,9 @@ export function dispatch_normal_event(event) {case "stop":typing_events.hide_notification(event);break;+ default:+ blueslip.error("Unexpected event type typing/" + event.op);+ break;}break;@@ -665,6 +668,9 @@ export function dispatch_normal_event(event) {case "update":user_groups.update(event);break;+ default:+ blueslip.error("Unexpected event type user_group/" + event.op);+ break;}settings_user_groups.reload();break;