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

Excessive calls to the clipboard API endpoint #1304

Open
ormsbee opened this issue Sep 19, 2024 · 1 comment
Open

Excessive calls to the clipboard API endpoint #1304

ormsbee opened this issue Sep 19, 2024 · 1 comment
Labels
bug Report of or fix for something that isn't working as intended

Comments

@ormsbee
Copy link

ormsbee commented Sep 19, 2024

I have a course outline page for a very large course, and it looks like it's making a call to GET /api/content-staging/v1/clipboard/ for every subsection in the course. This particular course has 82 subsections, so it makes this call 82 times, noticeably slowing down the processing for this page.

@bradenmacdonald
Copy link
Contributor

Yeah, I guess when the frontend was implemented the developers didn't know about react query yet, so they implemented it with Redux. My preferred fix is to update the useCopyToClipboard hook to use react query, which has automatic request deduplication.

I actually tried to do this as a drive-by refactor during a recent PR, but it was non-trivial because of interactions with other components that are also using redux. It's still very doable though.

@bradenmacdonald bradenmacdonald added the bug Report of or fix for something that isn't working as intended label Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Report of or fix for something that isn't working as intended
Projects
None yet
Development

No branches or pull requests

2 participants