Bug Description
Three related bugs in getBrowserExtensionChatflows caused the browser extension to display incorrect chatflows and ignore the "Browser Extension" visibility checkbox entirely.
User-Facing Symptoms
- Users saw chatflows in the browser extension that did not appear on their main chatflows page (e.g. chatflows from old or unrelated workspaces like "dailylog generator")
- Toggling the "Browser Extension" checkbox in Visibility Settings had no effect on which chatflows appeared in the extension
- Extension displayed every chatflow the user could access, regardless of visibility configuration
Root Cause
Three bugs in packages/server/src/services/browser-extension/index.ts (getBrowserExtensionChatflows):
1. Workspace / Organization Leak
The query filtered only by userId, not workspaceId or organizationId. A user who ever belonged to multiple workspaces would see chatflows from all of them in the extension, not just their current workspace.
// Before: only userId filter — leaks across workspaces
.where('chatflow.userId = :userId', { userId })
2. Missing Visibility Filter
The endpoint's own Swagger documentation states it should return only chatflows that include "Browser Extension" in their visibility array. The query contained no such filter, so all chatflows were returned regardless of the visibility checkbox state.
// Before: no visibility filter — checkbox had no effect
// Expected: .andWhere("chatflow.visibility LIKE :ext", { ext: '%Browser Extension%' })
3. Missing Enum Value
ChatflowVisibility enum in packages/server/src/database/entities/ChatFlow.ts was missing the BROWSER_EXTENSION variant, forcing as any type casts throughout updateBrowserExtensionVisibility and making the enum incomplete.
// Before: enum had no BROWSER_EXTENSION member
export enum ChatflowVisibility {
PRIVATE = 'Private',
ORGANIZATION = 'Organization',
// BROWSER_EXTENSION missing
}
Fix
All three issues were resolved in PR #1053:
- Added
BROWSER_EXTENSION = 'Browser Extension' to the ChatflowVisibility enum
- Added
.andWhere('chatflow.workspaceId = :workspaceId', { workspaceId }) to scope results to the active workspace
- Added
.andWhere('chatflow.visibility LIKE :ext', { ext: '%Browser Extension%' }) to enforce the visibility filter
- Replaced all
as any casts with ChatflowVisibility.BROWSER_EXTENSION
Affected Files
packages/server/src/services/browser-extension/index.ts — query missing workspace + visibility filters
packages/server/src/database/entities/ChatFlow.ts — ChatflowVisibility enum missing BROWSER_EXTENSION
Steps to Reproduce (Before Fix)
- Have a user account that has been a member of more than one workspace
- Open the browser extension — chatflows from all past workspaces appear
- Go to a chatflow's Visibility Settings, uncheck "Browser Extension", save
- Re-open the extension — the chatflow still appears (visibility filter ignored)
Expected Behavior
- Extension only shows chatflows belonging to the user's current workspace
- Only chatflows with "Browser Extension" checked in Visibility Settings appear in the extension
Related
Closes via PR #1053 (fix already merged to staging)
See also #326 (separate but related browser extension visibility issue — org-wide vs user-specific settings)
Bug Description
Three related bugs in
getBrowserExtensionChatflowscaused the browser extension to display incorrect chatflows and ignore the "Browser Extension" visibility checkbox entirely.User-Facing Symptoms
Root Cause
Three bugs in
packages/server/src/services/browser-extension/index.ts(getBrowserExtensionChatflows):1. Workspace / Organization Leak
The query filtered only by
userId, notworkspaceIdororganizationId. A user who ever belonged to multiple workspaces would see chatflows from all of them in the extension, not just their current workspace.2. Missing Visibility Filter
The endpoint's own Swagger documentation states it should return only chatflows that include
"Browser Extension"in their visibility array. The query contained no such filter, so all chatflows were returned regardless of the visibility checkbox state.3. Missing Enum Value
ChatflowVisibilityenum inpackages/server/src/database/entities/ChatFlow.tswas missing theBROWSER_EXTENSIONvariant, forcingas anytype casts throughoutupdateBrowserExtensionVisibilityand making the enum incomplete.Fix
All three issues were resolved in PR #1053:
BROWSER_EXTENSION = 'Browser Extension'to theChatflowVisibilityenum.andWhere('chatflow.workspaceId = :workspaceId', { workspaceId })to scope results to the active workspace.andWhere('chatflow.visibility LIKE :ext', { ext: '%Browser Extension%' })to enforce the visibility filteras anycasts withChatflowVisibility.BROWSER_EXTENSIONAffected Files
packages/server/src/services/browser-extension/index.ts— query missing workspace + visibility filterspackages/server/src/database/entities/ChatFlow.ts—ChatflowVisibilityenum missingBROWSER_EXTENSIONSteps to Reproduce (Before Fix)
Expected Behavior
Related
Closes via PR #1053 (fix already merged to staging)
See also #326 (separate but related browser extension visibility issue — org-wide vs user-specific settings)