Add account based multiplayer hosting and bug report retention

This commit is contained in:
2026-10-10 16:24:34 +05:00
parent 9af71c85c2
commit fc6da6756d
33 changed files with 1538 additions and 102 deletions

View File

@@ -24,6 +24,20 @@ comments remain internal. Player follow-ups appear in Linear with
`#user-report-message`; the initial report uses the same prefix in its description.
Editing an existing comment does not send another message.
Players can select **Close report** after support has received it. The conversation
shows **Done**, becomes read-only, and displays its deletion date. MineGeo moves
the matching Linear issue to the team's **Done** status. Staff can also post the
exact command `#player-report-close`, or move the issue to Done in Linear.
Three days after closing, a durable Vercel Workflow deletes the Linear issue,
both the original and normalized Supabase screenshots, the local report, and its
messages. It runs even when nobody visits support. Linear's normal deleted-issue
trash retention still applies. Username glow and Bug finder rewards already
granted to an account remain. Guest rewards must be linked before the report is
deleted. Reopening the issue in Linear before cleanup starts cancels deletion;
closing it again starts a new three-day period. Repeated close requests and
replayed staff commands do not extend the existing deadline.
To grant or remove the actual account reward, add a separate new comment:
```text
@@ -49,17 +63,21 @@ badges by copying a registered player's display name.
## Deployment setup
Apply `20261008071054_bug_reports.sql` and `20261008075322_profile_identity.sql`
Apply `20261008071054_bug_reports.sql`, `20261008075322_profile_identity.sql`, and
`20261010053310_bug_report_retention.sql`
before deploying. Production environment
variables in Vercel:
- `LINEAR_API_KEY`: sensitive personal API key with Read, Create issues, and
Create comments access to the support team.
- `LINEAR_API_KEY`: sensitive personal API key with **Read and Write** access to
the support team. Create issues/comments alone cannot update status or delete
issues. If needed, create a replacement in Linear **Settings → Security & access
→ Personal API keys**, then replace this variable in Vercel **Production** and
redeploy. Never paste the key into chat.
- `LINEAR_WEBHOOK_SECRET`: sensitive signing secret of the team's Linear webhook.
- `LINEAR_TEAM_ID`: support team UUID.
- `LINEAR_PROJECT_ID`: optional project UUID or Linear project identifier.
Enable **Comment** events on the team webhook and set its URL to
Enable **Comment and Issue** events on the team webhook and set its URL to
`https://minegeo.vercel.app/api/support/linear`. Redeploy after saving environment
variables. Keys stay server-side and must never be pasted into issue descriptions,
client configuration, or source uploads.
@@ -68,7 +86,18 @@ Webhook requests require a matching raw-body HMAC signature and a timestamp
within 60 seconds. Duplicate events have no effect. Delivery to Linear happens
after the HTTP response; opening the conversation retries interrupted or failed
delivery. The page shows saved/pending and delivered states.
Issue events immediately synchronize Done/reopened states. Opening the inbox or
conversation also checks status, at most once per minute per report, as a fallback.
If Linear or Storage deletion fails, the local report is retained for retries;
the conversation shows a retry action if cleanup exhausts its automatic retries.
Keep Vercel's **Enable access to System Environment Variables** setting enabled
for durable timers. No additional secret or cron is needed.
Validation: `npm test`, `npm run typecheck`, `npm run build`, and
`node scripts/test-bug-reports-sql.mjs` (uses the isolated PGlite installation under
`.data/sql-verification`, as the other SQL verification scripts do).
`node scripts/test-bug-retention-http.mjs https://minegeo.vercel.app` verifies
the deployed flow with a clearly labeled temporary report and screenshot. It
checks ownership, Done synchronization, the three-day deadline, and deletion
from both systems by advancing only that test report's deadline. The fixture ID
is journaled under the ignored `.data/retention-check` directory for recovery.

View File

@@ -11,6 +11,10 @@ and re-publication do not create new-map announcements. Existing maps from befor
this integration are not backfilled.
In an open multiplayer lobby, the host can select **Publish party to Discord**.
Hosting requires a signed-in account and always uses its stored Display Name.
Signed-in players join with account names; guests can join with nicknames.
If the host leaves, another signed-in player takes over; the party closes if
only guests remain.
All published parties go to the single server-wide `DISCORD_PARTIES_CHANNEL_ID`.
Players cannot choose a destination. Discord readers can open the invite and join
without a MineGeo account while the lobby is open and has space. Messages show

View File

@@ -60,6 +60,7 @@ additional Supabase credentials.
Multiplayer uses the Supabase migration described in [multiplayer.md](multiplayer.md).
Apply that migration to a new database before deploying the multiplayer web files.
Room chat also requires `20261007155622_multiplayer_chat.sql` before the web update.
Account-only party hosting requires `20261010053429_multiplayer_account_hosts.sql`.
Map ZIP sharing requires `20261007145000_map_sharing.sql`. Imported maps stay
private and can be played without moderation; publication is blocked. See
@@ -70,6 +71,10 @@ The script targets the existing MineGeo project. Set `VERCEL_PROJECT_ID` and
Player bug reporting requires `20261008071054_bug_reports.sql` and the Linear
server credentials described in [bug-reports.md](bug-reports.md). Configure the
Comment webhook before deploying so staff replies and glow commands reach players.
Comment and Issue webhook events before deploying so staff replies, glow commands,
and status changes reach players. Report retention also requires
`20261010053310_bug_report_retention.sql` and a Linear API key with Read and Write
permissions. Closed reports move to Done and are deleted from MineGeo and Linear
after three days through a durable workflow; no cron job is required.
Glow colors and user prefixes also require `20261008075322_profile_identity.sql`
before deploying the updated account, catalog, and multiplayer pages.