-
Notifications
You must be signed in to change notification settings - Fork 86
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
use prefetched user list in select user component #4647
use prefetched user list in select user component #4647
Conversation
there was an issue when fetching desk members for a desk with many users, it would fail on too big request when fetching such users by id. SDCP-849
scripts/api/index.ts
Outdated
@@ -11,6 +11,7 @@ import {time} from './time'; | |||
import {user} from './user'; | |||
import {vocabularies} from './vocabularies'; | |||
import {contentProfiles} from './content-profiles'; | |||
import * as utils from './utils'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not import from lodash directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will drop it, seems like we have another helper for it
|
||
if (searchString != null && searchString.length > 0) { | ||
query.$and.push(getUserSearchMongoQuery(searchString)); | ||
} | ||
const query = getUserSearchMongoQuery(searchString); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your filtering here only supports a subset of mongo query, ($or operator). How about next to getUserSearchMongoQuery
you put matchUserByMongoQuery(user: IUser): boolean
so if someone changes the query they would also see client side matching code and would update it too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
You mean GET request URL would get too long? |
By the way, that playwright test is unstable. You can either try restarting e2e or disable that test. (the problem is actually the feature that is unstable, not the test) |
yes exactly |
* use prefetched user list in select user component there was an issue when fetching desk members for a desk with many users, it would fail on too big request when fetching such users by id. SDCP-849
I was looking around the code and realized this change is breaking |
yep you're right, will fix it |
there was an issue when fetching desk members
for a desk with many users, it would fail on
too big request when fetching 50+ users by id.
SDCP-849