PropelAuth webhooks in production: duplicates, ordering, retries and timeouts

Published · Updated

This guide covers the problems PropelAuth webhooks cause in production and how to handle each one. What PropelAuth sends is on the PropelAuth webhooks overview, every event is on PropelAuth webhook events, and signature verification code is on Verify PropelAuth webhooks.

At a glance

ProblemWhat to doWith Event Gateway
TimeoutsStore the event, return a 2xx quickly and process in a background jobAccepts the delivery at once, then queues it for your service
DuplicatesRecord each svix-id and skip repeatsDrops repeats before they reach your handler
OrderingFetch the current record when user.updated or org.updated arrivesLogs every event and attempt, so you can see arrival order when debugging
RetriesStay available, and reconcile from the API after an outageAccepts deliveries while your service is down and replays them
Choosing eventsSubscribe to what you handle, and check the waitlist event namesFilters and routes each event type from a single source
TestingUse a test endpoint, and read a real delivery before you write a routerForwards to localhost and shows the full request
Other limitsTreat email events as part of sign-in, and don't rely on source IPsStores each event until your service has processed it

PropelAuth webhook timeouts and slow handlers

Return a 2xx quickly and do the work in a background job. PropelAuth publishes no response timeout. Svix, which delivers its webhooks, documents 30 seconds to return a 2xx, and PropelAuth doesn't say whether it changes that.

Why it happens: Handlers for these events tend to call other services: signing a new user up to a mailing list, provisioning resources, updating billing or sending an email through your own provider. A handler that waits for them all can run past the limit, and Svix treats anything other than a 2xx, including a redirect, as a failed delivery.

Fix it in your handler:

  1. Verify the signature, store the raw event and return 200.
  2. Do the slow work in a worker. See why to process webhooks asynchronously.
  3. Point the endpoint at its final URL, because a redirect counts as a failure.

With Event Gateway: Hookdeck accepts each PropelAuth delivery immediately, then queues events and delivers them to your service at a rate it can handle, with its own retries. Your handler can take as long as it needs without failing a PropelAuth delivery.

Duplicate PropelAuth webhooks

A resent message keeps its svix-id, so record each id you process and skip repeats. PropelAuth's own pages don't discuss duplicates; the id's behaviour comes from Svix's documentation.

Why it happens: PropelAuth retries webhooks that fail. A delivery that times out or gets a non-2xx response is sent again, even if your handler had already done the work.

Fix it in your handler:

  1. Track processed svix-id values, using a database table with a unique constraint. See our guide to webhook idempotency.
  2. Make handlers with side effects safe to run twice. Fetching a user again is harmless, while sending a second password reset email isn't.

With Event Gateway: Hookdeck deduplicates events before they reach your endpoint, so repeats are filtered at the infrastructure level rather than in each handler.

Out-of-order PropelAuth webhooks

A PropelAuth webhook can arrive out of order, so don't let arrival order decide what your database holds. PropelAuth designs for this: user.updated and org.updated carry only the ID.

Why it happens: A retried delivery can land after a later change has already reached you. PropelAuth's answer is to record only the user_id or org_id on these two events and ask you to fetch the latest information from its API, so an older delivery has nothing to overwrite newer data with.

Fix it in your handler:

  1. When user.updated or org.updated arrives, fetch the current record from PropelAuth's API and store that.
  2. If several updates to one user arrive close together, queue the fetch with a short delay so one read covers them. Fetch after the last update, not after the first, or you can keep stale data.
  3. For other events, fetch too if your data must match PropelAuth. For more on the general problem, see Webhook Ordering: Why It's Hard and How to Handle It.

With Event Gateway: Hookdeck logs every event and delivery attempt, so you can see the order things arrived in when you're debugging. Your handler still needs the steps above.

PropelAuth webhook retries

PropelAuth says its webhooks "are retried if they fail" and publishes no schedule, so plan to reconcile from its API after a long outage.

Why it happens: Delivery is Svix's job. Svix documents 8 attempts over about 27 hours: immediately, then after 5 seconds, 5 minutes, 30 minutes, 2 hours, 5 hours, 10 hours and 10 hours. After that the message is marked as failed, and Svix can disable an endpoint once every attempt has failed for 5 days. PropelAuth doesn't say whether it keeps these defaults.

