Skip to content

Conversation

AustinBenoit
Copy link

Description

Provide details of the change, and generalize the change in the PR title above.

Add support for Firebase Storage emulator via UseEmulator.


Testing

Describe how you've tested these changes. Link any manually triggered Integration tests or CPP binary SDK Packaging Github Action workflows, if applicable.

Tested this manually via unity for Desktop, Android, iOS. See the photos below:

image image image

Type of Change

Place an x the applicable box:

  • Bug fix. Add the issue # below if applicable.
  • New feature. A non-breaking change which adds functionality.
  • Other, such as a build process or documentation change.

Notes

  • Bug fixes and feature changes require an update to the Release Notes section of release_build_files/readme.md.
  • Read the contribution guidelines CONTRIBUTING.md.
  • Changes to the public API require an internal API review. If you'd like to help us make Firebase APIs better, please propose your change in a feature request so that we can discuss it together.

@gemini-code-assist
Copy link

Summary of Changes

Hello @AustinBenoit, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the Firebase Storage SDK by adding support for the Firebase Storage emulator. This feature allows developers to test their applications against a local, emulated backend, which can greatly improve development speed, reduce costs associated with cloud usage, and enable offline testing scenarios. The implementation ensures that the emulator can be configured across all supported platforms before any storage operations are performed.

Highlights

  • Firebase Storage Emulator Support: Introduced a new UseEmulator method in the Storage API, allowing developers to connect to a local Firebase Storage emulator instead of the default remote backend.
  • Cross-Platform Implementation: The emulator support has been implemented across Android, iOS, and Desktop platforms, ensuring consistent functionality.
  • Usage Requirement: The UseEmulator method must be called before any other Storage API methods are invoked on a new instance of Storage to properly configure the connection. The default port for the emulator is 9199.
  • URL Construction Logic Update: Refactored the internal URL construction logic to dynamically use the configured host, port, and scheme, enabling seamless switching between remote and emulated backends.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@AustinBenoit AustinBenoit requested review from HYACCCINT and cynthiajoan and removed request for HYACCCINT October 21, 2025 21:09
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds support for using the Firebase Storage emulator across Android, iOS, and desktop platforms. The changes are well-structured, introducing a new UseEmulator method to the public API and implementing it for each platform.

My review has identified a few issues:

  • An uninitialized member variable in the desktop implementation which could lead to undefined behavior.
  • The use of debug-only assertions for input validation in the iOS implementation, which would be stripped in release builds.
  • A minor formatting inconsistency in the release notes.

I've provided suggestions to address these points. Overall, this is a great addition to the SDK.

Comment on lines +103 to +105
NSCAssert(host && host[0] != '\0', @"Emulator host cannot be null or empty.");

NSCAssert(port > 0, @"Emulator port must be a positive number.");

Choose a reason for hiding this comment

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

high

NSCAssert is a debug-only assertion and is stripped from release builds. This leaves the host and port parameters unvalidated in release builds, which could lead to crashes or other undefined behavior if invalid values are passed. It's better to use runtime checks that are present in all build configurations to ensure robustness.

  if (!(host && host[0] != '\0')) {
    LogError("Emulator host cannot be null or empty.");
    return;
  }

  if (!(port > 0)) {
    LogError("Emulator port must be a positive number.");
    return;
  }

AustinBenoit and others added 4 commits October 21, 2025 17:12
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
To get the url to show up correctly the storage path now depends upon
the storage internal to query for the host and port
@AustinBenoit AustinBenoit added the tests-requested: quick Trigger a quick set of integration tests. label Oct 22, 2025
@github-actions github-actions bot added tests: in-progress This PR's integration tests are in progress. and removed tests-requested: quick Trigger a quick set of integration tests. labels Oct 22, 2025
@github-actions
Copy link

github-actions bot commented Oct 22, 2025

✅  Integration test succeeded!

Requested by @AustinBenoit on commit b4de53c
Last updated: Wed Oct 22 14:25 PDT 2025
View integration test log & download artifacts

@github-actions github-actions bot added the tests: failed This PR's integration tests failed. label Oct 22, 2025
@firebase-workflow-trigger firebase-workflow-trigger bot removed the tests: in-progress This PR's integration tests are in progress. label Oct 22, 2025
@AustinBenoit AustinBenoit added tests-requested: quick Trigger a quick set of integration tests. and removed tests: failed This PR's integration tests failed. labels Oct 22, 2025
@github-actions github-actions bot added tests: in-progress This PR's integration tests are in progress. tests: failed This PR's integration tests failed. and removed tests-requested: quick Trigger a quick set of integration tests. labels Oct 22, 2025
@firebase-workflow-trigger firebase-workflow-trigger bot removed the tests: in-progress This PR's integration tests are in progress. label Oct 22, 2025
@AustinBenoit AustinBenoit added tests: in-progress This PR's integration tests are in progress. tests-requested: quick Trigger a quick set of integration tests. and removed tests: failed This PR's integration tests failed. tests: in-progress This PR's integration tests are in progress. labels Oct 22, 2025
@github-actions github-actions bot added tests: in-progress This PR's integration tests are in progress. and removed tests-requested: quick Trigger a quick set of integration tests. labels Oct 22, 2025
Copy link
Contributor

@a-maurice a-maurice left a comment

Choose a reason for hiding this comment

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

LGTM, but should wait until the API review has been handled before submitting

@github-actions github-actions bot added the tests: succeeded This PR's integration tests succeeded. label Oct 22, 2025
@firebase-workflow-trigger firebase-workflow-trigger bot removed the tests: in-progress This PR's integration tests are in progress. label Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests: succeeded This PR's integration tests succeeded.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants