Skip to content

Sync: dev to main - #810

Merged
aamoghS merged 16 commits into
mainfrom
dev
Nov 27, 2026
Merged

aamoghS merged 16 commits into
mainfrom
dev

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Automated PR tracking changes from dev into main.

aamoghS and others added 16 commits November 26, 2026 22:31
One row per user holding the Discord account of judges and volunteers, who have no participant row to hold it. Additive only.
One typed roles model (hacker, judge, volunteer) decides who may link and what the Linked Roles PUT carries. A hacker needs the I'm coming confirmation; approved judges and volunteers link without a registration, stored in discord_link. The callback returns each role to the page its card lives on.
…r hackers

Judges see the card on the judge page and volunteers on the check-in desk, told joining is required. An accepted hacker who has not said they are coming is asked to confirm before the invite, and the dashboard step says so.
…irm first

The judge approval and added emails say joining is required and point to the portal step. The acceptance email asks a hacker to confirm they're coming before joining.
Two more boolean fields, five in all. A test keeps the registered keys equal to what the link sends.
… re-run

Lists the three roles and who holds each, where the link is stored, the five metadata keys, the Linked Roles requirements for the judge and volunteer roles, and that the operator re-runs the metadata script.
Four nullable columns: the sealed access and refresh tokens, their expiry, and the last published roles signature. Additive only.
The callback now stores the person's OAuth tokens, AES-256-GCM encrypted under a key derived from AUTH_SECRET. syncDiscordRoles re-derives the roles and publishes them, all zeros for someone who holds none, and runs after a judge, volunteer or hacker loses a role, on unlink, and when a different Discord account is linked (the old one is cleared first). The daily cron route also zeroes volunteers whose term has ended. All five fields are now always sent.
Covers the stored tokens and their encryption, what triggers a sync, the daily volunteer sweep, and the manual step for links made before tokens were kept.
A per-user advisory lock now covers derive, refresh, publish and write-back. Without it two refreshes could leave one with invalid_grant and drop the link, two publishes could land out of order, and a stale sync could put roles back on an account an unlink had just cleared. Network failures are caught at the call so the locked transaction still commits.
When a role sync was last tried for the link, so the daily job can take the one tried longest ago first. Additive, nullable.
A batch status change or a ban now marks all affected linked people as owing a sync in the same transaction, then syncs what the request has time for. The daily job takes the pending ones, oldest attempt first. A sync that does not land leaves its link pending instead of looking done.
…r starved

A link whose tokens are missing or will not open now gets a terminal roles_sig ('unreachable') after one try and leaves the daily job. Links that fail for any other reason stay pending but go to the back, since the sweep takes the one tried longest ago first.
A person linked as a judge who is moved to approved (having said they are coming) now gains the hacker roles at once, in a single change and in a batch, after the flower is assigned. Nothing is sent when nothing changed.

The admin-flow unit tests that mock the database now stub the Discord bookkeeping, and the Discord database test deletes each case's editions as it goes, so it no longer crowds the shared database's edition list.
The sweep takes at most 15 people a run and stops after 20 seconds, so it cannot push the cron route past its caller's deadline; what it does not reach stays pending for the next day. The route's comment and a new test pin that a Scheduler retry cannot mail a reminder twice, since each draft is stamped as taken before its mail is sent.
…teers

Feature: feat/discord-judges-volunteers to dev
@github-actions

Copy link
Copy Markdown
Contributor Author

@greptileai

@cursor

cursor Bot commented Nov 27, 2026

Copy link
Copy Markdown

Bugbot is paused — your team has an unpaid invoice

Bugbot is paused because your team has an unpaid invoice.

Pay it from the billing page in the Cursor dashboard and Bugbot resumes automatically.

(requestId: 429e54b8-90da-4b68-96c7-90545651b17f)

@github-actions

Copy link
Copy Markdown
Contributor Author

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@github-actions

Copy link
Copy Markdown
Contributor Author

Visit the preview URL for this PR (updated for commit 51153ac):

https://hacklytics2027--pr-810-cc6sqoty.web.app

(expires Fri, 04 Dec 2026 04:51:34 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: c48ba34db61581e25fe2978355160b5eefe0e83f

@aamoghS
aamoghS merged commit 7254f7e into main Nov 27, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant