Conversation
Using Gemini Code AssistThe 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
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 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. |
📝 PRs merging into main branchOur main branch should always be in a releasable state. If you are working on a larger change, or if you don't want this change to see the light of the day just yet, consider using a feature branch first, and only merge into the main branch when the code complete and ready to be released. |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces new public APIs for offline caching in the Data Connect SDK. The changes are extensive, adding new classes like CacheSettings, FetchPolicy, and DataSource, and modifying existing ones such as DataConnectSettings and QueryRef. While the new APIs are well-defined, the implementation appears to be incomplete. I've found a critical issue where a new public method is left with a TODO(), and another high-severity issue where a method's implementation contradicts its documented behavior. There's also an overload ambiguity that could break builds. I've provided suggestions to address these points. On a positive note, the unit tests have been diligently updated to cover the new additions.
firebase-dataconnect/src/main/kotlin/com/google/firebase/dataconnect/core/QueryRefImpl.kt
Outdated
Show resolved
Hide resolved
firebase-dataconnect/src/main/kotlin/com/google/firebase/dataconnect/DataConnectSettings.kt
Show resolved
Hide resolved
firebase-dataconnect/src/main/kotlin/com/google/firebase/dataconnect/core/QueryRefImpl.kt
Outdated
Show resolved
Hide resolved
firebase-dataconnect/src/main/kotlin/com/google/firebase/dataconnect/CacheSettings.kt
Show resolved
Hide resolved
firebase-dataconnect/src/main/kotlin/com/google/firebase/dataconnect/CacheSettings.kt
Show resolved
Hide resolved
firebase-dataconnect/src/test/kotlin/com/google/firebase/dataconnect/CacheSettingsUnitTest.kt
Show resolved
Hide resolved
|
/gemini summary |
Summary of ChangesThis pull request significantly enhances the Highlights
🧠 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. Changelog
Activity
|
|
The "Metalava SemVer Check" failure can be ignored because it's complaining about methods being added to an interface, but the interface in question is specifically not intended for customers to subclass. |
firebase-dataconnect/src/main/kotlin/com/google/firebase/dataconnect/core/QueryRefImpl.kt
Show resolved
Hide resolved
…caching. The implementation is not ready for release, so hiding it for now. The plan is to re-introduce it in the next release.
…caching. The implementation is not ready for release, so hiding it for now. The plan is to re-introduce it in the next release.
…caching. The implementation is not ready for release, so hiding it for now. The plan is to re-introduce it in the next release.
|
NOTE This PR was reverted in #7821 due to the implementation not being ready in time. The APIs will be added back once the implementation is ready. |
|
NOTE This PR was eventually unreverted by PR #7833 |
NOTE This PR was reverted in #7821 due to the implementation not being ready in time. The APIs were later added back by #7833.
This PR introduces into the
firebase-dataconnectmodule public APIs for offline caching. The newCacheSettingsandFetchPolicymechanisms empower users to define caching strategies tailored to their specific needs.Highlights
CacheSettingsclass andCacheSettings.Storageenum to configure local caching behavior for data operations.DataConnectSettingsnow includes an optionalcacheSettingsproperty, allowing users to enable and configure caching forFirebaseDataConnectobjects.QueryRefinterface has been extended with aFetchPolicyenum and an overloadedexecutemethod, providing explicit control over how queries retrieve data (e.g.,PREFER_CACHE,CACHE_ONLY,SERVER_ONLY).QueryResultinterface now includes adataSourceproperty, which indicates whether the retrieved data originated from the localCACHEor the remoteSERVER.CacheSettingsand updated tests forDataConnectSettingsandQueryResultImplensure the new caching functionalities are thoroughly validated.