issue-09 #98

Open
kenneth4 wants to merge 5 commits from issue-09 into main
Member

Description

Users can now filter the Group Finder by their Google Calendar availability. With "Only times I'm free" turned on, groups that overlap a busy time on the user's primary calendar are hidden. The Profile page shows a small Google Calendar connection status with a Connect link.

How it works:

  1. A new endpoint, GET /api/v1/calendar/busy, calls Google's FreeBusy API on the server with the existing connection and returns only busy time ranges. It uses the calendar.freebusy scope that we already request.

  2. A group counts as one hour from its start time, because groups have no end time and the Calendar events we create for them are one hour long. A group that only touches a busy time at its edge stays visible. Groups the user joined are never hidden.

  3. To protect our Google quota from abuse, the server allows 10 Google calls per user per minute and 1,000 overall, and reuses a user's last result for 60 seconds. Ranges must start now or later and cover at most 60 days. The counters are in memory, which is correct because Kennel runs one app instance per environment.

I chose a live lookup over importing and storing busy times. It is always current, needs no schema change, and stores no calendar data.

N/A

Closes #9

Type of change

New Feature

Testing

  • I added/updated tests.
  • I tested my changes locally.
    • I tested my changes with a laptop-size screen.
    • I tested my changes with a phone-size screen.
    • I tested my changes with a tablet-size screen.
  • I tested on the kennel preview deployment for this pull request.

Screenshots/Recordings

Checklist

  • My code follows the project's existing style.
  • I have reviewed my changes.
  • Only the necessary files and lines have been changed.
  • This PR is ready for review.
## Description Users can now filter the Group Finder by their Google Calendar availability. With "Only times I'm free" turned on, groups that overlap a busy time on the user's primary calendar are hidden. The Profile page shows a small Google Calendar connection status with a Connect link. How it works: 1. A new endpoint, GET /api/v1/calendar/busy, calls Google's FreeBusy API on the server with the existing connection and returns only busy time ranges. It uses the calendar.freebusy scope that we already request. 2. A group counts as one hour from its start time, because groups have no end time and the Calendar events we create for them are one hour long. A group that only touches a busy time at its edge stays visible. Groups the user joined are never hidden. 3. To protect our Google quota from abuse, the server allows 10 Google calls per user per minute and 1,000 overall, and reuses a user's last result for 60 seconds. Ranges must start now or later and cover at most 60 days. The counters are in memory, which is correct because Kennel runs one app instance per environment. I chose a live lookup over importing and storing busy times. It is always current, needs no schema change, and stores no calendar data. ## Related Issue N/A Closes #9 ## Type of change New Feature ## Testing <!-- "- [ ]" creates an unchecked checkbox. "- [X]" creates a checked checkbox. For each item you have completed, just replace the space inside with an X. --> - [X] I added/updated tests. - [X] I tested my changes locally. - [X] I tested my changes with a laptop-size screen. - [ ] I tested my changes with a phone-size screen. - [ ] I tested my changes with a tablet-size screen. - [X] I tested on the kennel preview deployment for this pull request. ## Screenshots/Recordings <!-- If this includes a UI change, attach screenshots on both laptop and mobile. --> ## Checklist - [X] My code follows the project's existing style. - [X] I have reviewed my changes. - [X] Only the necessary files and lines have been changed. - [X] This PR is ready for review.
docs: describe free/busy reading in privacy policy and calendar docs
All checks were successful
nixbot/nix-eval evaluation succeeded in 0s (1 warning)
nixbot/nix-build 0 attributes built
kennel/build build succeeded
kennel/deploy deployment healthy
Test / Unit tests (pull_request) Successful in 1m28s
Test / Integration tests (pull_request) Successful in 2m27s
7291caf864

Kennel Deployments

Service URL
web https://study-web-pr-98.scottylabs.net

Last updated for commit 7291caf.

<!-- kennel-deployment --> ### Kennel Deployments | Service | URL | | --- | --- | | web | https://study-web-pr-98.scottylabs.net | Last updated for commit `7291caf`.
Member

Why is there a separate button on the profile page to connect Google Calendar? Why isn't that just automatically triggered if a user checks the box and calendar is not connected? What if a user has already made a group (which triggers a google calendar connection to create the event)? Will that connection allow filtering, or do they still have to connect again? The goal should be fewer clicks for users, so there shouldn't be any connection on the profile. Instead, clicking the filter checkbox should automatically check if google calendar has been connected before (either by making a group or using the filter previously), and if so, should immediately filter, if not, should trigger the connection popup.

Why is there a separate button on the profile page to connect Google Calendar? Why isn't that just automatically triggered if a user checks the box and calendar is not connected? What if a user has already made a group (which triggers a google calendar connection to create the event)? Will that connection allow filtering, or do they still have to connect again? The goal should be fewer clicks for users, so there shouldn't be any connection on the profile. Instead, clicking the filter checkbox should automatically check if google calendar has been connected before (either by making a group or using the filter previously), and if so, should immediately filter, if not, should trigger the connection popup.
All checks were successful
nixbot/nix-eval evaluation succeeded in 0s (1 warning)
nixbot/nix-build 0 attributes built
kennel/build build succeeded
Required
Details
kennel/deploy deployment healthy
Required
Details
Test / Unit tests (pull_request) Successful in 1m28s
Required
Details
Test / Integration tests (pull_request) Successful in 2m27s
Required
Details
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin issue-09:issue-09
git switch issue-09
Sign in to join this conversation.
No description provided.