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

Fix Bug That Prevented Editing OH Time #818

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stevenyuser
Copy link
Contributor

Summary

  • Fixed bug that prevented CS 2110 Course Staff from editing start time for a hybrid weekly recurring office hours
  • Description of bug:
    • Essentially, in each of CS 2110's session documents in Firestore, the TALink field was missing
    • When TALink is pulled from the CS 2110 session document, it is undefined
    • This undefined TALink is passed into updateSession (which calls firestore.collection().doc().update()) when one tries to edit OH time
    • This returns an error because updating a document with a field with a value of undefined is unsupported by Firebase
  • Fix:
    • When TALink is undefined, made the default value of TALink an empty string ("")
    • This prevents TALink from being undefined, which allows updateSession / firestore.collection().doc().update() to be called without errors

Test Plan

  • Check that editing office hours session times works

Notes

Breaking Changes

None

  • I have updated the documentation accordingly.
  • My PR adds a @ts-ignore

@stevenyuser stevenyuser requested a review from a team as a code owner March 28, 2024 22:22
@dti-github-bot
Copy link
Member

[diff-counting] Significant lines: 5.

Copy link
Contributor

@NIDHI2023 NIDHI2023 left a comment

Choose a reason for hiding this comment

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

The editing for an existing office hour looks like it's working good! I don't seem to be able to directly add a weekly recurring office hour as a professor (doesn't show up) so I can't actually test editing weekly recurring hybrid office hours though.

Some additional things I saw while testing:

  • In a professor role, when this button is checked for a non-weekly recurring office hours the deletion doesn't seem to work. It works without the checkmark however, and I'm not sure if this has the same behavior for weekly recurring office hours.

image

  • If you try to create an in person office hour that's weekly recurring without a location, you are prompted to put one. If you try to do this for a not weekly recurring office hour, it lets you. Not sure if that was intended or not?

@rgu0114
Copy link
Contributor

rgu0114 commented Apr 15, 2024

The editing for an existing office hour looks like it's working good! I don't seem to be able to directly add a weekly recurring office hour as a professor (doesn't show up) so I can't actually test editing weekly recurring hybrid office hours though.

Some additional things I saw while testing:

  • In a professor role, when this button is checked for a non-weekly recurring office hours the deletion doesn't seem to work. It works without the checkmark however, and I'm not sure if this has the same behavior for weekly recurring office hours.

image

  • If you try to create an in person office hour that's weekly recurring without a location, you are prompted to put one. If you try to do this for a not weekly recurring office hour, it lets you. Not sure if that was intended or not?

@NIDHI2023 It was good that you noticed these other inconsistencies/issues with editing office hours, thanks for doing such thorough testing. To provide a bit of context, those are other things we plan on addressing on dev (sometimes not even a problem on prod) in the future, but unrelated to this PR. The recurring OH deletion especially is a bug we've tried to figure out for a while but haven't found a solution yet.

Copy link
Contributor

@rgu0114 rgu0114 left a comment

Choose a reason for hiding this comment

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

Thanks for providing a simple fix to this bug and providing great detail for the rationale behind it! This will definitely help us solve a pretty pressing issue for 2110, so good work helping us get this out in time for deployment later this week.

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

4 participants