-
Notifications
You must be signed in to change notification settings - Fork 176
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
TypeError: Cannot read property 'set_active_channel' of undefined #900
Comments
This report is also possibly related, as they're both triggering from the same page and deal with invalid data that could be caused by a failed initialization of the channel list. Sentry issue: STUDIO-11 |
…wn the cause of issue learningequality#900.
…wn the cause of issue learningequality#900.
Sorry, I know exactly what this is. When you select a channel right after the page loads, some of the other lists the channel might be in might not have finished loading. It is essentially trying to read from a list that isn't there. I can look into this more |
Marking this high priority just because it is probably the most frequent error report we get on Sentry, and silencing it would significantly reduce the noise in the error reporter. |
@kollivier Will look into this tomorrow- thanks for flagging! |
@jayoshih Actually, sorry, I never updated this ticket. This problem isn't totally resolved, but we significantly reduced the number of Sentry reports by checking if the channel lists have been propagated before calling methods on them. There are still edge cases though, like if you load the channels page and click the New Channel button really quickly, you can get an error if the My Channels list is not yet loaded. In general, what we need is to improve the code to handle scenarios where the page is still fetching data it needs to render. |
PR for reference: #1070 |
Sounds good! Since the errors are slightly fewer, I'm thinking this would actually be a good place to use vue instead. If we can tell which channel is selected, we should be able to render it as selected easily with the state. It also works out well since the channel list is fairly self-contained |
Yes, I think Vue would be a good choice here (and possibly everywhere :)! Note though that the problem here is that we were trying to call set_active_channel even before we had received the channel list from the API call. So the key is to have some sort of "loading channel list, please wait..." UI and only actually try to render the list once the various get_channel_list API calls have returned. I think it might be good to work out a design pattern for this case (i.e. view requires results of API call before it can render properly), as several views have similar issues. |
Based on the implementation, there are three ways I can think of for handling this issue:
I am slightly leaning towards the third strategy, but I understand that it is also valuable to get this out in a timely manner, so I'm open to the other two options |
I think it depends on how often we see this page changing. If it isn't likely to change often, we can probably live with its issues for a while. In that case, doing 1 first to quiet Sentry some more, and then doing 3 when this view bubbles up to the top of the Vue TODO views :), probably makes the most sense. If, on the other hand, we see this page getting touched by a lot of changes we're going to be making, we're probably better off biting the bullet and moving to Vue now, so that we can have a clean and solid foundation to work from. In this case I think doing the work upfront would ultimately save us time. |
I think I might have some time next week or the following week to make the migration to vue! |
DESCRIPTION
In edit_channel/new_channel/views.js, one or more of the API calls to retrieve the channel list is failing, but we are not catching errors in those calls, so we only get this error later on when set_active_channel is called on the undefined channel list. We should probably first add error handlers to the promise calls to gather more information about the problem.
CATEGORY
BUG
DETAILS
https://sentry.io/learningequality/studio/issues/655655845/
The text was updated successfully, but these errors were encountered: