mirror of https://github.com/zulip/zulip.git
settings_bots: Explicitly ignore delete event from live updates.
This commit is contained in:
parent
58b612a4f0
commit
fba2708bbc
|
@ -74,6 +74,7 @@ set_global('current_msg_list', {rerender: noop});
|
|||
|
||||
// We use blueslip to print the traceback
|
||||
set_global('blueslip', {
|
||||
info: noop,
|
||||
error: function (msg, more_info, stack) {
|
||||
console.log("\nFailed to process an event:\n", more_info.event, "\n");
|
||||
const error = new Error();
|
||||
|
@ -1067,17 +1068,8 @@ with_overrides(function (override) {
|
|||
});
|
||||
|
||||
event = event_fixtures.realm_bot__delete;
|
||||
global.with_stub(function (bot_stub) {
|
||||
global.with_stub(function (admin_stub) {
|
||||
override('bot_data.del', bot_stub.f);
|
||||
override('settings_users.update_bot_data', admin_stub.f);
|
||||
dispatch(event);
|
||||
const args = bot_stub.get_args('bot_id');
|
||||
assert_same(args.bot_id, event.bot.user_id);
|
||||
|
||||
admin_stub.get_args('update_user_id', 'update_bot_data');
|
||||
});
|
||||
});
|
||||
// We don't handle live updates for delete events, this is a noop.
|
||||
dispatch(event);
|
||||
|
||||
event = event_fixtures.realm_bot__update;
|
||||
global.with_stub(function (bot_stub) {
|
||||
|
|
|
@ -191,7 +191,8 @@ exports.dispatch_normal_event = function dispatch_normal_event(event) {
|
|||
bot_data.deactivate(event.bot.user_id);
|
||||
event.bot.is_active = false;
|
||||
} else if (event.op === 'delete') {
|
||||
bot_data.del(event.bot.user_id);
|
||||
blueslip.info("ignoring bot deletion for live UI update");
|
||||
break;
|
||||
} else if (event.op === 'update') {
|
||||
bot_data.update(event.bot.user_id, event.bot);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue