Skip to content

feature: informational warning sanction - #436

Merged
lukepolo merged 6 commits into
mainfrom
feature/warning-sanction
Sep 29, 2026
Merged

lukepolo merged 6 commits into
mainfrom
feature/warning-sanction

Conversation

@lukepolo

@lukepolo lukepolo commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Adds an informational warning sanction: a note on a player's record that is never enforced, never expires, and can only be seen by the player and by moderators.

  • New warning type. It requires a reason, skips RCON and server sync, and sets no ban/mute/gag flags. A trigger forces remove_sanction_date to NULL.
  • unsanction takes an optional sanction_id. A warning must be removed by id, and the call fails with "sanction not found" if no row matched.
  • Hasura select filters hide warnings from guests and from other users. The plugin feed and the search sanctions count only include ban/mute/gag/silence.
  • Only the warned player gets a PlayerWarning notification. It never goes to Discord or to team-mates.

Merge/deploy: stacked on #432 (merge that first); ship with web#621. After deploy: api boot → yarn hasura:metadata → Hasura metadata reload → yarn codegen.

Tests: sanction-not-found, the refusal to clear warnings by type, the plugin-feed filter, the end-date trigger, the visibility permissions and the search count (new test) each fail without their code. Manual QA: after the metadata reload, warn a player, then confirm they get the notification and a signed-out visitor can't see the warning. Based on DEAFCS 0c961eb, 1c21cb5

…upport notification text

- reply to the web client's ping with a pong so a dead-but-OPEN socket is detectable
- only a ban notifies former team-mates; mutes/gags/silences stay between the player and staff
- only administrators can delete a player row
- check-in error names team admins as well as the captain
- name change requests link the player's profile (absolute url, Discord-routed)
- match support notification names the requester, fixes the title typo, and requires the caller be in the lineup
@lukepolo
lukepolo force-pushed the bug/deafcs-sync-fixes branch from 95d14bd to 95853a0 Compare September 28, 2026 21:44
- new `warning` sanction type: requires a reason, never expires (tbiu trigger nulls remove_sanction_date), never touches a server
- getActiveServerSanctions only serves ban/mute/gag/silence to the plugin
- unsanctionServerPlayer takes an optional sanction_id; a warning can only be removed by id
- PlayerWarning notification to the warned player only (account push category, instant-unseen, off Discord, not mutable in the bell)
- warnings are hidden from guests and other players, visible to the warned player and moderators; excluded from the search sanction count
- generated types hand-patched for the new enum values and action arg
- removing a sanction by id fails with "sanction not found" when no row matched instead of reporting success
- search sanction count lists the enforced types rather than naming `warning`, so indexing survives a Hasura that has not reloaded the enum yet
- SanctionType and the enforced-type list live in sanction-types.ts; importing SanctionsService from type-sense would have closed a cycle through RconService
@lukepolo
lukepolo deleted the branch main September 29, 2026 00:32
@lukepolo lukepolo closed this Sep 29, 2026
# Conflicts:
#	generated/schema.ts
#	hasura/enums/notification-types.sql
#	src/hasura/metadata-permissions.spec.ts
#	src/notifications/notifications.service.spec.ts
#	test/notifications.spec.ts
@lukepolo lukepolo reopened this Sep 29, 2026
@lukepolo
lukepolo changed the base branch from bug/deafcs-sync-fixes to main September 29, 2026 00:35
@lukepolo
lukepolo merged commit 790a7d5 into main Sep 29, 2026
2 checks passed
@lukepolo
lukepolo deleted the feature/warning-sanction branch September 29, 2026 00:35
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.

1 participant