GithubHelp home page GithubHelp logo

Comments (5)

tgayle avatar tgayle commented on July 19, 2024

Hello there!

I believe I might know what the issue is here. Canvas has a term associated with each course. It's usually connected to a semester but it's unfortunately hard-coded right now. I'll fix this in the next commit but here's what you can do for now:

courses = courses.filter(c => c.enrollment_term_id === 286);

Update the c.enrollment_term_id === 286 with your current enrollment term, which you can find here from the Canvas API at this endpoint: https://your_domain.instructure.com/api/v1/courses?enrollment_state=active.
This endpoint should work if you're logged into Canvas in your browser.

Find the course in question and there should be a enrollment_term_id which should be the same for all courses in the current term. Replace that id with the one in index.ts and you should be smooth!

from canvas-to-doist.

oschwartz10612 avatar oschwartz10612 commented on July 19, 2024

Thanks for the reply.

This seems to have fixed the issue, however now I am getting an UnhandledPromiseRejectionWarning. I tripple checked the env variables and they seem correct. Thanks for the help.

Course _____ did not have a corresponding Todoist project, skipping...
Course _____ did not have a corresponding Todoist project, skipping...
Course _____) did not have a corresponding Todoist project, skipping...
Course _____ did not have a corresponding Todoist project, skipping...
_____:
Fetching course info...
Course _____ did not have a corresponding Todoist project, skipping...
Waiting for all courses to finish their business...
(node:16172) UnhandledPromiseRejectionWarning: Error: Request failed with status code 403
    at createError (/Users/_____/Documents/canvas-to-doist/node_modules/axios/lib/core/createError.js:16:15)
    at settle (/Users/_____/Documents/canvas-to-doist/node_modules/axios/lib/core/settle.js:17:12)
    at IncomingMessage.handleStreamEnd (/Users/_____/Documents/canvas-to-doist/node_modules/axios/lib/adapters/http.js:236:11)
    at IncomingMessage.emit (events.js:322:22)
    at IncomingMessage.EventEmitter.emit (domain.js:482:12)
    at endReadableNT (_stream_readable.js:1187:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
(node:16172) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:16172) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

from canvas-to-doist.

tgayle avatar tgayle commented on July 19, 2024

It seems suspicious that none of the courses seem to be returning a corresponding project. Do you have the proper Todoist token? I'd suggest trying to use your personal API token from https://todoist.com/prefs/integrations if you haven't already.

from canvas-to-doist.

oschwartz10612 avatar oschwartz10612 commented on July 19, 2024

I did use the API token from that link.

Sorry I made it more difficult to read by replacing all of the courses with ____. I only have one project and course in the mapping and it appears that it works?

_____:
Fetching course info...

from canvas-to-doist.

tgayle avatar tgayle commented on July 19, 2024

Not a problem at all; protect your privacy.

It's hard to be sure where exactly that 403 is being returned. If the Todoist token is correct, then I wonder if there's something up on Canvas' side.

I'm assuming this course is already currently active and assignments are visible for the course for normal users? The other potential fail-point is perhaps in grabbing assignment submissions. Can you verify that you can view previous submissions for the course within the Canvas website?

from canvas-to-doist.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.