Skip to content

fix crash#5

Closed
kevmoo wants to merge 101 commits intoinvertase:masterfrom
kevmoo:fix_crash
Closed

fix crash#5
kevmoo wants to merge 101 commits intoinvertase:masterfrom
kevmoo:fix_crash

Conversation

@kevmoo
Copy link
Copy Markdown

@kevmoo kevmoo commented Mar 20, 2026

lisajian and others added 30 commits February 25, 2026 22:35
* Update FDC local toolkit to v3.2.0

* Formatting

* Add PR number
* Add a firebase studio export command under an experiment flag.

* typescript conversion

* Refactored to a folder, cleaned up, tested

* Added tests

* Cleanup

* Lint

* Reorganize

* Flags and comment fixes

* Lint

* shrinkwrap
* Firebase Functions can handle an Extensions outage

* Add tests for getting the list of active extensions succeeding or failing

* Update message
* Fixing bad implementation of isFirebaseMCPP

* formats
firebase#9960)

* add FIREBASE_TOOLS_*_EMULATOR_VERSION to allow pinning emulator version

* add test

* fix lint issue

* change FIREBASE_TOOLS_*_EMULATOR_VERSION to *_EMULATOR_VERSION

* revert .mocharc.yml change

* better error message for invalid versions

---------

Co-authored-by: Joe Hanley <joehanley@google.com>
This tool is missing from OneMCP server. Add the local wrapper back for now.
firebase#9899)

* Update yaml format for appdistribution:testcases:import/export

* Update apptesting MCP yaml format to match test-cases-in-code format (firebase#9900)

* Keep AiStep type using successCriteria field to match API

* Add note to MCP prompt that the final screen assertion is required for the last step

* Revert WATA changes
* Fix apptesting:execute

The test case was not being converted to use the success_criteria field before including it in the request

* Update tests

* Add javadoc
* Observe the project (ID) flag

* Add AGY workaround - don't check for AGY if we're not going to open it

---------

Co-authored-by: Joe Hanley <joehanley@google.com>
Initial refactor for moving secret logic to index.ts (firebase#10010)
* update fdc emulator to 3.2.1

* changelog

* fix naming
* Flip resolvers flag.

* Update changelog.
* Add support for additional Next.js config file types

- Updated CONFIG_FILES to include "next.config.ts" and "next.config.mts".
- Modified logic in ɵcodegenFunctionsDirectory to handle new config file types.
- Added unit tests for whichNextConfigFile to ensure correct file detection and prioritization.

* cleanup pathExists stub usage in Next.js utils tests

* update comment

* changelog
* GA4 tracking with framework.
christhompsongoogle and others added 25 commits March 16, 2026 20:10
* Ask the user which backend they want to use. This is a little crude in that it quits if invalid but it can be re-ran.
…base#10107)

* Delte mcp.json if it exists since this will only be confusing to the user.

* Test
…10055)

* Update the error message for missing path to be friendlier
* feat: Add dart delegate

* feat: add support for hot reloading

* fix: wait for build_runner initial build to complete

* fix rooting

* emulator update

* update functions.yaml directory

* clean run on emulator

* clear project

* improve runtime checks

* merge fixes

* clean

* Fixing feedback from Gemini

* compile before deploy

* remove placeholder runtime

* cross compiling

* emulator fix

* fix rooting

* fix emulator detection

* skipping compilation in emulator run

* clean output

* prevent duplicate watches

* dart entry point and min dart version enforcing

* change entry point to bin/server.dart

* update template

---------

Co-authored-by: Elliot Hesp <elliot.hesp@gmail.com>
Co-authored-by: Darren Ackers <ackers86@hotmail.com>
)

* Add explicit genkit versioning for upgrading genkit-cli.
* Add changelog entry for new apptesting:execute command

* Add trailing newline

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>
…rebase#10128)

* If no binary passed to apptesting:execute, use latest App Distribution release

* Simplify if condition

* Fix formatting
* Update fs emulator to 1.20.4

* remove unrelated change

---------

Co-authored-by: Joe Hanley <joehanley@google.com>
Co-authored-by: Kushal Palesha <3357451+kushalpalesha@users.noreply.github.com>
* Add support for setting DataAccessMode in firebase.json

* Dont change defaults

* Regen schema;

* pr fixes
* Initial commit for adding the ability to pass the runtime flag

* Add some unit tests and improve wording

* Fix unit tests, handle undefined runtimes more explicitly

* Use default runtime variable and dedupe test code

* Add ABIU fields to backend creation in our CLI (also includes ability to pass the runtime)

* Fix formatting/linter errors

* Guard this behind an experiment flag

* Update backends:list to only show ABIU in the column if the flag is enabled

* Make it so ABIU flags only show up if the experiment flag is enabled

* Make our logic for runtime more lenient. If it's not defined, assume it is ""

* Improve test coverage, make runtime default to ""

* Default runtime is "nodejs"

* Update runtime to be more risilient to empty string values

* Also display the "runtime" field when listing backends

* Polish fixes

---------

