mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-12 04:15:30 +00:00
fix(ee): Wipe search contexts on init if we no longer have the entitlement (#618)
Some checks failed
Publish to ghcr / build (linux/amd64, blacksmith-4vcpu-ubuntu-2404) (push) Has been cancelled
Publish to ghcr / build (linux/arm64, blacksmith-8vcpu-ubuntu-2204-arm) (push) Has been cancelled
Update Roadmap Released / update (push) Has been cancelled
Publish to ghcr / merge (push) Has been cancelled
Some checks failed
Publish to ghcr / build (linux/amd64, blacksmith-4vcpu-ubuntu-2404) (push) Has been cancelled
Publish to ghcr / build (linux/arm64, blacksmith-8vcpu-ubuntu-2204-arm) (push) Has been cancelled
Update Roadmap Released / update (push) Has been cancelled
Publish to ghcr / merge (push) Has been cancelled
This commit is contained in:
parent
fbe1073d0e
commit
1dff20d47a
2 changed files with 13 additions and 0 deletions
|
|
@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- Fixed spurious infinite loads with explore panel, file tree, and file search command. [#617](https://github.com/sourcebot-dev/sourcebot/pull/617)
|
- Fixed spurious infinite loads with explore panel, file tree, and file search command. [#617](https://github.com/sourcebot-dev/sourcebot/pull/617)
|
||||||
|
- Wipe search context on init if entitlement no longer exists [#618](https://github.com/sourcebot-dev/sourcebot/pull/618)
|
||||||
|
|
||||||
## [4.9.2] - 2025-11-13
|
## [4.9.2] - 2025-11-13
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,18 @@ const initSingleTenancy = async () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If we don't have the search context entitlement then wipe any existing
|
||||||
|
// search contexts that may be present in the DB. This could happen if a deployment had
|
||||||
|
// the entitlement, synced search contexts, and then no longer had the entitlement
|
||||||
|
const hasSearchContextEntitlement = hasEntitlement("search-contexts")
|
||||||
|
if(!hasSearchContextEntitlement) {
|
||||||
|
await prisma.searchContext.deleteMany({
|
||||||
|
where: {
|
||||||
|
orgId: SINGLE_TENANT_ORG_ID,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Sync anonymous access config from the config file
|
// Sync anonymous access config from the config file
|
||||||
const config = await loadConfig(env.CONFIG_PATH);
|
const config = await loadConfig(env.CONFIG_PATH);
|
||||||
const forceEnableAnonymousAccess = config.settings?.enablePublicAccess ?? env.FORCE_ENABLE_ANONYMOUS_ACCESS === 'true';
|
const forceEnableAnonymousAccess = config.settings?.enablePublicAccess ?? env.FORCE_ENABLE_ANONYMOUS_ACCESS === 'true';
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue