Set webhook payload timestamp at event occurrence time #8
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.
Addresses remaining review comment from PR #7: webhook payload timestamps were being set inside the
Sendmethod after goroutine dispatch, introducing delays between event occurrence and recorded timestamp.Change
Set
Timestampfield when constructing the payload, before launching the background goroutine:Previously,
time.Now()was called insideSend, which executed after goroutine scheduling delays. Timestamps now accurately reflect when events occurred (bootstrap failures, health transitions, circuit renewals), not when HTTP requests were initiated.The
Sendmethod still defaults the timestamp if not set (backwards compatibility), but all callers now provide explicit timestamps.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
192.0.2.1/tmp/go-build206135023/b270/tor.test /tmp/go-build206135023/b270/tor.test -test.testlogfile=/tmp/go-build206135023/b270/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true 0.1-go1.25.0.lin--gdwarf-5(packet block)/tmp/go-build408908709/b273/tor.test /tmp/go-build408908709/b273/tor.test -test.testlogfile=/tmp/go-build408908709/b273/testlog.txt -test.paniconexit0 -test.timeout=10m0s go1.25.0 -c=4 -nolocalimports -importcfg /tmp/go-build661516655/b123/importcfg -pack /home/REDACTED/work/Torarr/Torarr/internal/notify/webhook.go /home/REDACTED/work/Torarr/Torarr/internal/notify/webhook_test.go(packet block)/tmp/go-build3874705941/b275/tor.test /tmp/go-build3874705941/b275/tor.test -test.testlogfile=/tmp/go-build3874705941/b275/testlog.txt -test.paniconexit0 -test.timeout=10m0s TlQdabMKoXb-i_IKrIRy/TlQdabMKoXb-i_IKrIRy -goversion go1.25.0 -c=4 -race -nolocalimports -importcfg /tmp/go-build3874705941/b194/importcfg(packet block)https://api.github.com/repos/eslutz/Torarr/pulls/7/reviews/home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.