Skip to content

Unify regional topology, parallelize cross-region sync, update DLQ do… - #1040

Merged
temma02 merged 1 commit into
StellerCraft:mainfrom
Emeraldson001:unified-region-topology-dlq-telemetry
Jul 28, 2026
Merged

Unify regional topology, parallelize cross-region sync, update DLQ do…#1040
temma02 merged 1 commit into
StellerCraft:mainfrom
Emeraldson001:unified-region-topology-dlq-telemetry

Conversation

@Emeraldson001

Copy link
Copy Markdown
Contributor

…cs, wire circuit-breaker telemetry

  • Added supabase/functions/_shared/regions.ts as the canonical source for SUPPORTED_REGIONS, per-region env-var resolution, and region detection.
  • Refactor regional-router, regional-auth/auth-utils, regional-health-check, and consistency-validators to import from the shared module, eliminating seven duplicated region-list declarations and two separate url/key lookup tables.
  • Reconciled the router's broader country-code mapping (NZ/HK for ap-southeast) into the single source of truth.
  • Converted syncUserProfileAcrossRegions() from sequential for...of to concurrent Promise.allSettled, bounded by the slowest region rather than the sum of all regions. Include per-region duration in the return value and propagate it through sign-up.ts audit logging.
  • Updated docs/webhook-dead-letter-queue.md to describe the implemented automatic retry schedule (1m/2m/4m/8m/16m/32m ±10% jitter), circuit-breaker thresholds (5 failures → 1-hour pause), and DLQAutoRecovery config surface.
  • Add injectable onCircuitStateChange callback to DLQRecoveryConfig and wire it into _circuitFor()'s onStateChange handler for ops-dashboard integration.
  • Added unit tests for concurrent sync bounding and injected circuit-breaker telemetry.

Closes #988
Closes #990
Closes #991
Closes #992

…cs, wire circuit-breaker telemetry

- Add supabase/functions/_shared/regions.ts as the canonical source for
  SUPPORTED_REGIONS, per-region env-var resolution, and region detection.
- Refactor regional-router, regional-auth/auth-utils, regional-health-check,
  and consistency-validators to import from the shared module, eliminating
  seven duplicated region-list declarations and two separate url/key lookup
  tables.
- Reconcile the router's broader country-code mapping (NZ/HK for ap-southeast)
  into the single source of truth.
- Convert syncUserProfileAcrossRegions() from sequential for...of to
  concurrent Promise.allSettled, bounded by the slowest region rather than
  the sum of all regions. Include per-region duration in the return value
  and propagate it through sign-up.ts audit logging.
- Update docs/webhook-dead-letter-queue.md to describe the implemented
  automatic retry schedule (1m/2m/4m/8m/16m/32m ±10% jitter), circuit-breaker
  thresholds (5 failures → 1-hour pause), and DLQAutoRecovery config surface.
- Add injectable onCircuitStateChange callback to DLQRecoveryConfig and wire
  it into _circuitFor()'s onStateChange handler for ops-dashboard integration.
- Add unit tests for concurrent sync bounding and injected circuit-breaker
  telemetry.
@drips-wave

drips-wave Bot commented Jul 27, 2026

Copy link
Copy Markdown

@Emeraldson001 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

@temma02
temma02 merged commit b7fd6c9 into StellerCraft:main Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment