Skip to content

Add Notion-synced shift reminders - #303

Open
Flaryiest wants to merge 5 commits into
devfrom
feat/notion-shift-reminders
Open

Add Notion-synced shift reminders#303
Flaryiest wants to merge 5 commits into
devfrom
feat/notion-shift-reminders

Conversation

@Flaryiest

@Flaryiest Flaryiest commented Jul 23, 2026

Copy link
Copy Markdown

TL;DR

Factotum now pings organizers in Discord 10 minutes before their shift starts.
The schedule comes straight from Notion (mirrored into Firestore), replacing
the CSV upload flow.

Description

New Feature.

Notion is now the single source of truth for the shift schedule. A Cloud
Functions sync (separate repo) mirrors the active Notion shift database into
hackathons/{hackathonId}/shifts, and Factotum just reads that mirror. Every
5 minutes the bot sweeps upcoming shifts and schedules a ping in
#shift-reminders at T-10, mentioning organizers who linked their email.
Sent-state lives in a separate reminders collection so Notion edits can
never cause duplicate pings, and shifts deleted or moved in Notion cancel or
reschedule their pending reminder automatically.

Note: reminders only start firing once the Notion sync (Part 2, separate
repo) is deployed.

Why

The CSV flow never made it to prod, and using it would have meant exporting
and re-uploading the schedule every time it changed, with the two copies
drifting apart. Logistics already maintains the schedule in Notion, so the
bot should just read from it. Better to swap this out before anyone starts
using the CSV flow.

User Changes

  • New /link-email: links your Notion email to your Discord account so
    reminders can mention you. Ephemeral, organizer/admin/staff only; admins
    can link on someone else's behalf and re-link a taken email.
  • Reminders post in #shift-reminders (or a channel set via
    reminderChannelId in Firestore). Missed or failed reminders are reported
    in the admin log; paused: true stops pings without a redeploy.
  • /upload-schedule is removed.

Tests Done

  • Live against the dev bot: immediate-ping, scheduled-ping, and already-missed
    paths; deleting a shift before its ping cancels it; moving a start time
    reschedules it (verified nothing fires at the old time).
  • /link-email click-through in the dev guild: fresh link and re-link of a
    taken email, both verified in Firestore.
  • eslint and tsc clean.

Breaking Changes

  • /upload-schedule and the CSV parser are gone. The old command is still
    registered on the bot account and needs a manual removal.
  • Old CSV shift data under command-data/shift-schedule/shifts is ignored
    (inert, safe to delete).

@Flaryiest
Flaryiest force-pushed the feat/notion-shift-reminders branch from 7ff0034 to 0335aac Compare July 23, 2026 21:16
@Flaryiest
Flaryiest requested a review from geoff-jiang July 23, 2026 21:18

@geoff-jiang geoff-jiang left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@Flaryiest Preeemmmmm looks good. Just one last thing - I feel like this feature is somewhat unintuitive and slightly complicated so it would be helpful if added this to the documentation on Notion: https://app.notion.com/p/nwplus/Factotum-Setup-16b14d529faa80e88b42e15e2a67096f?source=copy_link

Could you please add a section that includes:

  • How it works
  • Reminder behaviour (when they are sent, error logging, shifts that already started)
  • the /link-email command
  • The firestore structure (shifts, reminders, organizerMappings)
  • guild configuration (hackathonName needs to match doc ID)
  • reminder configuration doc (channelID and paused)
  • day-of setup and things to check before luanch

Also, I believe the actual staging branch is 'develop', not 'dev' (the codeql-analysis.yml triggers on 'develop'). No need to change the destination branch on this PR, we can just merge to main after and update develop. Just a note for the future 👍

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.

2 participants