Skip to content

fix(setting): do not query domainless mixins when checking attribute usage - #11155

Merged
ArtyomSavchenko merged 1 commit into
hcengineering:developfrom
MichaelUray:fix/attribute-usage-mixin-domain
Oct 19, 2026
Merged

ArtyomSavchenko merged 1 commit into
hcengineering:developfrom
MichaelUray:fix/attribute-usage-mixin-domain

Conversation

@MichaelUray

Copy link
Copy Markdown
Contributor

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.

…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
ArtyomSavchenko merged commit 773d6bc into hcengineering:develop Oct 19, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to Edit or Delete Collaborators Class Properties

2 participants