Skip to content

fix: use the EU endpoint for flag streaming - #88

Closed
pcbeingused33 wants to merge 1 commit into
amplitude:mainfrom
pcbeingused33:fix/eu-streaming-endpoint-c8945
Closed

pcbeingused33 wants to merge 1 commit into
amplitude:mainfrom
pcbeingused33:fix/eu-streaming-endpoint-c8945

Conversation

@pcbeingused33

@pcbeingused33 pcbeingused33 commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

With streaming enabled and ServerZone.EU selected, the SDK used the US streaming endpoint by default because the constructor compared the streaming URL with the default polling URL. That comparison also replaced an explicitly supplied streaming URL if it happened to match the polling default. Compare against the default streaming URL so EU clients use https://stream.lab.eu.amplitude.com by default and keep custom streaming URLs.

python -m unittest tests.local.config_test ran eight tests. Two assertions failed before the fix and all eight tests passed afterward. The tests cover the default EU and US endpoints and custom URLs in the EU zone.

Checklist

  • The PR title follows Conventional Commits.
  • Breaking change? No.

AI assistance was used to prepare the patch and regression tests.


Note

Low Risk
Single conditional fix in config URL selection with new unit tests; no auth or data-path changes.

Overview
Fixes EU local evaluation clients defaulting to the US streaming host when stream_updates is enabled.

The constructor was rewriting stream_server_url only when it equaled DEFAULT_SERVER_URL (the flag polling API), so the default streaming URL never matched and EU zone never switched to https://stream.lab.eu.amplitude.com. Custom stream URLs that happened to equal the polling default could also be overwritten incorrectly. The EU branch now compares against DEFAULT_STREAM_URL instead.

Regression tests assert default EU/US streaming endpoints and that explicit stream_server_url values are preserved in the EU zone.

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

@kyeh-amp kyeh-amp left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good. The EU branch now compares against the default streaming URL, so EU clients get the EU stream host and custom URLs are kept. The unit tests failed here only because fork runs lack repo secrets; the same commit passes all checks in #89.

@kyeh-amp

kyeh-amp commented Dec 4, 2026

Copy link
Copy Markdown
Collaborator

Thank you for the fix and the regression tests, Alex. This is a real bug for EU customers who use streaming, and the write-up made it quick to review.

Our test workflow needs repository secrets, and GitHub does not give them to runs from forks. So the tests failed here even though the change is correct. To get a clean CI run, we copied your branch into #89. That PR takes precedence over this one and is the one we will merge.

#89 contains your exact commit (c1fb5a8), so you stay the commit author. The merge commit will also credit you as co-author.

kyeh-amp added a commit that referenced this pull request Dec 4, 2026
Use the EU stream URL when the stream server URL is the default and the server zone is EU. Originally contributed in #88.

Co-authored-by: Alex <alex.castillog33@gmail.com>
@kyeh-amp kyeh-amp closed this Dec 5, 2026

This branch was successfully deployed

1 active deployment
Unit Test — c1fb5a82 Deployed Dec 4, 2026 by kyeh-amp via test (3.8) #242
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