Skip to content

fix(i18n,email): request-aware validation i18n, bounce suppression, C… - #1314

Merged
nanaf6203-bit merged 2 commits into
MettaChain:mainfrom
fadee26:fix/i18n-validation-email
Sep 25, 2026
Merged

nanaf6203-bit merged 2 commits into
MettaChain:mainfrom
fadee26:fix/i18n-validation-email

Conversation

@fadee26

@fadee26 fadee26 commented Sep 24, 2026

Copy link
Copy Markdown

Summary

Closes #1237
Closes #1234
Closes #1233
Closes #1232

#1237 – I18nService failure/fallback coverage

  • Specs for malformed JSON → empty catalogue + warn, missing files, dual-load failure.
  • RFC 7231 edges: empty header, q=0, wildcard *, equal-q ordering.
  • Interpolation with missing params; nested lookup through arrays/non-objects.
  • Parser now skips q=0 and pure * tags.

#1234 – ValidationPipe uses request language

  • Added src/common/request-language.store.ts (AsyncLocalStorage).
  • Middleware in main.ts stores Accept-Language / x-language / user.languagePreference.
  • exceptionFactory reads the store and passes acceptLanguageHeader + userPreference into i18n.translate (no longer hard-coded undefined).

#1233 – Bounce-aware send suppression

  • shouldSuppressAddress() counts recent HARD bounces and COMPLAINED events (90-day window, threshold 1).
  • sendEmail skips queueing when suppressed; also skips emailStatus === 'BOUNCED'.
  • Specs cover suppress / allow paths.

#1232 – Unsubscribe URL from ConfigService

  • Removed module-level const UNSUBSCRIBE_URL = process.env.FRONTEND_URL ….
  • buildListUnsubscribeHeader reads FRONTEND_URL via ConfigService at call time and uses buildUnsubscribeUrl.
  • Specs assert different config values produce different List-Unsubscribe headers.

Test plan

npm test -- --testPathPattern='i18n.service|email.service'
# optional e2e: request with Accept-Language: es should return Spanish validation messages

@drips-wave

drips-wave Bot commented Sep 24, 2026

Copy link
Copy Markdown

@fadee26 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@nanaf6203-bit nanaf6203-bit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@fadee26 please resolve conflicts

@nanaf6203-bit
nanaf6203-bit merged commit 5d6530b into MettaChain:main Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants