-
Notifications
You must be signed in to change notification settings - Fork 10
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
Project Retrieval endpoints return Likes #336
Conversation
Joining the tables by using Include() caused the query to take sometimes up to 10 times as long. This was an issue as it caused drastic slow down when retrieving all projects, retrieving project detail or when searching for projects.
Likes were not being returned when retrieving projects. Due to performance reasons, we are just returning an array for now with user id + date instead of Like Count and boolean to check if currently logged in user has liked that specific project. In the future we should probably move the like and follow things into their own controller with respective services. The frontend can then make a call to retrieve project meta data, which can take a little longer and should be non-blocking for the frontend. For now, the frontend can count the objects in the likes array and check if a user id is equal to the one that is logged in. Fixes #329.
… feature/329-improved-project-likes
…es' into feature/329-improved-project-likes
Integration check is failing based on performance external wizard call, just FYI |
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.
The code looks really clean. I'm sorry to nitpick, but in your documentation, you sometimes end the sentence with a dot, and sometimes you don't do this. According to the code guidelines
End comment text with a period.
I suggest do end it with a dot all the time (if it's a correct sentence. On my first PR I got some great discussion about this, and we decided to only end the sentence with a dot whenever it's a correct sentence.)
Description
Likes were not being returned when retrieving projects. Due to performance reasons, we are just returning an array for now with user id + date instead of Like Count and boolean to check if the currently logged-in user has liked that specific project.
In the future, we should probably move the like and follow things into their own controller with respective services. The frontend can then make a call to retrieve project metadata, which can take a little longer and should be non-blocking for the frontend.
For now, the frontend can count the objects in the likes array and check if a user-id is equal to the one that is logged in.
Fixes #329.
#335 should be merged before this as I merged that branch in this one to investigate performance while retrieving likes.
Type of change
Checklist
Steps to Test or Reproduce
Outline the steps to test or reproduce the PR here.
These steps will be used during release testing.
Link to issue
Closes: #329