Co-authored-by: Aryan Falahatpisheh <aryanf@google.com>
Co-authored-by: Joe Hanley <joehanley@google.com>
@kevmoo kevmoo closed this Mar 20, 2026
@kevmoo kevmoo deleted the fix_crash branch March 20, 2026 01:44
@kevmoo kevmoo restored the fix_crash branch March 20, 2026 01:45
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, 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 delivers a substantial upgrade to the Firebase CLI, focusing on expanding developer capabilities and improving workflow efficiency. Key advancements include the integration of Dart as a supported runtime for Firebase Functions, offering more flexibility for backend development. App Hosting receives significant enhancements with new controls for backend configuration and a streamlined secret management command. The App Testing experience is made more robust with flexible test execution options and better error handling. Furthermore, critical emulator components are updated to their latest versions, and the migration path for Firebase Studio projects to Antigravity is made smoother with automated setup and improved framework detection. These changes collectively aim to provide a more powerful, stable, and user-friendly development environment.

Highlights

  • Dart Functions Support: Introduced a new Dart runtime delegate for Firebase Functions, enabling Dart projects to be built, watched, and deployed, including cross-compilation for Cloud Run.
  • App Hosting Enhancements: Added new options for specifying runtime and controlling automatic base image updates during App Hosting backend creation, alongside a new apphosting:secrets:set command and improved YAML configuration loading.
  • App Testing Improvements: The apptesting:execute command now supports running tests without a local binary (using the latest App Distribution release) and offers a non-blocking mode.
  • Emulator Updates: Updated Firestore Emulator to v1.20.4, Pub/Sub Emulator to v0.8.29, and Data Connect Emulator to v3.3.0, and added support for environment variable overrides for emulator versions.
  • Data Connect Schema Management: Enhanced PostgreSQL schema handling in Data Connect to allow specifying schema names and added support for dataAccessMode in Firestore configurations within firebase.json.
  • Firebase Studio Migration to Antigravity: Significantly improved the migration process, including framework detection (Next.js, Angular, Flutter), automated setup of Antigravity skills, and configuration of Firebase and Dart MCP servers.
  • Build Process Modernization: Migrated gsutil commands to gcloud storage in various scripts and documentation, and ensured npm is always updated to the latest version in Docker builds.
  • Crash Fixes and Stability: Addressed a crash in the Storage emulator related to invalid JWTs and improved error handling for App Hosting deployments and extensions API outages.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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.

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.

Copy link
Copy Markdown

@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 is a large pull request that includes a critical crash fix, several new features, and numerous improvements. The main fix addresses a crash in the Storage emulator when handling invalid JWTs. Key new features include Dart support for Cloud Functions, a studio:export command for migrating Firebase Studio projects, and direct VPC support for GCFv2. I've identified a couple of areas for improvement related to Node.js best practices, such as using asynchronous file system operations and avoiding deprecated APIs.

Comment on lines +25 to +46
if (fs.existsSync(rootPath) && fs.statSync(rootPath).isFile() && rootPath.endsWith(".zip")) {
logger.info(`⏳ Unzipping ${rootPath}...`);
const parsedPath = path.parse(rootPath);
let extractDirName = parsedPath.name;
if (!extractDirName || extractDirName === ".") {
extractDirName = "studio-export";
}
const extractPath = path.join(parsedPath.dir, extractDirName);
await unzip(rootPath, extractPath);

// Studio exports usually contain a single top-level directory.
// E.g., `Export-12345/`. Let's check if we should dive into it
const extractedItems = fs.readdirSync(extractPath);
if (
extractedItems.length === 1 &&
fs.statSync(path.join(extractPath, extractedItems[0])).isDirectory()
) {
rootPath = path.join(extractPath, extractedItems[0]);
} else {
rootPath = extractPath;
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

This async function uses synchronous file system calls (fs.existsSync, fs.statSync, fs.readdirSync), which can block the Node.js event loop. It's a best practice to use their asynchronous counterparts from the fs/promises module to maintain non-blocking I/O, especially since the rest of the function uses await.

    if (fs.existsSync(rootPath) && fs.statSync(rootPath).isFile() && rootPath.endsWith(".zip")) {
      logger.info(`⏳ Unzipping ${rootPath}...`);
      const parsedPath = path.parse(rootPath);
      let extractDirName = parsedPath.name;
      if (!extractDirName || extractDirName === ".") {
        extractDirName = "studio-export";
      }
      const extractPath = path.join(parsedPath.dir, extractDirName);
      await unzip(rootPath, extractPath);

      // Studio exports usually contain a single top-level directory.
      // E.g., `Export-12345/`. Let's check if we should dive into it
      const extractedItems = await fs.promises.readdir(extractPath);
      if (extractedItems.length === 1) {
        const firstItemPath = path.join(extractPath, extractedItems[0]);
        const firstItemStat = await fs.promises.stat(firstItemPath);
        if (firstItemStat.isDirectory()) {
          rootPath = firstItemPath;
        } else {
          rootPath = extractPath;
        }
      } else {
        rootPath = extractPath;
      }
    }
Comment on lines +28 to +31
if (!(await promisify(fs.exists)(pubspecYamlPath))) {
logger.debug("Customer code is not Dart code.");
return;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The fs.exists method is deprecated. It's recommended to use fs.promises.access within a try/catch block to check for file existence in an asynchronous function. This avoids using a deprecated API and aligns better with modern async/await patterns.

  try {
    await fs.promises.access(pubspecYamlPath);
  } catch {
    logger.debug("Customer code is not Dart code.");
    return;
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment