fix: isolate public subscribe from integration job failures

Queue Weeztix/Mailwizz after the HTTP response and catch dispatch errors.
Jobs log Mailwizz/Weeztix API failures without rethrowing so sync driver
and terminating callbacks do not surface 500s after a successful create.

Add JS fallback for non-JSON error responses, deployment note, and a
regression test for failing Mailwizz under QUEUE_CONNECTION=sync.

Made-with: Cursor
This commit is contained in:
2026-04-05 11:47:59 +02:00
parent d802ce2a7c
commit de83a6fb76
6 changed files with 102 additions and 27 deletions

View File

@@ -47,6 +47,18 @@ class SyncSubscriberToMailwizz implements ShouldBeUnique, ShouldQueueAfterCommit
}
public function handle(): void
{
try {
$this->runSync();
} catch (Throwable $e) {
Log::error('SyncSubscriberToMailwizz: integration failed; subscriber remains local (use admin resync if needed)', [
'subscriber_id' => $this->subscriber->id,
'message' => $e->getMessage(),
]);
}
}
private function runSync(): void
{
$subscriber = Subscriber::query()
->with(['preregistrationPage.mailwizzConfig'])