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

Progress fetching url limiting #7434

Merged
merged 5 commits into from
Aug 4, 2020

Conversation

rtibbles
Copy link
Member

@rtibbles rtibbles commented Aug 4, 2020

Summary

  • We always fetched content node progress by content node ids
  • This sometimes led to fetches having very long URIs
  • This broke on some setups, due to limits on URI length
  • Fixes this by:
    • Fetching content node progress for topic children by their parent id
    • Fetching content node progress for lesson resource by the lesson id
    • Only fetching content node progress for displayed content nodes in the recommended page
    • Batching requests for content node progress for recommended subpage to fetch 50 ids at a time

Reviewer guidance

Check that progress loads in a lesson, in a topic, and on the main recommended page and on recommended subpages.

References

I thought there was an issue for this, but I can't find it for the life of me.

Contributor Checklist

PR process:

  • PR has the correct target branch and milestone
  • PR has 'needs review' or 'work-in-progress' label
  • If PR is ready for review, a reviewer has been added. (Don't use 'Assignees')
  • If this is an important user-facing change, PR or related issue has a 'changelog' label
  • If this includes an internal dependency change, a link to the diff is provided

Testing:

  • Contributor has fully tested the PR manually
  • If there are any front-end changes, before/after screenshots are included
  • Critical user journeys are covered by Gherkin stories
  • Critical and brittle code paths are covered by unit tests

Reviewer Checklist

  • Automated test coverage is satisfactory
  • PR is fully functional
  • PR has been tested for accessibility regressions
  • External dependency files were updated if necessary (yarn and pip)
  • Documentation is updated
  • Contributor is in AUTHORS.md

@rtibbles rtibbles added the TODO: needs review Waiting for review label Aug 4, 2020
@rtibbles rtibbles added this to the 0.14.0 milestone Aug 4, 2020
@rtibbles rtibbles requested a review from jonboiser August 4, 2020 18:17
@jonboiser jonboiser self-assigned this Aug 4, 2020
@jonboiser
Copy link
Contributor

I think we've talked informally about this happening, but there's no specific issue about adding these filters.

Maybe this issue is relevant? #5041

@rtibbles
Copy link
Member Author

rtibbles commented Aug 4, 2020

Yeah - that seems related. Not sure it will fix the vue dev tools part or not.

@indirectlylit
Copy link
Contributor

indirectlylit commented Aug 4, 2020

Also possibly related - #6466 (comment)

I'm able to reproduce this issue by going to the Recommended tab on our main kolibri demo server. My guess is that the the request URL for contentnodeprogress endpoint is too long with the number of node ids.

@jonboiser
Copy link
Contributor

I'm not seeing the progress bar on the Recommended Subpages cards, but the progress is coming over the wire

image

@jonboiser
Copy link
Contributor

Devtools output for the "5+6" card on the main Recommended Page (with Progress = 1)

image

Output on the subpage (Progress = 0)
image

The Vuex mutation for setting progress is going through, but it must not be setting the Card props correctly at the end.

@codecov
Copy link

codecov bot commented Aug 4, 2020

Codecov Report

Merging #7434 into release-v0.14.x will decrease coverage by 0.05%.
The diff coverage is 10.81%.

Impacted Files Coverage Δ
kolibri/plugins/learn/assets/src/constants.js 100.00% <ø> (ø)
...gins/learn/assets/src/modules/recommended/index.js 0.00% <ø> (ø)
...plugins/learn/assets/src/views/RecommendedPage.vue 0.00% <0.00%> (ø)
...gins/learn/assets/src/views/RecommendedSubpage.vue 0.00% <0.00%> (ø)
kolibri/core/content/api.py 88.45% <40.00%> (-1.11%) ⬇️
kolibri/core/tasks/utils.py 87.03% <0.00%> (-5.56%) ⬇️
kolibri/core/content/utils/channel_import.py 88.48% <0.00%> (-0.57%) ⬇️
...s/device/assets/src/views/FacilitiesPage/index.vue 0.00% <0.00%> (ø)

@rtibbles
Copy link
Member Author

rtibbles commented Aug 4, 2020

Hrm - curious, will look into this!

@jonboiser
Copy link
Contributor

jonboiser commented Aug 4, 2020

So, it seems that the state for the "Most popular" subpage is actually this subpage sub-module. And it's getting all the card info + progresses from state.recommended.subpage.recommendations, whereas the created hook is only updating the state.recommended.popular stuff. I think maybe we should just get rid of this recommended/subpage submodule and read directly from the main recommended module

image

@rtibbles
Copy link
Member Author

rtibbles commented Aug 4, 2020

Thanks - I'll make that alteration, seems like a decent cleanup.

@rtibbles
Copy link
Member Author

rtibbles commented Aug 4, 2020

Updated!

@jonboiser
Copy link
Contributor

@rtibbles
Copy link
Member Author

rtibbles commented Aug 4, 2020

Done!

Copy link
Contributor

@jonboiser jonboiser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@rtibbles rtibbles merged commit 6f4fd6f into learningequality:release-v0.14.x Aug 4, 2020
@rtibbles rtibbles deleted the progress_fetch branch August 4, 2020 21:33
@jonboiser jonboiser removed the TODO: needs review Waiting for review label Aug 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants