Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Canvas API may return duplicate courses #174

Closed
ssciolla opened this issue May 21, 2020 · 4 comments · Fixed by #175
Closed

Canvas API may return duplicate courses #174

ssciolla opened this issue May 21, 2020 · 4 comments · Fixed by #175
Assignees
Labels
🐛 bug Something isn't working Canvas 🥞 database Won't Fix This will not be worked on

Comments

@ssciolla
Copy link
Contributor

ssciolla commented May 21, 2020

Today, the two jobs in OpenShift failed because of duplicate course primary keys, for different courses. This appears to be unexpected API behavior from the account/{account_id}/courses endpoint, as I don't believe this has happened before. Still, we should likely modify the existing code to drop_duplicates and note how many courses were dropped, so we can avoid this error while also monitoring API anomalies.

@ssciolla
Copy link
Contributor Author

I discussed the problem with @jonespm, as this may also occur with his use of canvasapi in the CANVAS_ZOOM_MEETINGS job. Ultimately we'll want to avoid fetching the same data multiple times (see issue #162), but we'll need to handle this there as part of resolving this issue in the short-term.

ssciolla added a commit that referenced this issue May 22, 2020
…ble (#174) (#175)

* Drop duplicate courses; log number of dropped courses

* Improve logging messages
@jonespm
Copy link
Member

jonespm commented May 29, 2020

It was mentioned on #176 that we might want to move the code from get_lti_tabs out one more level and only call this once.

@jonespm
Copy link
Member

jonespm commented Jun 2, 2020

This one is not yet finished. We could probably bump it with #162 to the next release but I think it could be finished by itself tomorrow. I've never seen any case where there were duplicate courses returned as part of this process.

@tl-its-umich-edu tl-its-umich-edu deleted a comment from zqian Jun 3, 2020
@jonespm
Copy link
Member

jonespm commented Jun 3, 2020

I believe because of chances of this happening are low and the entire process should be changed in #162 I'm going to close this for now. Doing this would require:

  • Retrieving all courses in a term
  • Removing Duplicates (if any)
  • Add in ADD_COURSE_IDS courses that aren't already in the list
  • Process all these courses

This should all be refactored into one place to populate the courses table so it can be used by future classes.

@jonespm jonespm closed this as completed Jun 3, 2020
@jonespm jonespm added the Won't Fix This will not be worked on label Jun 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐛 bug Something isn't working Canvas 🥞 database Won't Fix This will not be worked on
Projects
None yet
2 participants