| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
This pull request refactors the FunctionsApiClient to cache the CLOUD_TASKS_EMULATOR_HOST environment variable at construction time rather than reading it dynamically from process.env during execution. This cached value is then propagated to FunctionsHttpClient and helper functions, and corresponding unit tests have been added and updated. The feedback suggests improving the robustness of the environment variable parsing by trimming whitespace and treating empty strings as undefined, as well as simplifying the unit tests by utilizing a single stub with sequential call assertions instead of manual stub restoration.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Historically, CLOUD_TASKS_EMULATOR_HOST was read from process.env on every individual API call. This made it impossible to safely run one Firebase app pointing to the local emulator and another pointing to a real project concurrently.
This pull request resolves the issue by caching the value of CLOUD_TASKS_EMULATOR_HOST once when the FunctionsApiClient is constructed. The configuration is stored per-instance, ensuring that each client retains its own independent emulator setup.
Based on a patch contribution #3059 (comment)