Skip to content

Conversation

@maneesht
Copy link
Contributor

@maneesht maneesht commented Jan 6, 2026

No description provided.

@maneesht maneesht requested review from a team and aashishpatil-g as code owners January 6, 2026 23:39
@changeset-bot
Copy link

changeset-bot bot commented Jan 6, 2026

⚠️ No Changeset found

Latest commit: e9fbf67

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@maneesht maneesht marked this pull request as draft January 6, 2026 23:40
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @maneesht, 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 introduces a robust caching system for Data Connect queries, enabling client-side storage of query results to improve performance and reduce network requests. It involves significant architectural changes to the query management system, updates to the public API for cache configuration, and expands the underlying GraphQL schema definitions to support these new capabilities. The changes aim to provide developers with more control over data fetching strategies and optimize application responsiveness.

Highlights

  • Caching Implementation: Introduced a comprehensive caching layer for Data Connect queries, supporting both in-memory and persistent (IndexedDB) storage. This includes new CacheSettings and CacheProvider interfaces.
  • Query Management Refactoring: The QueryManager has been significantly refactored to integrate caching logic, allowing executeQuery to accept ExecuteQueryOptions with various QueryFetchPolicy settings (e.g., PREFER_CACHE, SERVER_ONLY).
  • API Enhancements: The getDataConnect function now accepts DataConnectSettings to configure caching behavior, and new utility functions like makeMemoryCacheProvider and makePersistentCacheProvider are available.
  • Schema and SDK Updates: New GraphQL schema files have been added for implicit fields, input types, mutations, queries, and relations. Generated SDK READMEs and package configurations have also been updated to reflect these changes and new features like operationName.
  • SHA256 Hashing Utility: A new utility for generating SHA256 hashes in the browser (generateSHA256HashBrowser) has been added, likely for cache key generation or data integrity checks.

🧠 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.

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.

let curObj: Record<string | number, unknown> = toUpdate;
for (const slice of path) {
if (typeof curObj[slice] !== 'object') {
curObj[slice] = {};

Check warning

Code scanning / CodeQL

Prototype-polluting assignment Medium

This assignment may alter Object.prototype if a malicious '__proto__' string is injected from
library input
.
Copy link
Contributor

@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 introduces a comprehensive caching layer to the Data Connect SDK, which is a significant and valuable addition. The changes are extensive, touching API definitions, core logic, and test infrastructure. While the overall direction is excellent, I've identified a few areas for improvement. Specifically, there's a potentially confusing API name (PersistentStub for an in-memory cache), a bug in the option handling logic within register.ts, and some issues in a new build script and generated documentation. Addressing these points will enhance the clarity and robustness of the new caching feature.

Comment on lines 42 to 45
newOpts = {
...JSON.parse(connectorConfigStr),
...newOpts
};
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The order of spreading options here is inconsistent with how they are spread in getDataConnect.ts. Here, newOpts (which contains realSettings) overwrites properties from connectorConfigStr, effectively resulting in { ...sortedSerialized, ...realSettings }. In getDataConnect, the order is { ...realSettings, ...sortedSerialized }. This inconsistency can lead to subtle bugs depending on how the DataConnect instance is created. To ensure consistent behavior, the spread order should be the same in both places.

Suggested change
newOpts = {
...JSON.parse(connectorConfigStr),
...newOpts
};
newOpts = {
...newOpts,
...JSON.parse(connectorConfigStr)
};

Comment on lines 217 to 219
export class PersistentStub {
// (undocumented)
type: 'MEMORY';
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The name PersistentStub is misleading for a cache provider with type: 'MEMORY'. This is caused by an alias for MemoryStub in api.browser.ts. To avoid confusion for developers, it would be clearer to use a name that accurately reflects its in-memory nature, such as MemoryStub.

package.sh Outdated
Comment on lines 1 to 5
#!/bin/bash
cd packages/firebase
yarn build
npm pkg
cp packages/firebase/firebase-12.3.0.tgz No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This script has a few issues that could be improved for robustness:

  1. npm pkg on line 4 is likely a typo for npm pack, which is used to create a package tarball. npm pkg is for managing package.json.
  2. The cp command on line 5 is missing a destination, making it a no-op. It should specify where to copy the created tarball.
  3. The version 12.3.0 is hardcoded. This will break when the version changes. It would be more robust to extract the version from package.json.
Suggested change
#!/bin/bash
cd packages/firebase
yarn build
npm pkg
cp packages/firebase/firebase-12.3.0.tgz
#!/bin/bash
cd packages/firebase
yarn build
npm pack
VERSION=$(node -p "require('./package.json').version")
cp "firebase-$VERSION.tgz" ../../

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Jan 7, 2026

Size Report 1

Affected Products

  • @firebase/app

    TypeBase (9cf4b7e)Merge (c458b3e)Diff
    browser19.6 kB19.6 kB+6 B (+0.0%)
    main20.5 kB20.5 kB+6 B (+0.0%)
    module19.6 kB19.6 kB+6 B (+0.0%)
    react-native20.5 kB20.5 kB+6 B (+0.0%)
  • @firebase/data-connect

    TypeBase (9cf4b7e)Merge (c458b3e)Diff
    browser21.5 kB35.1 kB+13.6 kB (+63.4%)
    main23.7 kB37.6 kB+13.9 kB (+58.5%)
    module21.5 kB35.1 kB+13.6 kB (+63.4%)
  • @firebase/database-compat/standalone

    TypeBase (9cf4b7e)Merge (c458b3e)Diff
    main366 kB366 kB+6 B (+0.0%)
  • @firebase/firestore

    TypeBase (9cf4b7e)Merge (c458b3e)Diff
    browser391 kB391 kB+6 B (+0.0%)
    main611 kB611 kB+6 B (+0.0%)
    module391 kB391 kB+6 B (+0.0%)
    react-native392 kB392 kB+6 B (+0.0%)
  • @firebase/firestore-lite

    TypeBase (9cf4b7e)Merge (c458b3e)Diff
    browser115 kB115 kB+6 B (+0.0%)
    main158 kB158 kB+6 B (+0.0%)
    module115 kB115 kB+6 B (+0.0%)
    react-native116 kB116 kB+6 B (+0.0%)
  • @firebase/util

    TypeBase (9cf4b7e)Merge (c458b3e)Diff
    browser29.1 kB29.5 kB+349 B (+1.2%)
    main35.5 kB36.0 kB+479 B (+1.3%)
    module29.1 kB29.5 kB+349 B (+1.2%)
  • bundle

    46 size changes

    TypeBase (9cf4b7e)Merge (c458b3e)Diff
    analytics (logEvent)44.1 kB44.1 kB+6 B (+0.0%)
    app-check (CustomProvider)37.2 kB37.2 kB+6 B (+0.0%)
    app-check (ReCaptchaEnterpriseProvider)39.6 kB39.6 kB+6 B (+0.0%)
    app-check (ReCaptchaV3Provider)39.6 kB39.6 kB+6 B (+0.0%)
    auth (Anonymous)74.8 kB74.8 kB+12 B (+0.0%)
    auth (EmailAndPassword)84.5 kB84.5 kB+12 B (+0.0%)
    auth (GoogleFBTwitterGitHubPopup)105 kB105 kB+12 B (+0.0%)
    auth (GooglePopup)98.1 kB98.1 kB+12 B (+0.0%)
    auth (GoogleRedirect)98.3 kB98.3 kB+12 B (+0.0%)
    auth (Phone)91.7 kB91.7 kB+12 B (+0.0%)
    database (Append to a list of data)154 kB154 kB+12 B (+0.0%)
    database (Filtering data)153 kB153 kB+12 B (+0.0%)
    database (Listen for child events)169 kB169 kB+12 B (+0.0%)
    database (Listen for value events + Detach listeners)169 kB169 kB+12 B (+0.0%)
    database (Listen for value events)169 kB169 kB+12 B (+0.0%)
    database (Read data once)168 kB168 kB+12 B (+0.0%)
    database (Save data as transactions)171 kB171 kB+12 B (+0.0%)
    database (Sort data)154 kB154 kB+12 B (+0.0%)
    database (Write data)153 kB153 kB+12 B (+0.0%)
    firestore (CSI Auto Indexing Disable and Delete)286 kB286 kB+18 B (+0.0%)
    firestore (CSI Auto Indexing Enable)286 kB286 kB+18 B (+0.0%)
    firestore (Persistence)318 kB318 kB+18 B (+0.0%)
    firestore (Query Cursors)257 kB257 kB+18 B (+0.0%)
    firestore (Query)255 kB255 kB+18 B (+0.0%)
    firestore (Read data once)245 kB245 kB+18 B (+0.0%)
    firestore (Read Write w Persistence)337 kB338 kB+18 B (+0.0%)
    firestore (Realtime updates)245 kB245 kB+18 B (+0.0%)
    firestore (Transaction)223 kB223 kB+18 B (+0.0%)
    firestore (Write data)224 kB224 kB+18 B (+0.0%)
    firestore-lite (Query Cursors)110 kB110 kB+18 B (+0.0%)
    firestore-lite (Query)106 kB106 kB+18 B (+0.0%)
    firestore-lite (Read data once)81.6 kB81.6 kB+18 B (+0.0%)
    firestore-lite (Transaction)107 kB107 kB+18 B (+0.0%)
    firestore-lite (Write data)91.1 kB91.1 kB+18 B (+0.0%)
    functions (call)38.7 kB38.8 kB+6 B (+0.0%)
    messaging (send + receive)46.4 kB46.4 kB+6 B (+0.0%)
    performance (trace)62.1 kB62.1 kB+6 B (+0.0%)
    remote-config (getAndFetch)59.4 kB59.4 kB+12 B (+0.0%)
    storage (getBytes)46.6 kB46.6 kB+12 B (+0.0%)
    storage (getDownloadURL)48.7 kB48.7 kB+12 B (+0.0%)
    storage (getMetadata)48.1 kB48.1 kB+12 B (+0.0%)
    storage (list + listAll)47.5 kB47.5 kB+12 B (+0.0%)
    storage (updateMetadata)48.4 kB48.4 kB+12 B (+0.0%)
    storage (uploadBytes)53.2 kB53.2 kB+12 B (+0.0%)
    storage (uploadBytesResumable)63.1 kB63.2 kB+12 B (+0.0%)
    storage (uploadString)53.4 kB53.4 kB+12 B (+0.0%)

  • firebase

    22 size changes

    TypeBase (9cf4b7e)Merge (c458b3e)Diff
    firebase-ai.js52.8 kB52.8 kB+6 B (+0.0%)
    firebase-analytics.js29.4 kB29.4 kB+6 B (+0.0%)
    firebase-app-check.js25.0 kB25.0 kB+6 B (+0.0%)
    firebase-app-compat.js31.6 kB31.6 kB+12 B (+0.0%)
    firebase-app.js103 kB103 kB+24 B (+0.0%)
    firebase-auth-cordova.js139 kB139 kB+6 B (+0.0%)
    firebase-auth-web-extension.js122 kB122 kB+6 B (+0.0%)
    firebase-auth.js159 kB159 kB+6 B (+0.0%)
    firebase-compat.js809 kB809 kB+24 B (+0.0%)
    firebase-data-connect.js22.6 kB32.8 kB+10.2 kB (+45.1%)
    firebase-database.js192 kB192 kB+6 B (+0.0%)
    firebase-firestore-compat.js348 kB348 kB+6 B (+0.0%)
    firebase-firestore-lite.js138 kB138 kB+12 B (+0.0%)
    firebase-firestore.js454 kB454 kB+12 B (+0.0%)
    firebase-functions.js19.5 kB19.5 kB+6 B (+0.0%)
    firebase-installations.js15.0 kB15.0 kB+6 B (+0.0%)
    firebase-messaging-sw.js29.3 kB29.3 kB+6 B (+0.0%)
    firebase-messaging.js28.6 kB28.6 kB+6 B (+0.0%)
    firebase-performance-standalone-compat.js105 kB105 kB+18 B (+0.0%)
    firebase-performance.js45.6 kB45.6 kB+6 B (+0.0%)
    firebase-remote-config.js43.5 kB43.5 kB+6 B (+0.0%)
    firebase-storage.js51.1 kB51.1 kB+6 B (+0.0%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/1nS1l35mRs.html

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Jan 7, 2026

Size Analysis Report 1

This report is too large (253,967 characters) to be displayed here in a GitHub comment. Please use the below link to see the full report on Google Cloud Storage.

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/g9OWCKX58p.html

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