Apple notification forward never blocks our own processing #1

Open
warren wants to merge 1 commits from task2194531/forward-never-blocks into master
First-time contributor

Why. The APPLE_PROXY_HOST forward runs before the notice is stored. It has no timeout and no error handling, so when the forward target is down, every Apple notice throws: Apple gets a 500, and nothing is stored, queued or sent to AppsFlyer.

That has been happening on cdlbackend since 2025-06-16. It forwards to analytics.mapo.la/webhooks/13/apple, which no longer answers. The last row in cdlmapola.apple_notifications is 2025-06-16 14:11:52, and laravel.log shows about 130 cURL error 28: Failed to connect to analytics.mapo.la port 443 errors a day. dmvbackend's configmap forwards to the same dead host (/webhooks/42/apple), so it is most likely in the same state.

What changes.

  1. The forward waits at most proxy_timeout seconds (new config key, env APPLE_PROXY_TIMEOUT, default 5) for both connect and response.
  2. If the forward fails, a warning is logged and the backend carries on with its own processing as before.
  3. Deployments without APPLE_PROXY_HOST are unaffected.

Tested on the live cdl pod's PHP 7.4 / Laravel 7.30.6, with the patched classes loaded in memory (no files changed in the pod):

  • dead host analytics.mapo.la: the warning was logged and the code reached its own processing after 5.02 s
  • live host analytics2.appchair.com/apple_notification/prep.cdl/: 200, reached own processing after 0.3 s

It only takes effect in a deployment once its image is rebuilt (composer dev-master).

🤖 Generated with Claude Code

**Why.** The `APPLE_PROXY_HOST` forward runs before the notice is stored. It has no timeout and no error handling, so when the forward target is down, every Apple notice throws: Apple gets a 500, and nothing is stored, queued or sent to AppsFlyer. That has been happening on cdlbackend since 2025-06-16. It forwards to `analytics.mapo.la/webhooks/13/apple`, which no longer answers. The last row in `cdlmapola.apple_notifications` is 2025-06-16 14:11:52, and laravel.log shows about 130 `cURL error 28: Failed to connect to analytics.mapo.la port 443` errors a day. dmvbackend's configmap forwards to the same dead host (`/webhooks/42/apple`), so it is most likely in the same state. **What changes.** 1. The forward waits at most `proxy_timeout` seconds (new config key, env `APPLE_PROXY_TIMEOUT`, default 5) for both connect and response. 2. If the forward fails, a warning is logged and the backend carries on with its own processing as before. 3. Deployments without `APPLE_PROXY_HOST` are unaffected. **Tested** on the live cdl pod's PHP 7.4 / Laravel 7.30.6, with the patched classes loaded in memory (no files changed in the pod): - dead host `analytics.mapo.la`: the warning was logged and the code reached its own processing after 5.02 s - live host `analytics2.appchair.com/apple_notification/prep.cdl/`: 200, reached own processing after 0.3 s It only takes effect in a deployment once its image is rebuilt (composer `dev-master`). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
warren added 1 commit 2026-11-17 07:05:11 +00:00
The APPLE_PROXY_HOST forward runs before the notice is stored, with no
timeout and no error handling. When the target is down, every notice
throws, Apple gets a 500 and nothing is stored or sent to AppsFlyer.
cdlbackend (analytics.mapo.la/webhooks/13) and dmvbackend (/42) have
been in that state since 2025-06-16.

Now the forward waits at most proxy_timeout seconds (APPLE_PROXY_TIMEOUT,
default 5) and a failure is only logged as a warning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
warren requested review from rjgonzale 2026-11-17 07:05:17 +00:00
You are not authorized to merge this pull request.
This pull request can be merged automatically.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin task2194531/forward-never-blocks:task2194531/forward-never-blocks
git checkout task2194531/forward-never-blocks
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rjgonzale/laravel-appstore-notifications#1