Skip to content

fix: guild-language DMs + one active submission per person#178

Merged
Musiker15 merged 1 commit into
mainfrom
fix/bot-locale-and-single-submission
Jul 2, 2026
Merged

fix: guild-language DMs + one active submission per person#178
Musiker15 merged 1 commit into
mainfrom
fix/bot-locale-and-single-submission

Conversation

@Musiker15

Copy link
Copy Markdown
Member

Two customer-reported issues.

1. Bot DMs ignored the guild's configured language

Applicant status/message DMs were localized to the recipient's own Discord locale, so a guild that set its bot language to Hungarian still saw applicants receive English/German DMs (screenshots showed a Hungarian form with English and German status DMs).

Fix: applicant DMs now use the guild's botConfig.locale when it is set (consistent with the review embeds and activity log), falling back to the applicant's Discord locale, then English. A guild that hasn't picked a language keeps the per-applicant behavior.

2. A signed-in applicant could submit the same form repeatedly

New per-form setting "One active submission per person" (default on, toggle in the builder's settings section).

  • While a signed-in applicant has an open (non-terminal) submission, opening the form redirects them to that submission's status page.
  • The submit endpoint rejects a duplicate with 409 + the existing submission id, and the form renderer redirects to the status page.
  • Once a reviewer sets a terminal status (accepted/rejected/withdrawn, or a custom def flagged terminal) the applicant may apply again.
  • Enforced only for signed-in applicants; anonymous submissions can't be tied to a person. Can be turned off per form for surveys/feedback forms that accept repeated submissions.

Details

  • shared: isTerminalStatus() + singleSubmission flag and singleSubmissionEnforced() helper on form settings (JSON, no migration; carried through export/import).
  • lib/forms: findActiveSubmissionId().
  • i18n: builder.singleSubmissionLabel/singleSubmissionHint in all 7 locales.
  • Unit tests for isTerminalStatus and singleSubmissionEnforced.

Checks

Typecheck, lint, test (shared 83 / web 40 / bot 4), build all green.

Note

Issue 1 only takes effect once the guild has set its bot language (Bot settings page or /forms language). For the Hungarian server in the screenshots, set the bot language to Hungarian after deploy.

Two customer-reported issues.

1) Bot DMs ignored the guild's configured language. Applicant status/message
   DMs were localized to the recipient's own Discord locale, so a guild that
   set its bot language to (e.g.) Hungarian still saw English/German DMs. DMs
   now use the guild's botConfig.locale when set (matching the review embeds
   and activity log), falling back to the applicant's Discord locale, then
   English.

2) A signed-in applicant could submit the same form repeatedly. New per-form
   setting "One active submission per person" (default on, toggle in the
   builder): while the applicant has an open (non-terminal) submission they are
   redirected to its status page instead of the form, and the submit endpoint
   rejects a duplicate with 409 + the existing submission id (the renderer then
   redirects). Once a reviewer sets a terminal status (accepted/rejected/
   withdrawn or a custom terminal status) they may apply again. Enforced only
   for signed-in applicants — anonymous submits can't be tied to a person.

- shared: isTerminalStatus() + singleSubmission flag/helper on formSettings
- lib/forms: findActiveSubmissionId()
- i18n: builder.singleSubmissionLabel/Hint in all 7 locales
- tests for isTerminalStatus and singleSubmissionEnforced
@Musiker15 Musiker15 merged commit 3a63a7f into main Jul 2, 2026
3 checks passed
@Musiker15 Musiker15 deleted the fix/bot-locale-and-single-submission branch July 2, 2026 06:03
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