From d8c6311e33b6ad0b23b2c04e83839eb4f636160e Mon Sep 17 00:00:00 2001 From: Junyao Chen Date: Tue, 15 Aug 2023 23:07:56 -0400 Subject: [PATCH] bot_data: Eliminate owner field. `owner` is a legacy key in one of bot data field. We would like to remove this field as it's not used in the codebase. `owner_id` is the identifier to find the owner of a bot. CZO discussion: https://chat.zulip.org/#narrow/stream/6-frontend/topic/Can.20we.20mark.20.60owner.60.20field.20in.20bot.20data.20optional.3F/near/1625968 --- web/src/bot_data.ts | 1 - web/tests/bot_data.test.js | 5 ----- 2 files changed, 6 deletions(-) diff --git a/web/src/bot_data.ts b/web/src/bot_data.ts index f9a3b64591..3fceb5a8bf 100644 --- a/web/src/bot_data.ts +++ b/web/src/bot_data.ts @@ -26,7 +26,6 @@ const basic_bot_schema = z.object({ email: z.string(), full_name: z.string(), is_active: z.boolean(), - owner: z.union([z.string(), z.undefined()]), owner_id: z.number(), user_id: z.number(), }); diff --git a/web/tests/bot_data.test.js b/web/tests/bot_data.test.js index 4b066fe853..0a1035f992 100644 --- a/web/tests/bot_data.test.js +++ b/web/tests/bot_data.test.js @@ -37,7 +37,6 @@ const bot_data_params = { email: "bot0@zulip.com", full_name: "Bot 0", is_active: true, - owner: "someone 4", owner_id: 4, user_id: 42, services: [], @@ -53,7 +52,6 @@ const bot_data_params = { email: "outgoingwebhook@zulip.com", full_name: "Outgoing webhook", is_active: true, - owner: "someone 5", owner_id: 5, user_id: 314, services: [{base_url: "http://foo.com", interface: 1, token: "basictoken12345"}], @@ -86,7 +84,6 @@ test("test_basics", () => { email: "bot1@zulip.com", full_name: "Bot 1", is_active: true, - owner: "someone 6", owner_id: 6, user_id: 43, services: [ @@ -108,7 +105,6 @@ test("test_basics", () => { email: "embedded-bot@zulip.com", full_name: "Embedded bot 1", is_active: true, - owner: "cordelia@zulip.com", owner_id: 7, user_id: 143, services: [ @@ -133,7 +129,6 @@ test("test_basics", () => { assert.equal("bot1@zulip.com", bot.email); assert.equal("Bot 1", bot.full_name); assert.equal(true, bot.is_active); - assert.equal("someone 6", bot.owner); assert.equal(6, bot.owner_id); assert.equal(43, bot.user_id); assert.equal("http://bar.com", services[0].base_url);