Skip to content

Conversation

@blizzz
Copy link
Member

@blizzz blizzz commented Apr 8, 2025

Summary

this might have occured on instances with

  • more than twenty groups, and
  • on rules with more than one Group membership checks
  • and at least one of them being not in the set of the first 20 groups
before after
before after

In the before image you see that in some Group membership checks are still the placeholders and only two groups, G13 and G14 are shown with their display names. The network console shows that only the first twenty groups were fetched.

In the after image you see that all groups are visible now. The groups G33 and G37 are used twice each, on in combination with themselves and once an a rule with another group. In the network console you see that these groups are fetched now, but just once, not more than necessary.

Checklist

@blizzz blizzz added this to the Nextcloud 32 milestone Apr 8, 2025
@blizzz blizzz requested a review from juliusknorr April 8, 2025 16:36
@blizzz blizzz requested a review from a team as a code owner April 8, 2025 16:36
@blizzz blizzz requested review from nfebe, susnux and szaimen and removed request for a team April 8, 2025 16:36
@blizzz blizzz changed the title Fix/noid/wfe empty group in check fix(workflowengine): fix group not shown in Group membership check Apr 8, 2025
@szaimen szaimen removed their request for review April 9, 2025 14:01
Comment on lines +138 to +147
let nextQuery
do {
nextQuery = this.wantedGroups.shift()
if (this.hasGroup(nextQuery)) {
nextQuery = undefined
}
} while (!nextQuery && this.wantedGroups.length > 0)
if (nextQuery) {
await this.searchAsync(nextQuery)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Easier to read.

Suggested change
let nextQuery
do {
nextQuery = this.wantedGroups.shift()
if (this.hasGroup(nextQuery)) {
nextQuery = undefined
}
} while (!nextQuery && this.wantedGroups.length > 0)
if (nextQuery) {
await this.searchAsync(nextQuery)
}
while (this.wantedGroups.length > 0) {
const groupId = this.wantedGroups.shift()
if (this.hasGroup(groupId)) {
continue
}
await this.searchAsync(groupId)
return
}

Also, the current implementation would only search 1 wanted group, I assuming this intended as this.findGroupByQueue() again called at the end of search

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was intentionally done as a queue in order to not DoS the server with group search requests, but have them coming sequentially.

Copy link
Contributor

@susnux susnux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works but see Fons comments

@blizzz
Copy link
Member Author

blizzz commented May 5, 2025

/compile amend /

This was referenced May 5, 2025
this might have occured on instances with
- more than twenty groups, and
- on rules with more than one Group membership checks
- and at least one of them being not in the set of the first 20 groups

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
@nextcloud-command nextcloud-command force-pushed the fix/noid/wfe-empty-group-in-check branch from f01afb0 to 9609606 Compare May 5, 2025 14:59
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
@blizzz blizzz force-pushed the fix/noid/wfe-empty-group-in-check branch from 9609606 to c051a5b Compare May 5, 2025 15:01
@blizzz
Copy link
Member Author

blizzz commented May 5, 2025

(Rebased and rebuild)

@blizzz blizzz merged commit 2a1e63b into master May 5, 2025
124 checks passed
@blizzz blizzz deleted the fix/noid/wfe-empty-group-in-check branch May 5, 2025 15:34
@nextcloud-bot nextcloud-bot mentioned this pull request Aug 19, 2025
@skjnldsv skjnldsv removed this from the Nextcloud 32 milestone Sep 28, 2025
@skjnldsv skjnldsv modified the milestones: Nextcloud 33, Nextcloud 32 Sep 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants