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 clearing out exceptions for experience-cs I noticed this exception in editor-api which appears to reveal a bug in the code:
NoMethodError
undefined method `id' for nil:NilClass (NoMethodError)
ProfileApiClient.list_school_students(token:, school_id: school.id, student_ids:).map do |student|
^^^
The error is caused when the school passed in to #list_students is nil, which appears to be possible because of this line in Project.users. The pluck(:school_id) returns an array of all school_ids for the current Project scope. My guess is that in some cases the first entry in the array of school_ids is nil, which means we execute School.find_by(id: nil) which returns nil. An alternative guess is that the school_id isn't nil but somehow doesn't correspond to an ID in the schools table. I think the second guess is less likely due to the foreign key constraint on projects and schools but I don't know for sure.
The text was updated successfully, but these errors were encountered:
Flagging this for your attention, @adrian-rpf. There are 18k instances of this in Sentry so it might be worth investigating (assuming you haven't already) in case it's causing a real problem for users.
While clearing out exceptions for experience-cs I noticed this exception in editor-api which appears to reveal a bug in the code:
The error is caused when the
school
passed in to#list_students
is nil, which appears to be possible because of this line inProject.users
. Thepluck(:school_id)
returns an array of all school_ids for the currentProject
scope. My guess is that in some cases the first entry in the array of school_ids is nil, which means we executeSchool.find_by(id: nil)
which returnsnil
. An alternative guess is that the school_id isn't nil but somehow doesn't correspond to an ID in the schools table. I think the second guess is less likely due to the foreign key constraint on projects and schools but I don't know for sure.The text was updated successfully, but these errors were encountered: