Skip to content

Commit e6494bc

Browse files
Merge master into release
2 parents 12129b9 + dc11a27 commit e6494bc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+580
-79
lines changed

.changeset/cyan-apes-listen.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@firebase/database": patch
3+
---
4+
5+
Fixed issue where queryConstraint.type was undefined

.changeset/few-drinks-kiss.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@firebase/app': patch
3+
---
4+
5+
Catch `transaction.done` errors in `readHeartbeatsFromIndexedDB` and log them as a warning, because platform logging errors should never throw or block user app functionality.

.changeset/fifty-bees-matter.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@firebase/analytics': patch
3+
---
4+
5+
Analytics - added two new consent options to the ConsentSettings interface: ad_personalization and ad_user_data.

.changeset/purple-cooks-explode.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@firebase/util': patch
3+
---
4+
5+
Fix isSafari() throwing on React Native

.github/CODEOWNERS

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
* @firebase/jssdk-global-approvers
1212

1313
# Database Code
14-
packages/database @maneesht @jsdt @jmwski @firebase/jssdk-global-approvers
15-
packages/database-compat @maneesht @jsdt @jmwski @firebase/jssdk-global-approvers
16-
packages/database-types @maneesht @jsdt @jmwski @firebase/jssdk-global-approvers
14+
packages/database @maneesht @aashishpatil-g @firebase/jssdk-global-approvers
15+
packages/database-compat @maneesht @aashishpatil-g @firebase/jssdk-global-approvers
16+
packages/database-types @maneesht @aashishpatil-g @firebase/jssdk-global-approvers
1717

1818
# Firestore Code
1919
packages/firestore @firebase/firestore-js-team @firebase/jssdk-global-approvers

.github/workflows/check-changeset.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ jobs:
4747
yarn ts-node-script scripts/ci/check_changeset.ts
4848
id: check-changeset
4949
- name: Print changeset checker output
50-
run: echo "${{steps.check-changeset.outputs.CHANGESET_ERROR_MESSAGE}}"
50+
run: |
51+
cat << 'eof_delimiter_that_will_never_occur_in_CHANGESET_ERROR_MESSAGE'
52+
${{steps.check-changeset.outputs.CHANGESET_ERROR_MESSAGE}}
53+
eof_delimiter_that_will_never_occur_in_CHANGESET_ERROR_MESSAGE
5154
- name: Print blocking failure status
5255
run: echo "${{steps.check-changeset.outputs.BLOCKING_FAILURE}}"
5356
- name: Find Comment

common/api-review/analytics.api.md

