server_events_dispatch: Throw blueslip if wrong op in realm_bot case.

This commit is contained in:
YashRE42
2020-10-15 12:11:54 +00:00
committed by Tim Abbott
parent d50bc7441a
commit 4ffdfb5f00
2 changed files with 5 additions and 0 deletions

View File

@@ -888,4 +888,6 @@ run_test("server_event_dispatch_op_errors", () => {
op: "update_dict", op: "update_dict",
property: "other", property: "other",
}); });
blueslip.expect("error", "Unexpected event type realm_bot/other");
server_events_dispatch.dispatch_normal_event({type: "realm_bot", op: "other"});
}); });

View File

@@ -316,6 +316,9 @@ export function dispatch_normal_event(event) {
settings_bots.eventually_render_bots(); settings_bots.eventually_render_bots();
settings_users.update_bot_data(event.bot.user_id); settings_users.update_bot_data(event.bot.user_id);
break; break;
default:
blueslip.error("Unexpected event type realm_bot/" + event.op);
break;
} }
break; break;
case "realm_emoji": case "realm_emoji":