embedded bots: Dispatch all config data on update event.

Previously, when a user updated the config data of an
embedded bot, only the updated fields were dispatched
back to the client. Dispatching all config data fields
makes the client updating code less brittle.
This commit is contained in:
Robert Hönig
2018-03-04 14:34:58 -05:00
committed by Tim Abbott
parent e15a22dae2
commit 4c7dd971d0

View File

@@ -4443,11 +4443,12 @@ def do_update_bot_config_data(bot_profile: UserProfile,
config_data: Dict[Text, Text]) -> None: config_data: Dict[Text, Text]) -> None:
for key, value in config_data.items(): for key, value in config_data.items():
set_bot_config(bot_profile, key, value) set_bot_config(bot_profile, key, value)
updated_config_data = get_bot_config(bot_profile)
send_event(dict(type='realm_bot', send_event(dict(type='realm_bot',
op='update', op='update',
bot=dict(email=bot_profile.email, bot=dict(email=bot_profile.email,
user_id=bot_profile.id, user_id=bot_profile.id,
services = [dict(config_data=config_data)], services = [dict(config_data=updated_config_data)],
), ),
), ),
bot_owner_user_ids(bot_profile)) bot_owner_user_ids(bot_profile))