File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99
1010### Fixed
1111- Fixed spurious infinite loads with explore panel, file tree, and file search command. [ #617 ] ( https://github.com/sourcebot-dev/sourcebot/pull/617 )
12+ - Wipe search context on init if entitlement no longer exists [ #618 ] ( https://github.com/sourcebot-dev/sourcebot/pull/618 )
1213
1314## [ 4.9.2] - 2025-11-13
1415
Original file line number Diff line number Diff line change @@ -62,6 +62,18 @@ const initSingleTenancy = async () => {
6262 }
6363 }
6464
65+ // If we don't have the search context entitlement then wipe any existing
66+ // search contexts that may be present in the DB. This could happen if a deployment had
67+ // the entitlement, synced search contexts, and then no longer had the entitlement
68+ const hasSearchContextEntitlement = hasEntitlement ( "search-contexts" )
69+ if ( ! hasSearchContextEntitlement ) {
70+ await prisma . searchContext . deleteMany ( {
71+ where : {
72+ orgId : SINGLE_TENANT_ORG_ID ,
73+ } ,
74+ } ) ;
75+ }
76+
6577 // Sync anonymous access config from the config file
6678 const config = await loadConfig ( env . CONFIG_PATH ) ;
6779 const forceEnableAnonymousAccess = config . settings ?. enablePublicAccess ?? env . FORCE_ENABLE_ANONYMOUS_ACCESS === 'true' ;
You can’t perform that action at this time.
0 commit comments