Skip to content

chore: update example rendering and endpoint handling - #86

Merged
ianmeyer merged 2 commits into
mainfrom
ianmeyer/fixes-26-11-20
Dec 2, 2026
Merged

ianmeyer merged 2 commits into
mainfrom
ianmeyer/fixes-26-11-20

Conversation

@ianmeyer

@ianmeyer ianmeyer commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Render Django and Flask example responses with templates.
  • Validate custom endpoint URLs before sending SDK requests.

Checks

  • Passed 118 SDK tests on Python 3.14.
  • Checked all eight updated example routes and Django revenue input validation.

Checklist

  • PR title follows the repository conventions.
  • Custom endpoint URLs must use HTTP or HTTPS.

Note

Medium Risk
Touches core HTTP send and retry paths, but the logic change is narrow—invalid URLs fail fast instead of being retried like transient errors.

Overview
Example apps now render several success responses through shared HTML templates instead of inline strings. Django uses render with message.html; Flask uses render_template and slightly tidies group-name handling in a few routes. Page-load and flush responses are unchanged.

SDK behavior for custom server_url: HttpClient.post rejects URLs that are not absolute http/https with a host before calling the network, returns a Response with retryable=False, and documents that custom endpoints must be trusted absolute HTTP(S) URLs. ResponseProcessor only re-queues events on timeout/5xx/unknown when res.retryable is true, so misconfigured URLs fail immediately via callbacks without storage retries. A worker test covers invalid URLs (no urlopen, no retry, callbacks with code -1).

Reviewed by Cursor Bugbot for commit 8115cfd. Bugbot is set up for automated code reviews on this repo. Configure here.

@ianmeyer
ianmeyer force-pushed the ianmeyer/fixes-26-11-20 branch from b3a43ae to 86ca245 Compare November 20, 2026 16:19
@ianmeyer
ianmeyer marked this pull request as ready for review November 20, 2026 16:21
@ianmeyer
ianmeyer requested a review from a team as a code owner November 20, 2026 16:21

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 86ca245. Configure here.

Comment thread src/amplitude/http_client.py Resolved
@ianmeyer
ianmeyer force-pushed the ianmeyer/fixes-26-11-20 branch from e96ca35 to 8115cfd Compare December 2, 2026 23:45
@ianmeyer
ianmeyer requested a review from a team as a code owner December 2, 2026 23:45
@ianmeyer
ianmeyer merged commit bc405e4 into main Dec 2, 2026
14 checks passed
@ianmeyer
ianmeyer deleted the ianmeyer/fixes-26-11-20 branch December 2, 2026 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants