You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While the rankings and points are correct, they have the wrong Week listed with them. And it looks like the discrepancy is due to the week # being calculated in inverse order (from the last regular season game played). For example (with my league with years 2019-2021, 13 game regular season in 19/20 and 14 in 21):
2021 - Top "Week 1" scores actually happened in Week 2, and vice versa. (Obviously, we don't know how Week 3 scores will be reflected yet, but I suspect that top Week 3 scores will be displayed as "Week 1", vice versa w/ top Week 1 scores, and Week 2 scores will "correctly" be displayed as "Week 2" - but only because it's the middle week of 3 played weeks)
2020 - "Week 8" scores should be Week 6. "Week 2" scores should be Week 12. "Week 10" scores should be Week 4. "Week 7" scores ARE "correctly" displayed as Week 7 (but again, probably only because it's the middle week of 13 played weeks)
2019 - "Week 6" scores should be Week 8. "Week 9" scores should be Week 5. "Week 5" scores should be Week 9. "Week 13" should be Week 1.
And this occurs in both the All-Time and the 2021/2020/2019 tables (i.e. same top scores show the same incorrect weeks).
[[[POSSIBLE SOURCE OF BUG - but ignore if it doesn't help - I'm just a novice coder]]]: I'm assuming the problem has something to do with how you're assigning the "week" variable in src/lib/utils/helperFunctions/leagueRecords.js.
You start by assigning it to "nflState.week - 1" if NFL is in regular season and 18 if NFL is in the post season. And for "complete" leagues (i.e. past seasons), you assign it to "leagueData.settings.playoff_week_start - 1".
Then you fetch the Sleeper data in inverse week order - i.e. it starts at either "nflState.week - 1" or "leagueData.settings.playoff_week_start - 1" and works backward until week "0"
But then when you process the matchup data, you assign "matchupWeek" to 0 and have it work UPWARD to "matchupsData.length", with each cycle re-assigning "week" to "matchupWeek + 1". And this appears to be the week # that is ultimately displayed.
This bug appears in the "Total Points" column in both the All-Time and Yearly top week scores tables. When the Records tab first loads, the points are shown correctly. Now switch to any different tab. Now switch back to the Records tab. The points are still shown correctly, but any totals ending in something like "150.3" now show "150.30". Now switch to any different tab again. Now switch back to the Records tab. All entries in the "Total Points" column now display "NaN". Now, switching tabs will not bring the scores back. Only refreshing will (which then repeats the above cycle).
[[[by the way, I'd prefer if the 2 decimal digits were always displayed - i.e. "150.3" is always "150.30"]]]
League ID: 725417455366799360
(but your demo/personal league page has the same bugs, or at least the one with switching pages)
Desktop:
macOS Catalina 10.15.7
Chrome Version 93.0.4577.63
By the way, I have a feature request for the Records tab: Could we get an option (on the page) to have these rankings display for "Regular Season", "Playoffs", or "Both", with the Playoffs reflecting only the playoff bracket games (i.e. not the losing bracket/toilet bowl games) (or at least the option in the CODE to exclude toilet bowl games)?
The text was updated successfully, but these errors were encountered:
Thanks for the in-depth writeup! Completely missed this. I've solved the bug in pr #78.
Currently the records only display regular season records. The logic to include playoffs is much more complicated, but probably worth adding. Would you mind opening up a separate feature request ticket with that suggestion? I'm going to close this ticket because the bug is fixed now.
Both bugs in the Records tab
2021 - Top "Week 1" scores actually happened in Week 2, and vice versa. (Obviously, we don't know how Week 3 scores will be reflected yet, but I suspect that top Week 3 scores will be displayed as "Week 1", vice versa w/ top Week 1 scores, and Week 2 scores will "correctly" be displayed as "Week 2" - but only because it's the middle week of 3 played weeks)
2020 - "Week 8" scores should be Week 6. "Week 2" scores should be Week 12. "Week 10" scores should be Week 4. "Week 7" scores ARE "correctly" displayed as Week 7 (but again, probably only because it's the middle week of 13 played weeks)
2019 - "Week 6" scores should be Week 8. "Week 9" scores should be Week 5. "Week 5" scores should be Week 9. "Week 13" should be Week 1.
And this occurs in both the All-Time and the 2021/2020/2019 tables (i.e. same top scores show the same incorrect weeks).
[[[POSSIBLE SOURCE OF BUG - but ignore if it doesn't help - I'm just a novice coder]]]: I'm assuming the problem has something to do with how you're assigning the "week" variable in src/lib/utils/helperFunctions/leagueRecords.js.
You start by assigning it to "nflState.week - 1" if NFL is in regular season and 18 if NFL is in the post season. And for "complete" leagues (i.e. past seasons), you assign it to "leagueData.settings.playoff_week_start - 1".
Then you fetch the Sleeper data in inverse week order - i.e. it starts at either "nflState.week - 1" or "leagueData.settings.playoff_week_start - 1" and works backward until week "0"
But then when you process the matchup data, you assign "matchupWeek" to 0 and have it work UPWARD to "matchupsData.length", with each cycle re-assigning "week" to "matchupWeek + 1". And this appears to be the week # that is ultimately displayed.
[[[by the way, I'd prefer if the 2 decimal digits were always displayed - i.e. "150.3" is always "150.30"]]]
League ID: 725417455366799360
(but your demo/personal league page has the same bugs, or at least the one with switching pages)
Desktop:
macOS Catalina 10.15.7
Chrome Version 93.0.4577.63
By the way, I have a feature request for the Records tab: Could we get an option (on the page) to have these rankings display for "Regular Season", "Playoffs", or "Both", with the Playoffs reflecting only the playoff bracket games (i.e. not the losing bracket/toilet bowl games) (or at least the option in the CODE to exclude toilet bowl games)?
The text was updated successfully, but these errors were encountered: