Repository navigation
fix: use the EU endpoint for flag streaming - #88
pcbeingused33 wants to merge 1 commit into
Conversation
kyeh-amp
left a comment
There was a problem hiding this comment.
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.
|
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. |
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>
Summary
With streaming enabled and
ServerZone.EUselected, 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 usehttps://stream.lab.eu.amplitude.comby default and keep custom streaming URLs.python -m unittest tests.local.config_testran 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
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_updatesis enabled.The constructor was rewriting
stream_server_urlonly when it equaledDEFAULT_SERVER_URL(the flag polling API), so the default streaming URL never matched and EU zone never switched tohttps://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 againstDEFAULT_STREAM_URLinstead.Regression tests assert default EU/US streaming endpoints and that explicit
stream_server_urlvalues 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.