Repository navigation
fix(setting): do not query domainless mixins when checking attribute usage - #11155
Merged
ArtyomSavchenko merged 1 commit intoOct 19, 2026
Conversation
…usage Opening or right-clicking an attribute in class settings checked whether it is in use with client.findOne(attribute.attributeOf, ...). For mixins declared on a class without a domain, such as notification:mixin:Collaborators (a mixin on core.class.Doc), the query throws 'domain not found', so the edit panel and the context menu never opened. Move the check into an isAttributeUsed helper that skips the query when the attribute class has no domain and treats the attribute as used, since such a mixin can be applied to documents in any domain. This keeps the type locked and shows the stronger delete confirmation. Add unit tests for the helper. Fixes hcengineering#7142 Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
ArtyomSavchenko
approved these changes
Oct 19, 2026
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.
Fixes #7142
Problem and change
Opening or right-clicking an attribute in class settings checked whether it is in use with client.findOne(attribute.attributeOf, ...). For mixins declared on a class without a domain, such as notification:mixin:Collaborators (a mixin on core.class.Doc), the query throws 'domain not found', so the edit panel and the context menu never opened.
Move the check into an isAttributeUsed helper that skips the query when the attribute class has no domain and treats the attribute as used, since such a mixin can be applied to documents in any domain. This keeps the type locked and shows the stronger delete confirmation. Add unit tests for the helper.
Tests
New unit tests
plugins/setting-resources/src/__tests__/attributeUsage.test.ts(normal class with and without usage, domain-less class skips the query). Regression checked on a self-hosted instance with a custom attribute on a normal class: the edit panel opens and removal asks for confirmation.