Repository navigation
fix(tenant-manager): tenant renames reach the api-core tenant - #6102
Merged
Merged
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Renaming a tenant or changing its description in Tenant Manager now also updates the api-core
Tenant. Before this change, Tenant Manager saved those edits to itswbyTenantCMS entry, but nothing passed them on to api-core, so the platform kept showing the old name. A newEntryAfterUpdatehandler does that now. It follows the same pattern as the existingDeleteTenantOnEntryDeletefeature.What changed
Tenant Manager API (
packages/tenant-manager/src/api)SyncTenantOnEntryUpdatefeature, registered inapi/Extension.tsright afterDeleteTenantOnEntryDeleteFeature. Its handler only acts onwbyTenantentries (TENANT_MODEL_ID). It calls api-core'sUpdateTenantUseCasewith{ name, description }fromentry.valuesand usesentry.entryIdas the tenant id.nameordescriptionis different fromoriginal.values.DisableTenantUseCase/EnableTenantUseCaseupdate api-core first and then save onlystatuson the CMS entry. Those saves also fire this handler, which skips them, so status stays with the flows that already handle it. No other fields are synced.Failed to update tenant <id>!and does not rethrow. The CMS save still succeeds, but the api-core tenant can end up out of sync with the entry. The delete handler behaves the same way.website-builder-nextjs) has no changes on this branch.How it was checked
packages/tenant-manager/__tests__/syncTenantOnEntryUpdate.test.ts. It registers the feature against a fake api-coreUpdateTenantUseCaseand publishesEntryAfterUpdateEvents:🤖 Generated with Claude Code