glennsimon / cwwf

Apache License 2.0
2 stars 1 forks source link

populateMyFriends - should it be refactored to be a function on the server side? #115

Open glennsimon opened 2 months ago

glennsimon commented 2 months ago

Populate my friends uses a query with where('uid', 'in', currentUser.friends) constraint. This works fine until the users list of friends exceeds 10, which is a limitation of the 'in' modifier. I will fix this problem by removing the 'in' constraint and filtering on the client, but then there is a lot of data (all existing users) being transferred to the client. This would be better done on the server side so only the friends data is transferred.

glennsimon commented 1 month ago

Fixed in deployed release, by eliminating the where constraint and culling them on the device. Actual solution should be a new function that does this culling on the server side to save client resources.