Skip to content

One failing pixel keeps the remaining pixels from receiving the event #20

Open

Description

@loevgaard

Problem

Client::sendPreparedEvent() sends one request per pixel, in order, and throws at the first pixel that fails: a ResponseException when Meta answers anything but a 200, a TransportException when the HTTP client fails. The pixels after the failing one are never attempted.

Take an event with pixels A, B and C, where B's access token has expired:

  1. A is sent and succeeds.
  2. B is sent, Meta answers 400, and the client throws.
  3. C is never attempted, even though nothing is wrong with C.

Consequences:

  • C loses the conversion because of B's problem. This is the same "one pixel blocks the others" situation that Skip pixels without an access token instead of rejecting the whole event #19 fixed for pixels without an access token, only caused by Meta's answer instead of a missing token.
  • In a queue it gets worse. If the handler retries, A receives the event again, B fails again, and C is still never reached, until someone fixes B. If the handler gives up instead, C's conversion is lost for good.
  • The exception does not tell the whole story. It says nothing about A having succeeded or C having been skipped, so the caller cannot react sensibly.

The current behaviour is pinned on purpose by ClientTest::it_stops_at_the_first_pixel_that_gets_an_unsuccessful_response.

Direction

Treat the pixels as independent destinations: attempt every pixel, remember which ones failed and why, and throw once at the end.

Things that need deciding:

  • A new exception that holds several failures, e.g. one ResponseException / TransportException per failed pixel, keyed by pixel id. It should implement ExceptionInterface like everything else. What does it extend, and what is its own message?
  • What it reports about the pixels that succeeded, so that a caller knows what was delivered.
  • A clean way to retry only the failed pixels. Probably a PreparedEvent narrowed to those pixels, either built by the exception or through something like PreparedEvent::withPixels().
  • Whether a retry decision can be made per pixel. A transient 5xx for one pixel and an expired token for another call for different handling.
  • A single failing pixel. Should an event with one pixel still throw the plain ResponseException / TransportException, or always the new exception?

Notes

Activity

  1. added
    enhancement
    on Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions