Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove limit from axios call that retrieves groups #24611

Closed

Conversation

lephisto
Copy link

@lephisto lephisto commented Dec 8, 2020

Fixes #24547

Signed-off-by: Mephisto mephisto@mephis.to

@kesselb
Copy link
Contributor

kesselb commented Dec 9, 2020

/compile amend /

@kesselb kesselb added 3. to review Waiting for reviews bug labels Dec 9, 2020
Signed-off-by: Mephisto <mephisto@mephis.to>
Signed-off-by: npmbuildbot-nextcloud[bot] <npmbuildbot-nextcloud[bot]@users.noreply.github.com>
@npmbuildbot-nextcloud npmbuildbot-nextcloud bot force-pushed the fix-workflowengine-searchlimit-2 branch from b41b78c to 3b95d40 Compare December 9, 2020 14:31
@lephisto
Copy link
Author

Will this PR make it?

@kesselb kesselb added this to the Nextcloud 21 milestone Dec 14, 2020
Copy link
Member

@nickvergessen nickvergessen left a comment

Choose a reason for hiding this comment

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

This is a bad idea and will bring down servers with a lot of groups.
Why can't you type ahead to search?

@lephisto
Copy link
Author

This is not the Issue. Please read it. The Comboboxes will stay empty for existing workflows, if the groups are not within the first 20.

@nickvergessen
Copy link
Member

Then this needs fixing. Loading potentially 2k or more groups which breaks the UI completely is not the option

@lephisto
Copy link
Author

Limiting breaks the UI as well. How could this be fixed? It could be limited if the actually selected group in a workflowcondition would be guaranteed to be part of the result from the axios call. This would guarantee that the combo wouldn't be empty..

Is having 2k groups really a realistic case? Seems to be rather theoretical to me.

@rullzer rullzer mentioned this pull request Dec 15, 2020
59 tasks
@rullzer
Copy link
Member

rullzer commented Dec 15, 2020

Limiting breaks the UI as well. How could this be fixed? It could be limited if the actually selected group in a workflowcondition would be guaranteed to be part of the result from the axios call. This would guarantee that the combo wouldn't be empty..

Is having 2k groups really a realistic case? Seems to be rather theoretical to me.

There are several customer running with far more than 2k groups ;)

@rullzer rullzer mentioned this pull request Dec 18, 2020
39 tasks
@juliusknorr
Copy link
Member

Showing not all groups is expected here, since as already mentioned this would be quite an issue with larger amount of groups. However I do not see any issue with the original implementation as you can still get to groups that are not displayed by searching for them.

@kesselb
Copy link
Contributor

kesselb commented Dec 21, 2020

However I do not see any issue with the original implementation as you can still get to groups that are not displayed by searching for them.

It's not confusing if one add a group to a workflow and after a page reload the group is not shown anymore? 🤔

@juliusknorr
Copy link
Member

Ah, then I misunderstood the issue. In that case we most likely fail because we don't have a group match (with a displayname) in

return this.groups.find(group => group.id === this.value) || null

I'm not sure how to best solve this other than doing a request for each currently set value yet, but that might of course also cause a high amount of requests for each rule that has a different group set.

@juliusknorr
Copy link
Member

I'm not sure how to best solve this other than doing a request for each currently set value yet, but that might of course also cause a high amount of requests for each rule that has a different group set.

It actually seems to be the case already, so maybe @lephisto can clarify a bit on the original issue.

@rullzer rullzer mentioned this pull request Dec 28, 2020
39 tasks
@ClCfe
Copy link

ClCfe commented Dec 30, 2020

you have two ways to fix this

  1. simple but not the cleanest
    adding a limit parameter to the method searchAsync(searchQuery, limit=20)
    if limit is null, no limit parameter should be added to the axios query
if (this.groups.length === 0) {
	await this.searchAsync('', null)
}

=> so it will retrieve all groups ONLY at initialization

  1. cleanest but more complex
    you pass to the axios query an array of groups IDs (as a new parameter values[]) already involved in the rules of the edited workflow, but this implies changes on the backend

@lephisto
Copy link
Author

I'm not sure how to best solve this other than doing a request for each currently set value yet, but that might of course also cause a high amount of requests for each rule that has a different group set.

It actually seems to be the case already, so maybe @lephisto can clarify a bit on the original issue.

No this is not the case. The current behaviour is, that if you load an existing workflow and there is one group assignment which isn't coincidentally in the first 20 results of the result-limited query, the Dropdown just stays empty, which is confusing.

This is why i formulated the PR to not limit it at all, but I get that it might result in an uncool behaviour if ppl use groups excessively.. As proposed earlier, one idea might be to pass the currently assigned groups to the axios call, to guarantee that they're part of the resultset thus avoiding the confusion. But this exceeds my Nextcloud Coding style awareness to not make it totally ugly. :)

@rullzer rullzer mentioned this pull request Jan 4, 2021
5 tasks
@nickvergessen
Copy link
Member

Closing again. This is not the right way. The required data needs to be loaded manually or with initial state on the settings module. But removing the limit and returning all groups is not an option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Workflowengine doesnt return all criteria values
6 participants