webhooks/legacy: fetch subscriptions upfront
This fixes a race condition when delivering webhooks for resource
deletion events, in which the subscriptions would be removed from the
delete cascade before the task to fetch them executes. This requires the
downstream code to call Queue before committing the delete transaction,
and updates the API to include a context argument for the connection
pool.
Remove %e formatting verbs
%e is not valid for formatting error values:
> %e scientific notation, e.g. -1.234456e+78
Instead, use %w when using fmt.Errorf (for error wrapping) and
%v when using log.Printf (%w is not valid in that context).
Deduplicate webhook headers on subsequent attempts
This also updates the database with the final payload headers, including
the signature and nonce, which are generated afresh for each attempt.
webhooks/legacy: increase specificity of logging
workers/legacy: correct Println with fmt directive
Make worker logs less loud
webhooks/legacy: address Postgres-specific issues
webhooks/legacy: update only affected delivery
Forgot to add this where clause, whoops!
Add legacy webhooks worker implementation