From 87551222e688b0daa4a45447a99b1069518bd25d Mon Sep 17 00:00:00 2001 From: Dawntraoz Date: Fri, 3 Jan 2025 10:17:10 +0100 Subject: [PATCH] refactor: remove debounce from the new userContextMessage --- .../GetUserContextMessage.test.ts | 1 - .../pluginToContainerMessage/GetUserContextMessage.ts | 8 +------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/packages/field-plugin/src/messaging/pluginMessage/pluginToContainerMessage/GetUserContextMessage.test.ts b/packages/field-plugin/src/messaging/pluginMessage/pluginToContainerMessage/GetUserContextMessage.test.ts index 7c9e85dd..d6b039d2 100644 --- a/packages/field-plugin/src/messaging/pluginMessage/pluginToContainerMessage/GetUserContextMessage.test.ts +++ b/packages/field-plugin/src/messaging/pluginMessage/pluginToContainerMessage/GetUserContextMessage.test.ts @@ -10,7 +10,6 @@ const callbackId = 'test-callback-id' const stub: GetUserContextMessage = { action: 'plugin-changed', event: 'getUserContext', - debounce: false, uid, callbackId, } diff --git a/packages/field-plugin/src/messaging/pluginMessage/pluginToContainerMessage/GetUserContextMessage.ts b/packages/field-plugin/src/messaging/pluginMessage/pluginToContainerMessage/GetUserContextMessage.ts index d892d189..8fb18e7c 100644 --- a/packages/field-plugin/src/messaging/pluginMessage/pluginToContainerMessage/GetUserContextMessage.ts +++ b/packages/field-plugin/src/messaging/pluginMessage/pluginToContainerMessage/GetUserContextMessage.ts @@ -1,11 +1,6 @@ import { isMessageToContainer, MessageToContainer } from './MessageToContainer' -export type GetUserContextMessage = MessageToContainer<'getUserContext'> & { - // Previously, debounced message was the default behavior. - // That debouncing implementation can be problematic, for example, - // when multiple field plugin instances request for user context. - debounce: false -} +export type GetUserContextMessage = MessageToContainer<'getUserContext'> export const isGetUserContextMessage = ( obj: unknown, @@ -17,6 +12,5 @@ export const getUserContextMessage = ( ): GetUserContextMessage => ({ action: 'plugin-changed', event: 'getUserContext', - debounce: false, ...options, })