Skip to content

Commit e430ebb

Browse files
committed
fix(firestore): validate TransactionOptions maxAttempts
1 parent 8797761 commit e430ebb

6 files changed

Lines changed: 144 additions & 103 deletions

File tree

.github/scripts/compare-types/configs/firestore.ts

Lines changed: 52 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ const config: PackageConfig = {
2929
{
3030
name: 'documentSnapshotFromJSON',
3131
reason:
32-
'Deserialises a DocumentSnapshot from a JSON representation. Part of ' +
33-
'the firebase-js-sdk serialization API not yet available in RN Firebase.',
32+
'firebase-js-sdk reconstructs web SDK snapshot wrappers from JSON. RN Firebase ' +
33+
'snapshots are native-backed wrappers, and the Android/iOS Firestore SDKs do not ' +
34+
'expose cross-platform DocumentSnapshot JSON constructors.',
3435
},
3536
{
3637
name: 'enableIndexedDbPersistence',
@@ -58,21 +59,21 @@ const config: PackageConfig = {
5859
{
5960
name: 'memoryEagerGarbageCollector',
6061
reason:
61-
'Factory for the memory eager garbage collector used with memoryLocalCache. ' +
62-
'The local cache configuration API is not yet implemented in RN Firebase; ' +
63-
'persistence is controlled via native platform settings.',
62+
'Web local-cache component factory for memoryLocalCache. RN Firebase delegates ' +
63+
'persistence to the native Firestore SDKs, which do not expose the firebase-js-sdk ' +
64+
'LocalCache/GarbageCollector component model.',
6465
},
6566
{
6667
name: 'memoryLocalCache',
6768
reason:
68-
'Factory for an in-memory local cache instance. The local cache ' +
69-
'configuration API is not yet implemented in RN Firebase.',
69+
'Web local-cache factory. React Native targets use the native Firestore SDK cache ' +
70+
'configured through RN Firebase settings, not firebase-js-sdk LocalCache instances.',
7071
},
7172
{
7273
name: 'memoryLruGarbageCollector',
7374
reason:
74-
'Factory for the memory LRU garbage collector used with memoryLocalCache. ' +
75-
'The local cache configuration API is not yet implemented in RN Firebase.',
75+
'Web local-cache component factory for memoryLocalCache. Native Firestore SDK cache ' +
76+
'configuration does not expose a firebase-js-sdk MemoryLruGarbageCollector object.',
7677
},
7778
{
7879
name: 'minimum',
@@ -87,16 +88,15 @@ const config: PackageConfig = {
8788
{
8889
name: 'onSnapshotResume',
8990
reason:
90-
'Resumes a snapshot listener from a previously-serialized resume token. ' +
91-
'Part of the firebase-js-sdk snapshot serialization API not yet available ' +
92-
'in RN Firebase.',
91+
'firebase-js-sdk web snapshot resume API depends on serialized web SDK listener ' +
92+
'state. RN Firebase listeners are backed by Android/iOS SDK listener state, and ' +
93+
'those SDKs do not expose a compatible public resume-token constructor.',
9394
},
9495
{
9596
name: 'persistentLocalCache',
9697
reason:
97-
'Factory for a persistent local cache instance. The local cache ' +
98-
'configuration API is not yet implemented in RN Firebase; persistence ' +
99-
'is controlled via native platform settings.',
98+
'Web persistent local-cache factory. RN Firebase uses native Firestore persistence ' +
99+
'settings instead of firebase-js-sdk PersistentLocalCache component instances.',
100100
},
101101
{
102102
name: 'persistentMultipleTabManager',
@@ -107,20 +107,22 @@ const config: PackageConfig = {
107107
{
108108
name: 'persistentSingleTabManager',
109109
reason:
110-
'Factory for the persistent single-tab manager. The local cache ' +
111-
'configuration API is not yet implemented in RN Firebase.',
110+
'Web tab-manager factory for persistentLocalCache. React Native has no ' +
111+
'firebase-js-sdk tab-manager component path; native persistence is controlled by ' +
112+
'platform SDK settings.',
112113
},
113114
{
114115
name: 'querySnapshotFromJSON',
115116
reason:
116-
'Deserialises a QuerySnapshot from a JSON representation. Part of ' +
117-
'the firebase-js-sdk serialization API not yet available in RN Firebase.',
117+
'firebase-js-sdk reconstructs web SDK query snapshot wrappers from JSON. RN Firebase ' +
118+
'query snapshots are native-backed wrappers, and the Android/iOS Firestore SDKs do ' +
119+
'not expose cross-platform QuerySnapshot JSON constructors.',
118120
},
119121
{
120122
name: 'setIndexConfiguration',
121123
reason:
122-
'Configures Firestore indexes from a JSON or Protobuf configuration. ' +
123-
'Deprecated in the firebase-js-sdk. Not implemented in RN Firebase.',
124+
'Deprecated in firebase-js-sdk; React Native Firebase will not implement. Native ' +
125+
'Firestore SDKs do not expose the web JSON/Protobuf index configuration API.',
124126
},
125127

126128
// --- Types / Interfaces ---
@@ -133,44 +135,44 @@ const config: PackageConfig = {
133135
{
134136
name: 'Index',
135137
reason:
136-
'Type used with setIndexConfiguration. Not implemented in RN Firebase ' +
137-
'as setIndexConfiguration is not supported.',
138+
'Deprecated firebase-js-sdk type used only by setIndexConfiguration. React Native ' +
139+
'Firebase will not implement that web index configuration API.',
138140
},
139141
{
140142
name: 'IndexConfiguration',
141143
reason:
142-
'Type used with setIndexConfiguration. Not implemented in RN Firebase ' +
143-
'as setIndexConfiguration is not supported.',
144+
'Deprecated firebase-js-sdk type used only by setIndexConfiguration. React Native ' +
145+
'Firebase will not implement that web index configuration API.',
144146
},
145147
{
146148
name: 'IndexField',
147149
reason:
148-
'Type used with setIndexConfiguration. Not implemented in RN Firebase ' +
149-
'as setIndexConfiguration is not supported.',
150+
'Deprecated firebase-js-sdk type used only by setIndexConfiguration. React Native ' +
151+
'Firebase will not implement that web index configuration API.',
150152
},
151153
{
152154
name: 'MemoryCacheSettings',
153155
reason:
154-
'Configuration interface for the memory local cache. The local cache ' +
155-
'configuration API is not yet implemented in RN Firebase.',
156+
'Web memory local-cache configuration interface. RN Firebase exposes native ' +
157+
'Firestore persistence/cache settings rather than firebase-js-sdk LocalCache objects.',
156158
},
157159
{
158160
name: 'MemoryEagerGarbageCollector',
159161
reason:
160-
'Interface for the memory eager garbage collector. The local cache ' +
161-
'configuration API is not yet implemented in RN Firebase.',
162+
'Web memory local-cache garbage-collector interface. Native Firestore SDK cache ' +
163+
'configuration does not expose this firebase-js-sdk component model.',
162164
},
163165
{
164166
name: 'MemoryGarbageCollector',
165167
reason:
166-
'Base interface for memory garbage collector strategies. The local cache ' +
167-
'configuration API is not yet implemented in RN Firebase.',
168+
'Web memory local-cache garbage-collector base interface. Native Firestore SDK cache ' +
169+
'configuration does not expose this firebase-js-sdk component model.',
168170
},
169171
{
170172
name: 'MemoryLruGarbageCollector',
171173
reason:
172-
'Interface for the memory LRU garbage collector. The local cache ' +
173-
'configuration API is not yet implemented in RN Firebase.',
174+
'Web memory local-cache LRU garbage-collector interface. Native Firestore SDK cache ' +
175+
'configuration does not expose this firebase-js-sdk component model.',
174176
},
175177
{
176178
name: 'PersistentCacheIndexManager',
@@ -181,8 +183,8 @@ const config: PackageConfig = {
181183
{
182184
name: 'PersistentCacheSettings',
183185
reason:
184-
'Configuration interface for the persistent local cache. The local cache ' +
185-
'configuration API is not yet implemented in RN Firebase.',
186+
'Web persistent local-cache configuration interface. RN Firebase uses native ' +
187+
'Firestore persistence settings instead of firebase-js-sdk PersistentLocalCache objects.',
186188
},
187189
{
188190
name: 'PersistentMultipleTabManager',
@@ -193,20 +195,21 @@ const config: PackageConfig = {
193195
{
194196
name: 'PersistentSingleTabManager',
195197
reason:
196-
'Interface for the persistent single-tab manager. The local cache ' +
197-
'configuration API is not yet implemented in RN Firebase.',
198+
'Web persistent-cache tab-manager interface. React Native has no firebase-js-sdk ' +
199+
'single-tab manager path; native persistence is controlled by platform SDK settings.',
198200
},
199201
{
200202
name: 'PersistentSingleTabManagerSettings',
201203
reason:
202-
'Configuration interface for the persistent single-tab manager. The local ' +
203-
'cache configuration API is not yet implemented in RN Firebase.',
204+
'Web persistent-cache single-tab manager settings. React Native has no ' +
205+
'firebase-js-sdk tab-manager component path.',
204206
},
205207
{
206208
name: 'PersistentTabManager',
207209
reason:
208-
'Base interface for persistent tab manager strategies. The local cache ' +
209-
'configuration API is not yet implemented in RN Firebase.',
210+
'Web persistent-cache tab-manager base interface. React Native has no ' +
211+
'firebase-js-sdk tab-manager component path; native persistence is controlled by ' +
212+
'platform SDK settings.',
210213
},
211214
],
212215

@@ -265,19 +268,22 @@ const config: PackageConfig = {
265268
name: 'deleteAllPersistentCacheIndexes',
266269
reason:
267270
'Returns `Promise<void>` in RN Firebase vs `void` in the firebase-js-sdk. ' +
268-
'Phase S hint: **keep-async: deferred persistent-cache IO** (web void schedules disk/index work; see PS-S2-gap).',
271+
'RN Firebase delegates persistent-cache index deletion to native SDK IO and exposes ' +
272+
'completion/failure through the returned Promise; the web SDK starts the operation and returns void.',
269273
},
270274
{
271275
name: 'disablePersistentCacheIndexAutoCreation',
272276
reason:
273277
'Returns `Promise<void>` in RN Firebase vs `void` in the firebase-js-sdk. ' +
274-
'Phase S hint: **keep-async: deferred persistent-cache IO** (see PS-S2-gap).',
278+
'RN Firebase delegates persistent-cache index state to native SDK IO and exposes ' +
279+
'completion/failure through the returned Promise; the web SDK starts the operation and returns void.',
275280
},
276281
{
277282
name: 'enablePersistentCacheIndexAutoCreation',
278283
reason:
279284
'Returns `Promise<void>` in RN Firebase vs `void` in the firebase-js-sdk. ' +
280-
'Phase S hint: **keep-async: deferred persistent-cache IO** (see PS-S2-gap).',
285+
'RN Firebase delegates persistent-cache index state to native SDK IO and exposes ' +
286+
'completion/failure through the returned Promise; the web SDK starts the operation and returns void.',
281287
},
282288
{
283289
name: 'FirestoreSettings',

docs/firestore/pipelines/sdk-compatibility.mdx

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ CI enforces parity through `yarn compare:types` and the `firestore-pipelines` al
1111

1212
# Summary
1313

14-
| Category | Status |
15-
| --------------------------------------------------------------------------- | --------------------------------------------------------------------- |
16-
| Core pipeline builder (`pipeline()`, stages, `execute()`) | **Supported** on Android, iOS, and macOS |
17-
| Expression helpers (aggregates, strings, arrays, maps, timestamps, vectors) | **Mostly supported** — see gaps below |
18-
| Newer firebase-js-sdk helpers (2025–2026) | **Partial** — tracked in "Not yet available" |
14+
| Category | Status |
15+
| --------------------------------------------------------------------------- | ---------------------------------------- |
16+
| Core pipeline builder (`pipeline()`, stages, `execute()`) | **Supported** on Android, iOS, and macOS |
17+
| Expression helpers (aggregates, strings, arrays, maps, timestamps, vectors) | **Supported** on Android, iOS, and macOS |
18+
| Current firebase-js-sdk pipeline exports | **Supported** through compare-types |
1919

2020
# Not yet available in React Native Firebase
2121

@@ -27,16 +27,9 @@ Compare-types parity does not guarantee identical runtime behavior on every targ
2727

2828
If you depend on one of these, follow [Firebase pipeline release notes](https://firebase.google.com/support/release-notes/js) and React Native Firebase changelogs, or open a feature request with your use case.
2929

30-
# Same name, slightly different shape
30+
# Type-shape parity
3131

32-
These exports exist in both SDKs but differ in typing or optional parameters:
33-
34-
| Export | Difference |
35-
| ----------------- | --------------------------------------------------------------------- |
36-
| `timestampDiff` | Declaration overload ordering differs; all four SDK shapes supported |
37-
| `isType` | Accepts the type name as a `string`, matching the JS SDK |
38-
| `StageOptions` | Equivalent runtime shape; declaration formatting differs |
39-
| `TimeGranularity` | RNFB uses `isoWeek` / `isoYear`; JS SDK also lists lowercase variants |
32+
The current `firestore-pipelines` compare-types config has no `differentShape` entries. `StageOptions`, `TimeGranularity`, `isType`, and `timestampDiff` now match the firebase-js-sdk declarations, including the lowercase `isoweek` and `isoyear` time granularity literals.
4033

4134
# Platform execution matrix
4235

0 commit comments

Comments
 (0)