Conversation
When CreatePublisher fails (e.g. invalid GCP credentials), the error was treated as a PreDeliveryError which caused a nack/retry loop until messages hit the Pub/Sub DLQ — invisible to the customer. Now: - GCP Pub/Sub CreatePublisher returns ErrDestinationPublishAttempt for validation and client creation errors - Registry creates a failed attempt when ResolvePublisher returns ErrDestinationPublishAttempt or ErrDestinationValidation - GCP credential JSON is validated for required 'type' field at destination creation time Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
alexbouchardd
approved these changes
Apr 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CreatePublisherfails (e.g. invalid GCP service account credentials missing thetypefield), the error was wrapped as aPreDeliveryErrorwhich caused a nack → retry loop until messages exhausted Pub/Sub max delivery attempts and landed in the DLQ — completely invisible to the customerservice_account_json(valid JSON but missing required GCP fields). The delivery worker couldn't create a Pub/Sub client, nacked every attempt, and the events silently went to DLQ after 6 retriesChanges
destgcppubsub.go— Destination-level fixes:CreatePublishernow returnsErrDestinationPublishAttempt(instead of plain errors) for bothresolveMetadatafailures (validation_failed) andpubsub.NewClientfailures (client_creation_failed), signaling to the registry that these are delivery errorsresolveMetadatanow validates thatservice_account_jsoncontains the requiredtypefield, catching invalid credentials at destination creation timeregistry.go— Registry-level safety net:PublishEventnow checks forErrDestinationPublishAttemptandErrDestinationValidationfromResolvePublisherand creates a failed attempt record instead of returningnil— this ensures the error flows through theAttemptErrorpath (logged to ClickHouse, visible in dashboard, retry-scheduled then acked) instead of thePreDeliveryErrorpath (nack → DLQ)Error flow before
Error flow after
Test plan
missing type field in service_account_json— rejects atValidate()timemissing type field - but passes with emulator endpoint— emulator skips credential validationCreatePublisherreturningErrDestinationPublishAttempt→ failed attempt returnedCreatePublisherreturningErrDestinationValidation→ failed attempt returnedCreatePublisherreturning unknown error → nil attempt (existing behavior preserved)🤖 Generated with Claude Code