Skip to content

Commit

Permalink
Merge master into release
Browse files Browse the repository at this point in the history
  • Loading branch information
google-oss-bot committed Jan 30, 2024
2 parents 12129b9 + dc11a27 commit e6494bc
Show file tree
Hide file tree
Showing 47 changed files with 580 additions and 79 deletions.
5 changes: 5 additions & 0 deletions .changeset/cyan-apes-listen.md
@@ -0,0 +1,5 @@
---
"@firebase/database": patch
---

Fixed issue where queryConstraint.type was undefined
5 changes: 5 additions & 0 deletions .changeset/few-drinks-kiss.md
@@ -0,0 +1,5 @@
---
'@firebase/app': patch
---

Catch `transaction.done` errors in `readHeartbeatsFromIndexedDB` and log them as a warning, because platform logging errors should never throw or block user app functionality.
5 changes: 5 additions & 0 deletions .changeset/fifty-bees-matter.md
@@ -0,0 +1,5 @@
---
'@firebase/analytics': patch
---

Analytics - added two new consent options to the ConsentSettings interface: ad_personalization and ad_user_data.
5 changes: 5 additions & 0 deletions .changeset/purple-cooks-explode.md
@@ -0,0 +1,5 @@
---
'@firebase/util': patch
---

Fix isSafari() throwing on React Native
6 changes: 3 additions & 3 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Expand Up @@ -11,9 +11,9 @@
* @firebase/jssdk-global-approvers

# Database Code
packages/database @maneesht @jsdt @jmwski @firebase/jssdk-global-approvers
packages/database-compat @maneesht @jsdt @jmwski @firebase/jssdk-global-approvers
packages/database-types @maneesht @jsdt @jmwski @firebase/jssdk-global-approvers
packages/database @maneesht @aashishpatil-g @firebase/jssdk-global-approvers
packages/database-compat @maneesht @aashishpatil-g @firebase/jssdk-global-approvers
packages/database-types @maneesht @aashishpatil-g @firebase/jssdk-global-approvers

