Skip to content
This repository has been archived by the owner on May 25, 2021. It is now read-only.

Too many requests when selecting course from the sidebar #443

Open
Malorn44 opened this issue Apr 12, 2019 · 2 comments
Open

Too many requests when selecting course from the sidebar #443

Malorn44 opened this issue Apr 12, 2019 · 2 comments
Assignees
Labels
class:performance This issue is related to performance help wanted Pls help us with this :) priority:high This issue has a high priority service:web This issue involves the web service size:small

Comments

@Malorn44
Copy link
Member

Describe the bug
When selecting a course in the sidebar, too many requests are made and there is a very noticeable slowdown. It also looks like there are more requests, the more sections a course has.

To Reproduce

  1. Select a couple of courses
  2. Open the sidebar
  3. Unselect and reselect a course (if you have your network tab open in your developer tools, you'll see there are a lot more requests than there should be)

Expected behavior
Ideally, this should only make a single request

@Malorn44 Malorn44 added priority:high This issue has a high priority service:web This issue involves the web service class:performance This issue is related to performance size:small help wanted Pls help us with this :) labels Apr 12, 2019
@LuminaSapphira
Copy link
Contributor

This is a result of the current implementation of SelectionService calling addListing on SidebarService every time a section is added, which happens as part of a loop when toggleCourse is called in SelectionService. This should be easily hotfixable, though the refactored selection service will fix this issue as well.

See code:

course.sections.forEach((s) => {
this.addSection(s);
});

this.sidebarService.addListing(section.listing);

@Malorn44
Copy link
Member Author

alright great 👍
I'll keep this issue open of course until it is confirmed to be fixed. Glad this is being worked on.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
class:performance This issue is related to performance help wanted Pls help us with this :) priority:high This issue has a high priority service:web This issue involves the web service size:small
Projects
None yet
Development

No branches or pull requests

2 participants