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

Issue navigation not working #644

Open
AlanFCMV opened this issue Sep 9, 2021 · 7 comments · May be fixed by #888
Open

Issue navigation not working #644

AlanFCMV opened this issue Sep 9, 2021 · 7 comments · May be fixed by #888
Labels

Comments

@AlanFCMV
Copy link
Member

AlanFCMV commented Sep 9, 2021

Selecting an issue on the UFIXIT page, as well as the "Next Issue" and "Previous Issue" buttons, are all not working properly. Instead of the proper issue, an issue that is marked as fixed will show up in its place, even if I have fixed issues filtered out.

I believe that this is due to the links not being properly updated when an issue is fixed or marked as resolved.

This is happening on UDOIT 3.0.
Examples:
When I click on this issue, which is third on the list of issues:
image
This other issue pops up
image

When I try to navigate to the third issue through the Next or Previous Buttons
image
I reach the same issue
image

It is effectively impossible for me to reach that issue.

@AlanFCMV AlanFCMV added this to the 3.0.0 milestone Sep 9, 2021
@bagofarms
Copy link
Member

This may be fixed by an issue @atarisafari is working on.

@bagofarms bagofarms modified the milestones: 3.0.0, 3.1.0 Sep 10, 2021
@cidilabs
Copy link
Contributor

We've been able to reproduce this issue inconsistently, with it showing up in only a few courses. Any details on the course that is causing this would be helpful.

@AlanFCMV
Copy link
Member Author

It is happening in both of my test courses. One of them is small and I use it to test specific errors, while the other is large and I use it to test UDOIT as a whole. The two of them are very different, so I can't really point to anything they have in common.

@bagofarms bagofarms removed this from the 3.1.0 milestone Nov 9, 2021
@jonespm
Copy link
Contributor

jonespm commented Jul 8, 2022

Was there any more progress on this? I think I'm hitting something similar and navigation isn't working is many of the courses we have.

I can pretty consistently reproduce it by changing a filter to something like "Resolved Issues" which shows less issues. Then going selecting an Issue and going Next will basically not go anywhere.

This seems to be more of a problem in courses where over 100 issues were found by UDOIT.

Also often in those courses when clicking rows on the UFIXIT page will go to issues that weren't even the ones clicked on.

@jonespm
Copy link
Contributor

jonespm commented Oct 6, 2022

This is still an issue on 3.3.1 for us. A course that has the problem has over 100 issues. Before fixing any issues there are no problems with navigation. As soon as a few issues are fixed the navigation. You can see this after issue 96 here it jumps back to 23.

This was on a site with
112 Errors
51 Suggestions
2 Issues Fixed
0 Manually Resolved
0 Files Reviewed

Screen.Recording.2022-10-06.at.4.37.57.PM.mov

@jonespm
Copy link
Contributor

jonespm commented Oct 10, 2022

So I've debugged this a little more.

It looks like the value of this.props.filteredRows[newIndex] in UfixitModal->handleIssueChange doesn't match up with props.report.issues[stateActiveIssue.id] in in ContentPage->getDerivedStateFromProps.

So getDerivedStateFromProps is resetting the active issue when the status doesn't match, even though they aren't the same issue. The stateActiveIssue.id isn't actually the index for the value in issues.

I feel like it might actually has to search through the props.report.issue for the id rather than just trying it access it directly with the index?

@ssciolla
Copy link
Contributor

ssciolla commented Feb 3, 2023

I think what @jonespm described here is correct. The issue ID is being treated like an index. This problem occurs when the index of the issue is small enough that it also could be an issue ID (from the database table). This makes it hard to reproduce in many cases, since it has to be a very early course or a brand new database.

static getDerivedStateFromProps(props, state) {
const stateActiveIssue = state.activeIssue
const propsActiveIssue = stateActiveIssue && props.report.issues[stateActiveIssue.id]
if(propsActiveIssue && propsActiveIssue.status !== stateActiveIssue.status) {
return {
activeIssue: propsActiveIssue
}
}
return null
}

Finding the issue by ID here would work, but it may also just make sense to update the state using App.handleIssueSave and not use getDerivedStateFromProps. Something like this: https://github.com/ucfopen/UDOIT/compare/main...ssciolla:UDOIT:issue-644-keep-fe-state?expand=1

I'll plan to open a PR for discussion next week. There's also another issue/fix involved with that diff that I need to document.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
5 participants