feat(webhooks): include app_instance_uuid in app instance webhook payloads - #257
Merged
Conversation
…loads The `app_instance.created` / `app_instance.status_changed` payloads only carried `app_instance_id`, Polydock's internal auto-increment id. Consumers never see that id: the API returns `uuid` when an instance is created, and `uuid` is the route key for the instance endpoints. So a receiver holding a uuid had no way to resolve an incoming webhook back to the instance it had provisioned. Add `app_instance_uuid` alongside the existing id, pin the identifying payload fields in a test, and document the app instance payload shape in docs/WEBHOOKS.md. Purely additive — no existing field changes, so current consumers are unaffected. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…l and pin it with a test
dan2k3k4
approved these changes
Aug 6, 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.
Problem
The
app_instance.createdandapp_instance.status_changedwebhook payloads identify the instance only byapp_instance_id— Polydock's internal auto-increment id.Consumers never see that id. The API returns
uuidwhen an instance is created, anduuidis the route key for the instance endpoints (getRouteKeyName()returns'uuid'). A receiver holding a uuid therefore has no way to resolve an incoming webhook back to the instance it provisioned, short of an extra API round trip per delivery — and there is no endpoint to look an instance up by internal id anyway.This blocks MOAD, which correlates inbound Polydock webhooks to the outbound create call by uuid.
Change
CreateWebhookCallForAppInstanceStatusChangedaddsapp_instance_uuidto the payload, alongside the existingapp_instance_id.tests/Feature/Listeners/CreateWebhookCallForAppInstanceStatusChangedTest.phppins the identifying payload fields for both event types.docs/WEBHOOKS.mdgains an "App instance events" section documenting the payload shape and stating thatapp_instance_uuidis the identifier to key on. Sensitive-data wording matches the actualgetWebhookSafeData()behaviour: sensitive keys are always redacted, the flag only re-adds the generated app-admin credentials.uuidcolumn existed (2025-03-21), soapp_instance_uuidis never null in a payload.Purely additive: no existing field is renamed, removed, or changed, so current consumers are unaffected.
Testing
vendor/bin/pint --test,phpstan analyseand the fullphp artisan testsuite (577 passed) run clean locally. Also verified against the incoming QA-tooling ratchet (#256): its rector config and PHPStan max+strict analysis are clean on these files, so merging both branches in either order won't trip the new CI gates.🤖 Generated with Claude Code
Greptile Summary
The PR adds the public app-instance UUID to instance webhook payloads and documents the updated contract.
Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains.
Important Files Changed
Sequence Diagram
sequenceDiagram participant Migration participant DB as App Instance Database participant Model as App Instance participant Listener as Webhook Listener participant Receiver as Webhook Consumer Migration->>DB: Backfill legacy null UUIDs Model->>Listener: Created or status-changed event Listener->>DB: Store webhook call with ID and UUID Listener-->>Receiver: Queued signed delivery Receiver->>Receiver: Correlate using app_instance_uuidReviews (3): Last reviewed commit: "fix(webhooks): close inter-chunk null-uu..." | Re-trigger Greptile
Context used (3)