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

Improve getCourseDataFromCourseCritique Data Flow #301 #314

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

iphonecats
Copy link
Contributor

@iphonecats iphonecats commented Mar 26, 2024

Summary

Resolves #301

Improves data flow of getting course data from course critique by checking firestore cache from client side before invoking the cloud function invocation to get course data

Checklist

  • Branch from main
  • Refer to the development firebase project (ask EM for access) for more information on how course_critique_course_data_cache is structured. Also read https://github.com/gt-scheduler/firebase-conf/blob/main/functions/src/course_critique_cache.ts to figure out how to decode information stored in this collection as well as what the fields signify.
  • Edit the fetchGpa function in src/data/beans/Course.ts (this function is called in src/Components/Course/index.tsx to populate the UI) to now first check firestore for a valid cache entry (this code can be taken from the cloud function) after an invalid entry is found in localStorage and then proceed to make a cloud function call only when localStorage and firebase have an invalid entry. The code currently only checks localStorage.
  • Do thorough testing to make sure this entire flow works as expected.

How to Test

add courses to scheduler, put logs into Course.ts to see when calls are made to API and Database

Copy link

github-actions bot commented Mar 26, 2024

PR Preview Action v1.4.7
🚀 Deployed preview to https://gt-scheduler.github.io/website/pr-preview/pr-314/
on branch gh-pages at 2024-03-26 21:23 UTC

@yatharth-b yatharth-b marked this pull request as ready for review April 8, 2024 18:53
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.

[BoG S24] Improve getCourseDataFromCourseCritique Data Flow
2 participants