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

Error in line 318 (index.js) #29

Open
furkanayilmaz opened this issue Oct 24, 2022 · 6 comments
Open

Error in line 318 (index.js) #29

furkanayilmaz opened this issue Oct 24, 2022 · 6 comments
Labels
bug Something isn't working help wanted Extra attention is needed needs-verification needs to be verified by a maintainer

Comments

@furkanayilmaz
Copy link

When I am trying to run the demo application I am getting the notifications back however, the link is not valid in the notification ( link: 'https://utcloud1.infinitecampus.org/campus/undefinedundefined',)

Not only that looks like there is an error on line 318 (index.js) that is causing problems) #
Screen Shot 2022-10-23 at 6 13 49 PM
Screen Shot 2022-10-23 at 6 13 54 PM

`const InfiniteCampus = require('infinite-campus')
// log in District Name State Username Password
const user = new InfiniteCampus('xxxxx', 'xx', 'xxxxxxxx', 'xxxxxxxx')

// wait until we are done logging in
user.on('ready', () => {
// now that we are logged in...

// get grades from all courses, returns an array of terms containing class information (see docs)
user.getCourses().then((terms) => {
console.log(terms)
// [{name:"Q1", courses: [{name: "1 English", grades:{}, ...}, ...]}, ... ]
})

// get the last 20 notifications
user.getNotifications(20).then((notifications) => {
console.log(notifications)
// [{id: "1111", test: "BOB recieved a new grade of A", timestamp: 1234, read: false, ... }, ...]

// then mark all notifications as read
user.markAllNotificationsRead().then(() => {
    console.log('notifications marked as read...')
})

})

})

// listen for any errors thrown while logging in
user.on('error', (err) => {
console.log('Error while Logging in. Bad credentials.' + err)
})`

@qwazwsx
Copy link
Collaborator

qwazwsx commented Oct 24, 2022

Sorry that you're running into issues. I think this may be related to #28. There's a (currently) undocumented parameter to .getCourses in the case that you are enrolled in multiple schools in I.C. Let me know if messing around with that param yields any results.

Currently, this library is in a weird limbo space when it comes to support because I (the current maintainer) no longer have access to Infinite Campus. I need to go through the list of people who want to become maintainers and set up some kind of system for issue/PR lifecycle stuff.

@qwazwsx qwazwsx added bug Something isn't working help wanted Extra attention is needed needs-verification needs to be verified by a maintainer labels Oct 24, 2022
@furkanayilmaz
Copy link
Author

furkanayilmaz commented Oct 24, 2022

@qwazwsx I have access to Infinite Campus. I am also interested in becoming a maintainer. I would love to help to keep up a great project like this.

@qwazwsx
Copy link
Collaborator

qwazwsx commented Oct 24, 2022

Thanks, @furkanayilmaz! Right now I've got like 4 or 5 people interested, but I haven't had time to reply to anybody just yet. My goal for the maintenance of this library would look like a Trello board or something similar where there is a clear pipeline for issues/requests with checkboxes so that the maintainers are all on the same page and can review and test updates to ensure the stability of this library.

The pipeline might look something like this:
Issue comes in

  • test validity, ask questions, see if it's related to any previous issues or current PRs
  • a maintainer creates a PR fixing the bug
  • PR gets validated by other maintainers
  • PR gets merged to main, version bump, rebuild docs, push update to NPM

Bug Fix PR comes in

  • verify the bug exists
  • maintainers review code
  • test to ensure the bug fix 1) works and 2) doesn't break current functionality
  • push, version bump, update docs if necessary, push to NPM

Enhancement PR comes in

  • ensure that the enhancement is relevant and inside of the scope of the project
  • code review by multiple maintainers
  • test to ensure the enhancement 1) works and 2) doesn't break current functionality
  • push, version bump, update docs if necessary, push to NPM

I think an important part of ensuring the quality, stability, and security of this library going forward is creating a test suite so maintainers can easily test that PR's aren't breaking current functionality. It's difficult because this library has to support a ton of different versions of the I.C. server :(


Anyways, this got a little off-topic. Oops.

The broken notification link is a known issue that needs more investigation. A few months ago I.C. changed the way notifications work which broke this library.

The empty grades[schoolIndex] array issue might be related to #28. I'd try out @sai-nallani's PR to see if that fixes this bug. Currently, this PR is untested (for reasons explained above).

Sorry that I'm not able to provide quality support for this library. Eventually, there will be a gaggle of maintainers here to make sure this library stays alive, but in the interim its a little janky. I appreciate people's patience during this transitional period. :)

@furkanayilmaz
Copy link
Author

@qwazwsx I think you should try zenhub. The company I was working at before was using it. It is very good on keeping track on everything and etc.

About the error, setting the schoolIndex to 0 did seem to fixed the issue.

I am also looking into the issue for the notifications not showing properly. So hopefully I will be able to come up with a good solution.

@furkanayilmaz
Copy link
Author

@qwazwsx Do you know when we can start maintaining this project? Last time, you were saying that you needed to go over list of people who are would like to maintain! Ever since, I haven't heard back and I wanted to check up.

@Ray0716
Copy link

Ray0716 commented Nov 1, 2023

hey - i'd like to help maintain this too; i'm a student as of now and i have access to IC. @qwazwsx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed needs-verification needs to be verified by a maintainer
Development

No branches or pull requests

3 participants