Fix it in your handler:

  1. Return a 2xx only once you've stored the event, so a failure gets retried.
  2. After an outage, read current users and organisations from PropelAuth's API rather than assuming every event will arrive.
  3. Check the endpoint is still enabled in the dashboard after a long outage. PropelAuth's docs don't describe disabled endpoints, or say whether you can resend a message by hand.

With Event Gateway: Hookdeck accepts PropelAuth's deliveries while your service is down, retries towards your service on a schedule you set, and lets you replay anything that failed, so PropelAuth's unpublished retry window matters less.

Choosing which PropelAuth events to receive

Subscribe each endpoint to the events you handle. PropelAuth documents 41: 12 for organisations, 17 for users and 12 for emails, listed on PropelAuth webhook events.

Why it happens: The list mixes data changes with events most integrations don't need, such as user.login and user.logged_out, which can fire far more often than sign-ups do. The email.* events are separate again, because they ask you to do a job.

Fix it in your subscriptions:

  1. To copy users and organisations into your database, start with user.created, user.updated, user.deleted, org.created, org.updated, org.deleted, user.added_to_org, user.removed_from_org and user.role_changed_within_org.
  2. Subscribe to email.* events only for the emails you've switched to Webhook delivery. The Send Emails page lists the variables each one carries, except email.otp_login, which it doesn't list.
  3. Check the waitlist names before you wire them up. On both of PropelAuth's pages, email.waitlist_user_invitation is the sign-up email that confirms an address, and email.waitlist_user_confirmation is the invitation off the list. It's easy to assume the reverse.

With Event Gateway: Hookdeck can filter and route events from one PropelAuth source to different destinations, once you've confirmed where the event type sits in the body. See the Testing section.

Testing PropelAuth webhooks

Use a test endpoint and read a real delivery before you write a router, because PropelAuth's public docs don't name the field that holds the event type.

Why it's hard: PropelAuth says each payload includes the event type and any relevant information. Its public pages name no field and publish no complete body. The one public example, a screenshot of the catalogue entry for user.added_to_org, shows user_id, org_id and role and no event-type key. Svix doesn't add the type itself: it leaves that to the sender, and suggests type, event_type or eventType as common choices. PropelAuth also doesn't state which header prefix it uses, and Svix can rename its headers from svix-* to webhook-*.

Test it like this:

  1. Add an endpoint for your test environment and read the event catalogue in the dashboard, which PropelAuth says has examples of each event.
  2. Trigger a real event, such as signing up a test user, and log the headers and body of the first delivery. Base your router on that.
  3. Log and acknowledge any event your router doesn't recognise, so a new type doesn't show up as a failure.
  4. Switch emails to Webhook in Test first. PropelAuth lets you set this per environment, so you can check your handler before Prod.

Keep separate endpoints and secrets for test and production. A test secret in production fails every delivery, and a shared URL mixes test users into production data.

With Event Gateway: The Hookdeck CLI receives webhooks on your machine without a public server, shows each request in full, and lets you replay past events. A replayed message keeps its original svix-timestamp, so the Svix libraries reject it more than five minutes later; Verify PropelAuth webhooks explains the options.

Other PropelAuth webhook limits

Plan for email events and network rules before they reach production.

Email webhooks are part of sign-in. Every email starts on PropelAuth, and once you switch one to Webhook, PropelAuth no longer sends it. If your handler drops email.confirmation_email or email.reset_password, users can't confirm an address or reset a password. Alert on failures for these events and process them first, and retry your email provider separately from the webhook.

Action links in logs. Most email events carry an action_url, such as the link that confirms an address. Keep it out of your logs and treat stored copies of those bodies as sensitive.

No published source IPs. PropelAuth publishes no IP list and doesn't reference Svix's, so rely on the signature to authenticate requests, not on an allowlist.

With Event Gateway: Hookdeck stores each PropelAuth event until your service has processed it, so an outage in your email handler delays a password reset email instead of losing it. You can replay failed events once the handler is back.

Keep an outage from losing a PropelAuth password reset.

Hookdeck Event Gateway accepts every PropelAuth delivery, verifies its signature, stores each event and delivers it at a rate your service can handle, with replay for anything that fails.

Not affiliated with PropelAuth. Facts are compiled from public sources and linked inline.