server_events_dispatch: Throw blueslip if update_dict without prop.

This commit is contained in:
YashRE42 2020-10-15 11:51:21 +00:00 committed by Tim Abbott
parent e3b6cc61f3
commit 195b1b28ee
2 changed files with 9 additions and 0 deletions

View File

@ -882,4 +882,10 @@ run_test("server_event_dispatch_op_errors", () => {
server_events_dispatch.dispatch_normal_event({type: "subscription", op: "other"});
blueslip.expect("error", "Unexpected event type reaction/other");
server_events_dispatch.dispatch_normal_event({type: "reaction", op: "other"});
blueslip.expect("error", "Unexpected event type realm/update_dict/other");
server_events_dispatch.dispatch_normal_event({
type: "realm",
op: "update_dict",
property: "other",
});
});

View File

@ -261,6 +261,9 @@ export function dispatch_normal_event(event) {
page_params.realm_night_logo_source = event.data.night_logo_source;
realm_logo.rerender();
break;
default:
blueslip.error("Unexpected event type realm/update_dict/" + event.property);
break;
}
} else if (event.op === "deactivated") {
// This handler is likely unnecessary, in that if we