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

Create a function to check if the best_attempt table needs to be updated upon attempt submission #95

Closed
6 tasks done
Gehrkej opened this issue Apr 4, 2024 · 3 comments
Assignees
Labels
data-layer Firestore, Tanstack, caching, pagination, etc. priority-medium Major bug fix / feature request

Comments

@Gehrkej
Copy link
Contributor

Gehrkej commented Apr 4, 2024

Issue Description:

Currently upon an attempt being submitted the best_attempt table in the database is not being checked and updated if needed.

To-do:

  • Fetch best_attempts collection for a drill
  • Isolate the best attemepts for a given user
    - [ ] Iterate through all aggOutputs and compare if the new attempt is better (use "lowerIsBetter field" to determine this)
  • Update the given field if the new attempt is better

Updated To-dos (4-26-2024)

  • More testing on empty leaderboard (no attempts on the board). For testing, delete current entries from an existing leaderboard (in "best_attempts" table of Firebase console)
  • Do a bit of manual testing for race case (2 different devices / accounts, try to submit drill at same time)
  • Remove unused code to avoid future confusion (updateLeaderboard hook, setManualAttempt stuff in leaderboard.js, etc)

Other Notes:

  • Utilize both the updateLeaderboard and useLeaderboard hooks/functions to accomplish this. They are in the /hooks directory
@Gehrkej
Copy link
Contributor Author

Gehrkej commented Apr 5, 2024

Note: comments on #94 have been made where this function will go. A new feature branch will be made for this issue though

@solderq35 solderq35 added priority-medium Major bug fix / feature request data-layer Firestore, Tanstack, caching, pagination, etc. labels Apr 6, 2024
@Gehrkej Gehrkej self-assigned this Apr 9, 2024
@Gehrkej
Copy link
Contributor Author

Gehrkej commented Apr 19, 2024

I have this functional for how the "best_attempts" table is currently structured with only having one criterion as well as having each drill being a map/object. See PR #161 for more information.

@Gehrkej
Copy link
Contributor Author

Gehrkej commented Apr 25, 2024

this issue has merged with #150

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data-layer Firestore, Tanstack, caching, pagination, etc. priority-medium Major bug fix / feature request
Projects
None yet
Development

No branches or pull requests

2 participants