# Firestore Code
packages/firestore @firebase/firestore-js-team @firebase/jssdk-global-approvers
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/check-changeset.yml
Expand Up @@ -47,7 +47,10 @@ jobs:
yarn ts-node-script scripts/ci/check_changeset.ts
id: check-changeset
- name: Print changeset checker output
run: echo "${{steps.check-changeset.outputs.CHANGESET_ERROR_MESSAGE}}"
run: |
cat << 'eof_delimiter_that_will_never_occur_in_CHANGESET_ERROR_MESSAGE'
${{steps.check-changeset.outputs.CHANGESET_ERROR_MESSAGE}}
eof_delimiter_that_will_never_occur_in_CHANGESET_ERROR_MESSAGE
- name: Print blocking failure status
run: echo "${{steps.check-changeset.outputs.BLOCKING_FAILURE}}"
- name: Find Comment
Expand Down
2 changes: 2 additions & 0 deletions common/api-review/analytics.api.md
Expand Up @@ -25,7 +25,9 @@ export interface AnalyticsSettings {
export interface ConsentSettings {
// (undocumented)
[key: string]: unknown;
ad_personalization?: ConsentStatusString;
ad_storage?: ConsentStatusString;
ad_user_data?: ConsentStatusString;
analytics_storage?: ConsentStatusString;
functionality_storage?: ConsentStatusString;
personalization_storage?: ConsentStatusString;
Expand Down
22 changes: 22 additions & 0 deletions docs-devsite/analytics.consentsettings.md
Expand Up @@ -22,12 +22,24 @@ export interface ConsentSettings

| Property | Type | Description |
| --- | --- | --- |
| [ad\_personalization](./analytics.consentsettings.md#consentsettingsad_personalization) | [ConsentStatusString](./analytics.md#consentstatusstring) | Sets consent for personalized advertising. |
| [ad\_storage](./analytics.consentsettings.md#consentsettingsad_storage) | [ConsentStatusString](./analytics.md#consentstatusstring) | Enables storage, such as cookies, related to advertising |
| [ad\_user\_data](./analytics.consentsettings.md#consentsettingsad_user_data) | [ConsentStatusString](./analytics.md#consentstatusstring) | Sets consent for sending user data to Google for advertising purposes. |
| [analytics\_storage](./analytics.consentsettings.md#consentsettingsanalytics_storage) | [ConsentStatusString](./analytics.md#consentstatusstring) | Enables storage, such as cookies, related to analytics (for example, visit duration) |
| [functionality\_storage](./analytics.consentsettings.md#consentsettingsfunctionality_storage) | [ConsentStatusString](./analytics.md#consentstatusstring) | Enables storage that supports the functionality of the website or app such as language settings |
| [personalization\_storage](./analytics.consentsettings.md#consentsettingspersonalization_storage) | [ConsentStatusString](./analytics.md#consentstatusstring) | Enables storage related to personalization such as video recommendations |
| [security\_storage](./analytics.consentsettings.md#consentsettingssecurity_storage) | [ConsentStatusString](./analytics.md#consentstatusstring) | Enables storage related to security such as authentication functionality, fraud prevention, and other user protection. |

## ConsentSettings.ad\_personalization

Sets consent for personalized advertising.

<b>Signature:</b>

```typescript
ad_personalization?: ConsentStatusString;
```

## ConsentSettings.ad\_storage

Enables storage, such as cookies, related to advertising
Expand All @@ -38,6 +50,16 @@ Enables storage, such as cookies, related to advertising
ad_storage?: ConsentStatusString;
```

## ConsentSettings.ad\_user\_data

Sets consent for sending user data to Google for advertising purposes.

<b>Signature:</b>

```typescript
ad_user_data?: ConsentStatusString;
```

## ConsentSettings.analytics\_storage

Enables storage, such as cookies, related to analytics (for example, visit duration)
Expand Down
12 changes: 6 additions & 6 deletions docs-devsite/analytics.gtagconfigparams.md
Expand Up @@ -29,9 +29,9 @@ export interface GtagConfigParams
| [cookie\_flags](./analytics.gtagconfigparams.md#gtagconfigparamscookie_flags) | string | Appends additional flags to the cookie when set. See [Cookies and user identification](https://developers.google.com/analytics/devguides/collection/ga4/cookies-user-id) |
| [cookie\_prefix](./analytics.gtagconfigparams.md#gtagconfigparamscookie_prefix) | string | Defaults to <code>_ga</code>. See [Cookies and user identification](https://developers.google.com/analytics/devguides/collection/ga4/cookies-user-id) |
| [cookie\_update](./analytics.gtagconfigparams.md#gtagconfigparamscookie_update) | boolean | If set to true, will update cookies on each page load. Defaults to true. See [Cookies and user identification](https://developers.google.com/analytics/devguides/collection/ga4/cookies-user-id) |
| [page\_location](./analytics.gtagconfigparams.md#gtagconfigparamspage_location) | string | The URL of the page. See [Page views](https://developers.google.com/analytics/devguides/collection/ga4/page-view) |
| [page\_title](./analytics.gtagconfigparams.md#gtagconfigparamspage_title) | string | The title of the page. See [Page views](https://developers.google.com/analytics/devguides/collection/ga4/page-view) |
| [send\_page\_view](./analytics.gtagconfigparams.md#gtagconfigparamssend_page_view) | boolean | Whether or not a page view should be sent. If set to true (default), a page view is automatically sent upon initialization of analytics. See [Page views](https://developers.google.com/analytics/devguides/collection/ga4/page-view) |
| [page\_location](./analytics.gtagconfigparams.md#gtagconfigparamspage_location) | string | The URL of the page. See [Page views](https://developers.google.com/analytics/devguides/collection/ga4/views) |
| [page\_title](./analytics.gtagconfigparams.md#gtagconfigparamspage_title) | string | The title of the page. See [Page views](https://developers.google.com/analytics/devguides/collection/ga4/views) |
| [send\_page\_view](./analytics.gtagconfigparams.md#gtagconfigparamssend_page_view) | boolean | Whether or not a page view should be sent. If set to true (default), a page view is automatically sent upon initialization of analytics. See [Page views](https://developers.google.com/analytics/devguides/collection/ga4/views) |

## GtagConfigParams.allow\_ad\_personalization\_signals

Expand Down Expand Up @@ -105,7 +105,7 @@ If set to true, will update cookies on each page load. Defaults to true. See [Co

## GtagConfigParams.page\_location

The URL of the page. See [Page views](https://developers.google.com/analytics/devguides/collection/ga4/page-view)
The URL of the page. See [Page views](https://developers.google.com/analytics/devguides/collection/ga4/views)

<b>Signature:</b>

Expand All @@ -115,7 +115,7 @@ The URL of the page. See [Page views](https://developers.google.com/analytics/de

## GtagConfigParams.page\_title

The title of the page. See [Page views](https://developers.google.com/analytics/devguides/collection/ga4/page-view)
The title of the page. See [Page views](https://developers.google.com/analytics/devguides/collection/ga4/views)

<b>Signature:</b>

Expand All @@ -125,7 +125,7 @@ The title of the page. See [Page views](https://developers.google.com/analytics/

## GtagConfigParams.send\_page\_view

Whether or not a page view should be sent. If set to true (default), a page view is automatically sent upon initialization of analytics. See [Page views](https://developers.google.com/analytics/devguides/collection/ga4/page-view)
Whether or not a page view should be sent. If set to true (default), a page view is automatically sent upon initialization of analytics. See [Page views](https://developers.google.com/analytics/devguides/collection/ga4/views)

<b>Signature:</b>

Expand Down
4 changes: 2 additions & 2 deletions docs-devsite/analytics.md
Expand Up @@ -42,7 +42,7 @@ The Firebase Analytics Web SDK. This SDK does not work in a Node.js environment.
| [logEvent(analyticsInstance, eventName, eventParams, options)](./analytics.md#logevent_800159e) | Sends a Google Analytics event with given <code>eventParams</code>. This method automatically associates this logged event with this Firebase web app instance on this device.<!-- -->See [Measure exceptions](https://developers.google.com/analytics/devguides/collection/ga4/exceptions)<!-- -->. |
| [logEvent(analyticsInstance, eventName, eventParams, options)](./analytics.md#logevent_9c11aa9) | Sends a Google Analytics event with given <code>eventParams</code>. This method automatically associates this logged event with this Firebase web app instance on this device.<!-- -->List of recommended event parameters can be found in [the GA4 reference documentation](https://developers.google.com/gtagjs/reference/ga4-events)<!-- -->. |
| [logEvent(analyticsInstance, eventName, eventParams, options)](./analytics.md#logevent_1f3f282) | Sends a Google Analytics event with given <code>eventParams</code>. This method automatically associates this logged event with this Firebase web app instance on this device.<!-- -->List of recommended event parameters can be found in [the GA4 reference documentation](https://developers.google.com/gtagjs/reference/ga4-events)<!-- -->. |
| [logEvent(analyticsInstance, eventName, eventParams, options)](./analytics.md#logevent_0792e28) | Sends a Google Analytics event with given <code>eventParams</code>. This method automatically associates this logged event with this Firebase web app instance on this device.<!-- -->See [Page views](https://developers.google.com/analytics/devguides/collection/ga4/page-view)<!-- -->. |
| [logEvent(analyticsInstance, eventName, eventParams, options)](./analytics.md#logevent_0792e28) | Sends a Google Analytics event with given <code>eventParams</code>. This method automatically associates this logged event with this Firebase web app instance on this device.<!-- -->See [Page views](https://developers.google.com/analytics/devguides/collection/ga4/views)<!-- -->. |
| [setAnalyticsCollectionEnabled(analyticsInstance, enabled)](./analytics.md#setanalyticscollectionenabled_494179c) | Sets whether Google Analytics collection is enabled for this app on this device. Sets global <code>window['ga-disable-analyticsId'] = true;</code> |
| [setCurrentScreen(analyticsInstance, screenName, options)](./analytics.md#setcurrentscreen_a6168fa) | Use gtag <code>config</code> command to set <code>screen_name</code>. |
| [setUserId(analyticsInstance, id, options)](./analytics.md#setuserid_86d82f6) | Use gtag <code>config</code> command to set <code>user_id</code>. |
Expand Down Expand Up @@ -780,7 +780,7 @@ void

Sends a Google Analytics event with given `eventParams`<!-- -->. This method automatically associates this logged event with this Firebase web app instance on this device.

See [Page views](https://developers.google.com/analytics/devguides/collection/ga4/page-view)<!-- -->.
See [Page views](https://developers.google.com/analytics/devguides/collection/ga4/views)<!-- -->.

<b>Signature:</b>

Expand Down
2 changes: 1 addition & 1 deletion docs-devsite/auth.googleauthprovider.md
Expand Up @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk
{% endcomment %}

# GoogleAuthProvider class
Provider for generating an an [OAuthCredential](./auth.oauthcredential.md#oauthcredential_class) for [ProviderId](./auth.md#providerid)<!-- -->.GOOGLE.
Provider for generating an [OAuthCredential](./auth.oauthcredential.md#oauthcredential_class) for [ProviderId](./auth.md#providerid)<!-- -->.GOOGLE.

<b>Signature:</b>

Expand Down
2 changes: 1 addition & 1 deletion docs-devsite/auth.md
Expand Up @@ -88,7 +88,7 @@ Firebase Authentication
| [EmailAuthProvider](./auth.emailauthprovider.md#emailauthprovider_class) | Provider for generating [EmailAuthCredential](./auth.emailauthcredential.md#emailauthcredential_class)<!-- -->. |
| [FacebookAuthProvider](./auth.facebookauthprovider.md#facebookauthprovider_class) | Provider for generating an [OAuthCredential](./auth.oauthcredential.md#oauthcredential_class) for [ProviderId](./auth.md#providerid)<!-- -->.FACEBOOK. |
| [GithubAuthProvider](./auth.githubauthprovider.md#githubauthprovider_class) | Provider for generating an [OAuthCredential](./auth.oauthcredential.md#oauthcredential_class) for [ProviderId](./auth.md#providerid)<!-- -->.GITHUB. |
| [GoogleAuthProvider](./auth.googleauthprovider.md#googleauthprovider_class) | Provider for generating an an [OAuthCredential](./auth.oauthcredential.md#oauthcredential_class) for [ProviderId](./auth.md#providerid)<!-- -->.GOOGLE. |
| [GoogleAuthProvider](./auth.googleauthprovider.md#googleauthprovider_class) | Provider for generating an [OAuthCredential](./auth.oauthcredential.md#oauthcredential_class) for [ProviderId](./auth.md#providerid)<!-- -->.GOOGLE. |
| [OAuthCredential](./auth.oauthcredential.md#oauthcredential_class) | Represents the OAuth credentials returned by an [OAuthProvider](./auth.oauthprovider.md#oauthprovider_class)<!-- -->. |
| [OAuthProvider](./auth.oauthprovider.md#oauthprovider_class) | Provider for generating generic [OAuthCredential](./auth.oauthcredential.md#oauthcredential_class)<!-- -->. |
| [PhoneAuthCredential](./auth.phoneauthcredential.md#phoneauthcredential_class) | Represents the credentials returned by [PhoneAuthProvider](./auth.phoneauthprovider.md#phoneauthprovider_class)<!-- -->. |
Expand Down
8 changes: 6 additions & 2 deletions docs-devsite/firestore_.firestoredataconverter.md
Expand Up @@ -14,6 +14,8 @@ Converter used by `withConverter()` to transform user objects of type `AppModelT

Using the converter allows you to specify generic type arguments when storing and retrieving objects from Firestore.

In this context, an "AppModel" is a class that is used in an application to package together related information and functionality. Such a class could, for example, have properties with complex, nested data types, properties used for memoization, properties of types not supported by Firestore (such as `symbol` and `bigint`<!-- -->), and helper functions that perform compound operations. Such classes are not suitable and/or possible to store into a Firestore database. Instead, instances of such classes need to be converted to "plain old JavaScript objects" (POJOs) with exclusively primitive properties, potentially nested inside other POJOs or arrays of POJOs. In this context, this type is referred to as the "DbModel" and would be an object suitable for persisting into Firestore. For convenience, applications can implement `FirestoreDataConverter` and register the converter with Firestore objects, such as `DocumentReference` or `Query`<!-- -->, to automatically convert `AppModel` to `DbModel` when storing into Firestore, and convert `DbModel` to `AppModel` when retrieving from Firestore.

<b>Signature:</b>

```typescript
Expand All @@ -24,15 +26,17 @@ export declare interface FirestoreDataConverter<AppModelType, DbModelType extend

| Method | Description |
| --- | --- |
| [fromFirestore(snapshot, options)](./firestore_.firestoredataconverter.md#firestoredataconverterfromfirestore) | Called by the Firestore SDK to convert Firestore data into an object of type <code>AppModelType</code>. You can access your data by calling: <code>snapshot.data(options)</code>.<!-- -->Generally, the data returned from <code>snapshot.data()</code> can be cast to <code>DbModelType</code>; however, this is not guaranteed as writes to the database may have occurred without a type converter enforcing this specific layout. |
| [fromFirestore(snapshot, options)](./firestore_.firestoredataconverter.md#firestoredataconverterfromfirestore) | Called by the Firestore SDK to convert Firestore data into an object of type <code>AppModelType</code>. You can access your data by calling: <code>snapshot.data(options)</code>.<!-- -->Generally, the data returned from <code>snapshot.data()</code> can be cast to <code>DbModelType</code>; however, this is not guaranteed because Firestore does not enforce a schema on the database. For example, writes from a previous version of the application or writes from another client that did not use a type converter could have written data with different properties and/or property types. The implementation will need to choose whether to gracefully recover from non-conforming data or throw an error.<!-- -->To override this method, see . |
| [toFirestore(modelObject)](./firestore_.firestoredataconverter.md#firestoredataconvertertofirestore) | Called by the Firestore SDK to convert a custom model object of type <code>AppModelType</code> into a plain JavaScript object (suitable for writing directly to the Firestore database) of type <code>DbModelType</code>. To use <code>set()</code> with <code>merge</code> and <code>mergeFields</code>, <code>toFirestore()</code> must be defined with <code>PartialWithFieldValue&lt;AppModelType&gt;</code>.<!-- -->The <code>WithFieldValue&lt;T&gt;</code> type extends <code>T</code> to also allow FieldValues such as [deleteField()](./firestore_.md#deletefield) to be used as property values. |
| [toFirestore(modelObject, options)](./firestore_.firestoredataconverter.md#firestoredataconvertertofirestore) | Called by the Firestore SDK to convert a custom model object of type <code>AppModelType</code> into a plain JavaScript object (suitable for writing directly to the Firestore database) of type <code>DbModelType</code>. Used with [setDoc()](./firestore_.md#setdoc_ee215ad)<!-- -->, and with <code>merge:true</code> or <code>mergeFields</code>.<!-- -->The <code>PartialWithFieldValue&lt;T&gt;</code> type extends <code>Partial&lt;T&gt;</code> to allow FieldValues such as [arrayUnion()](./firestore_.md#arrayunion_7d853aa) to be used as property values. It also supports nested <code>Partial</code> by allowing nested fields to be omitted. |

## FirestoreDataConverter.fromFirestore()

Called by the Firestore SDK to convert Firestore data into an object of type `AppModelType`<!-- -->. You can access your data by calling: `snapshot.data(options)`<!-- -->.

Generally, the data returned from `snapshot.data()` can be cast to `DbModelType`<!-- -->; however, this is not guaranteed as writes to the database may have occurred without a type converter enforcing this specific layout.
Generally, the data returned from `snapshot.data()` can be cast to `DbModelType`<!-- -->; however, this is not guaranteed because Firestore does not enforce a schema on the database. For example, writes from a previous version of the application or writes from another client that did not use a type converter could have written data with different properties and/or property types. The implementation will need to choose whether to gracefully recover from non-conforming data or throw an error.

To override this method, see .

<b>Signature:</b>

Expand Down

0 comments on commit e6494bc

Please sign in to comment.