+2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ export interface AnalyticsSettings {
2525
export interface ConsentSettings {
2626
// (undocumented)
2727
[key: string]: unknown;
28+
ad_personalization?: ConsentStatusString;
2829
ad_storage?: ConsentStatusString;
30+
ad_user_data?: ConsentStatusString;
2931
analytics_storage?: ConsentStatusString;
3032
functionality_storage?: ConsentStatusString;
3133
personalization_storage?: ConsentStatusString;

docs-devsite/analytics.consentsettings.md

+22
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,24 @@ export interface ConsentSettings
2222

2323
| Property | Type | Description |
2424
| --- | --- | --- |
25+
| [ad\_personalization](./analytics.consentsettings.md#consentsettingsad_personalization) | [ConsentStatusString](./analytics.md#consentstatusstring) | Sets consent for personalized advertising. |
2526
| [ad\_storage](./analytics.consentsettings.md#consentsettingsad_storage) | [ConsentStatusString](./analytics.md#consentstatusstring) | Enables storage, such as cookies, related to advertising |
27+
| [ad\_user\_data](./analytics.consentsettings.md#consentsettingsad_user_data) | [ConsentStatusString](./analytics.md#consentstatusstring) | Sets consent for sending user data to Google for advertising purposes. |
2628
| [analytics\_storage](./analytics.consentsettings.md#consentsettingsanalytics_storage) | [ConsentStatusString](./analytics.md#consentstatusstring) | Enables storage, such as cookies, related to analytics (for example, visit duration) |
2729
| [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 |
2830
| [personalization\_storage](./analytics.consentsettings.md#consentsettingspersonalization_storage) | [ConsentStatusString](./analytics.md#consentstatusstring) | Enables storage related to personalization such as video recommendations |
2931
| [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. |
3032

33+
## ConsentSettings.ad\_personalization
34+
35+
Sets consent for personalized advertising.
36+
37+
<b>Signature:</b>
38+
39+
```typescript
40+
ad_personalization?: ConsentStatusString;
41+
```
42+
3143
## ConsentSettings.ad\_storage
3244

3345
Enables storage, such as cookies, related to advertising
@@ -38,6 +50,16 @@ Enables storage, such as cookies, related to advertising
3850
ad_storage?: ConsentStatusString;
3951
```
4052

53+
## ConsentSettings.ad\_user\_data
54+
55+
Sets consent for sending user data to Google for advertising purposes.
56+
57+
<b>Signature:</b>
58+
59+
```typescript
60+
ad_user_data?: ConsentStatusString;
61+
```
62+
4163
## ConsentSettings.analytics\_storage
4264

4365
Enables storage, such as cookies, related to analytics (for example, visit duration)

docs-devsite/analytics.gtagconfigparams.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ export interface GtagConfigParams
2929
| [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) |
3030
| [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) |
3131
| [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) |
32-
| [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) |
33-
| [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) |
34-
| [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) |
32+
| [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) |
33+
| [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) |
34+
| [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) |
3535

3636
## GtagConfigParams.allow\_ad\_personalization\_signals
3737

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

106106
## GtagConfigParams.page\_location
107107

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

110110
<b>Signature:</b>
111111

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

116116
## GtagConfigParams.page\_title
117117

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

120120
<b>Signature:</b>
121121

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

126126
## GtagConfigParams.send\_page\_view
127127

128-
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)
128+
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)
129129

130130
<b>Signature:</b>
131131

docs-devsite/analytics.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ The Firebase Analytics Web SDK. This SDK does not work in a Node.js environment.
4242
| [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)<!-- -->. |
4343
| [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)<!-- -->. |
4444
| [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)<!-- -->. |
45-
| [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)<!-- -->. |
45+
| [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)<!-- -->. |
4646
| [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> |
4747
| [setCurrentScreen(analyticsInstance, screenName, options)](./analytics.md#setcurrentscreen_a6168fa) | Use gtag <code>config</code> command to set <code>screen_name</code>. |
4848
| [setUserId(analyticsInstance, id, options)](./analytics.md#setuserid_86d82f6) | Use gtag <code>config</code> command to set <code>user_id</code>. |
@@ -780,7 +780,7 @@ void
780780

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

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

785785
<b>Signature:</b>
786786

docs-devsite/auth.googleauthprovider.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk
1010
{% endcomment %}
1111

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

1515
<b>Signature:</b>
1616

docs-devsite/auth.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Firebase Authentication
8888
| [EmailAuthProvider](./auth.emailauthprovider.md#emailauthprovider_class) | Provider for generating [EmailAuthCredential](./auth.emailauthcredential.md#emailauthcredential_class)<!-- -->. |
8989
| [FacebookAuthProvider](./auth.facebookauthprovider.md#facebookauthprovider_class) | Provider for generating an [OAuthCredential](./auth.oauthcredential.md#oauthcredential_class) for [ProviderId](./auth.md#providerid)<!-- -->.FACEBOOK. |
9090
| [GithubAuthProvider](./auth.githubauthprovider.md#githubauthprovider_class) | Provider for generating an [OAuthCredential](./auth.oauthcredential.md#oauthcredential_class) for [ProviderId](./auth.md#providerid)<!-- -->.GITHUB. |
91-
| [GoogleAuthProvider](./auth.googleauthprovider.md#googleauthprovider_class) | Provider for generating an an [OAuthCredential](./auth.oauthcredential.md#oauthcredential_class) for [ProviderId](./auth.md#providerid)<!-- -->.GOOGLE. |
91+
| [GoogleAuthProvider](./auth.googleauthprovider.md#googleauthprovider_class) | Provider for generating an [OAuthCredential](./auth.oauthcredential.md#oauthcredential_class) for [ProviderId](./auth.md#providerid)<!-- -->.GOOGLE. |
9292
| [OAuthCredential](./auth.oauthcredential.md#oauthcredential_class) | Represents the OAuth credentials returned by an [OAuthProvider](./auth.oauthprovider.md#oauthprovider_class)<!-- -->. |
9393
| [OAuthProvider](./auth.oauthprovider.md#oauthprovider_class) | Provider for generating generic [OAuthCredential](./auth.oauthcredential.md#oauthcredential_class)<!-- -->. |
9494
| [PhoneAuthCredential](./auth.phoneauthcredential.md#phoneauthcredential_class) | Represents the credentials returned by [PhoneAuthProvider](./auth.phoneauthprovider.md#phoneauthprovider_class)<!-- -->. |

docs-devsite/firestore_.firestoredataconverter.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Converter used by `withConverter()` to transform user objects of type `AppModelT
1414

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

17+
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.
18+
1719
<b>Signature:</b>
1820

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

2527
| Method | Description |
2628
| --- | --- |
27-
| [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. |
29+
| [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 . |
2830
| [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. |
2931
| [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. |
3032

3133
## FirestoreDataConverter.fromFirestore()
3234

3335
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)`<!-- -->.
3436

35-
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.
37+
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.
38+
39+
To override this method, see .
3640

3741
<b>Signature:</b>
3842

0 commit comments

Comments
 (0)