As of origin/main 9122437c, 2026-11-29.
This document compares the public API of Cloud Storage for Firebase in four official SDKs with firebase_storage_dart 0.1.0 (firebase_storage/firebase_storage_dart):
Read from docs/storage_parity.md on origin/main at 9122437c.
packages/storage/src of firebase-js-sdk main. It is the reference for the protocol and for behaviour.firebase-storage of firebase-android-sdk.FirebaseStorage of firebase-ios-sdk.storage of firebase-cpp-sdk (the desktop code speaks REST itself; the mobile wrappers delegate to the native SDKs).firebase_storage_dart 0.1.0 as it is in the code.The sources were read as shallow clones on 2026-11-21, from GitHub only. Line numbers are from that reading and will drift. A cell of the Dart column that says "gap" means there is no equivalent; "n/a" means the feature belongs to another runtime; the notes say how a decided behaviour works. A "—" means the SDK has no such API.
Path shorthand: J: is JS src/, A: is Android src/main/java/com/google/firebase/storage/, I: is iOS Sources/, C: is C++ storage/src/ (C:d desktop, C:i iOS wrapper, C:a Android wrapper).
Where the C++ wrapper on mobile delegates to the native SDK, the behaviour of that SDK applies. C++ desktop is the only C++ code that speaks HTTP itself, and its behaviour is described where it differs.
Same: Dart has it as the official SDKs do. Different: Dart has it, in another shape or with other behaviour. Missing: a gap Dart could close. Won't do: will not be done, is not needed, makes no sense in Dart or does not apply to it; none of it is a gap. The doc has no Status column for Storage; the tag is read from the Dart cell: a cell that starts with “gap” is Missing, except “gap (not needed)”, “gap (won't do)”, “gap (n/a)” and “gap (StateError)”, which are Won't do; “n/a” and “—” are Won't do; every other cell is Same.
| Feature | JS | Android | iOS | C++ | Dart | Notes |
|---|---|---|---|---|---|---|
| Get default instance | getStorage(app?) api.ts:330 | FirebaseStorage.getInstance() / Firebase.storage | Storage.storage() | Storage::GetInstance(app) | FirebaseStorage(app) | Dart has no instance cache by design (shim does it). |
| Instance for another bucket | getStorage(app, 'gs://b') | getInstance(app, url) | Storage.storage(app:url:) | GetInstance(app, url) | bucket: | Android/iOS/C++ reject a URL with a path component; JS Location.makeFromBucketSpec does the same via regex. |
| Bucket from app options | options.storageBucket (extractBucket service.ts:31) | same | same (fatalError when missing, Storage.swift:341) | app->options().storage_bucket() | default app.options.storageBucket, else ArgumentError | JS throws no-default-bucket / invalid-default-bucket. |
Accept bucket with or without gs:// | yes | yes | yes | yes | yes | |
| Read the bucket back | ref.bucket | ref.getBucket() | ref.bucket | Storage::url() | FirebaseStorage.bucket | |
| Read the app back | storage.app | getApp() | storage.app | app() | app | |
| Emulator | connectStorageEmulator(storage, host, port, {mockUserToken}) api.ts:356; also auto from FIREBASE_STORAGE_EMULATOR_HOST via getDefaultEmulatorHostnameAndPort api.ts:337 | useEmulator(host, port) | useEmulator(withHost:port:) | UseEmulator(host, port) (logs an error and ignores a second call once configured, C:d storage_desktop.cc:140) | emulatorHost (host:port), emulatorHostFromEnvironment | |
| Emulator mock token | options.mockUserToken (string or object, sets _overrideAuthToken) service.ts:59 | — | — | — | mockUserToken | JS only. |
| Emulator over https (Cloud Workstations) | isCloudWorkstation(host) picks https and pings the server, service.ts:50 | — | — | — | gap | Dart's emulator is http only. Rare. |
| Custom host or domain (non-emulator) | internal host setter only, default firebasestorage.googleapis.com (J:implementation/constants.ts) | constant PROD_BASE_URL (A:network/NetworkRequest.java:52), not configurable | fixed | fixed | gap (not needed) | No official SDK exposes a public custom-host option outside the emulator. |
| Attach tokens over plain http | JS always sends (emulator http) | sends | only https or loopback, unless debug-only allowInsecureTokenAttachment (I:Internal/StorageTokenAuthorizer.swift:47) | desktop sends | tokens only over https, the emulator or loopback (0.1.0) | Decided for 0.1.0: the client attaches a token only to an https host, to emulatorHost, or to a loopback host. |
| Max operation retry time (get/update metadata, delete, list, URL) | maxOperationRetryTime, 2 min, settable | set/getMaxOperationRetryTimeMillis, 2 min | maxOperationRetryTime, 120 s | max_operation_retry_time, 120 s | StorageRetryPolicy.operation | Dart is immutable at construction; others are mutable at runtime. |
| Max upload retry time | maxUploadRetryTime, 10 min | set/getMaxUploadRetryTimeMillis, 10 min | maxUploadRetryTime, 600 s | max_upload_retry_time, 600 s | upload | |
| Max download retry time | none (downloads use the operation time, requests.ts:219) | set/getMaxDownloadRetryTimeMillis, 10 min | maxDownloadRetryTime, 600 s | max_download_retry_time, 600 s | download (10 min) | Dart follows the three-value split of the native SDKs, JS only has two. Notes need to say which JS value is used for Dart download when it differs. |
| Max per-chunk upload retry | — | set/getMaxChunkUploadRetry, 60 s (A:FirebaseStorage.java:56) | — | — | gap | Android caps retrying one chunk separately from the overall upload. |
| Max upload chunk size | none, fixed 256 KiB growing to 16 MiB effective (J:task.ts:336) | none, 256 KiB growing to 32 MiB (A:UploadTask.java:59-60) | uploadChunkSizeBytes, default unlimited, rounded to 256 KiB multiples (I:Storage.swift:109) | — | FirebaseStorage(maxUploadChunkSize:), default null (0.1.1) | Like iOS: null sends the rest of an upload of bytes or a file in one request on the VM (iOS also uses one request by default); a value is rounded down to a multiple of 256 KiB, at least 256 KiB. Streams and the web are always chunked, up to 16 MiB or the cap. |
| Callback queue / executor | — (promises, microtasks) | Executor and Activity overloads on every listener | callbackQueue: DispatchQueue, default main (I:Storage.swift:112) | callbacks on a worker thread, no queue option | n/a | Dart streams and futures deliver on the event loop. |
| App Check | appCheckProvider.getToken() -> X-Firebase-AppCheck; error -> header dropped; FirebaseServerApp.settings.appCheckToken shortcut (service.ts:182) | InteropAppCheckTokenProvider | AppCheckInterop.getToken(forcingRefresh:false), header X-Firebase-AppCheck (I:StorageTokenAuthorizer.swift:69) | desktop waits up to 10 s for a token (C:d storage_reference_desktop.cc:234) | app.appCheckProvider?.getToken | |
| Auth header | Authorization: Firebase <idToken> (request.ts:237) | same | same | same | yes | |
| Auth 401 handling | one retry is not done; 401 maps to unauthenticated | same | same | kErrorUnauthenticated | one forced refresh | Dart adds one forced token refresh; no official SDK does. See the differences below. |
X-Firebase-Storage-Version | webjs/<sdk version> (request.ts:245) | Android/<gms version> | ios/<version> | Cpp/<version> | dart/<version> | |
X-Firebase-GMPID | dead code path, _appId always null (request.ts:251) | sent (A:NetworkRequest.java:62) | sent (I:StorageTokenAuthorizer.swift:36) | not sent | yes (a deliberate fix, see below) | |
| Per-request timeout | RequestInfo.timeout = retry budget | connection timeouts + retry budget | request.timeoutInterval = maxUploadRetryTime for uploads | none (timeout_ms = 0 for gets, C:d storage_reference_desktop.cc:245) | requestTimeout, an idle timeout (0.1.1) | Fires when no byte of the request body is sent for that long, when no response comes that long after the body was sent, or when a response body pauses that long; a long transfer never times out while data flows. On the web it bounds the time to the response. |
| Release resources / dispose | app.delete() -> app-deleted for later requests (service.ts:346) | — | — | ~Storage() | close() (later calls throw StateError) | |
| Instance equality | — | equals on app+url | isEqual, hash | — | gap (trivial) |
| Feature | JS | Android | iOS | C++ | Dart | Notes |
|---|---|---|---|---|---|---|
| Root reference | ref(storage) | getReference() | reference() | GetReference() | ref() | |
| Reference by path | ref(storage, 'a/b') | getReference(path) | reference(withPath:) | GetReference(path) | ref(path) | |
| Reference from URL | ref(storage, 'gs://…' or 'https://…') (location.ts) | getReferenceFromUrl(url) | reference(forURL:), reference(for: URL) | GetReferenceFromUrl(url) | refFromUrl | JS accepts gs://, firebasestorage /v0/b/<bucket>/o/<path> and storage.googleapis.com / storage.cloud.google.com. A different bucket gives bucketMismatch on iOS, an error on C++, accepted on JS and Android. Dart follows JS. |
| Reference from another reference | ref(ref, path) | child | child | Child | child | |
child(path) normalises slashes | yes (child() path.ts) | yes (Slashes.normalizeSlashes, A:internal/Slashes.java) | yes (StoragePath) | yes | yes | |
parent | ref.parent (null at root) | getParent() | parent() | GetParent() | yes | |
root | ref.root | getRoot() | root() | — | yes | |
name | ref.name | getName() | name | name() | yes | |
fullPath | ref.fullPath | getPath() | fullPath | full_path() | yes | |
bucket | ref.bucket | getBucket() | bucket | bucket() | yes | |
storage back-reference | ref.storage | getStorage() | storage | storage() | yes | |
gs:// string | toString() | toString() | description | — | gsUri, toString | |
| Equality / hash | — | equals, hashCode, compareTo (A:StorageReference.java:675-689) | isEqual, hash | — | yes (==, hashCode); gap: compareTo | Trivial, later. |
| Operations on the root reference | throw invalid-root-operation (reference.ts:146) | request fails (404 etc.) | request fails | request fails | invalid-root-operation (0.1.0) | Decided for 0.1.0: the client throws before sending a request. |
| Reference validity check | — | — | — | is_valid() | n/a | C++ null-object pattern. |
| Active task lists | — | getActiveUploadTasks(), getActiveDownloadTasks() | — | — | gap (won't do) | Android keeps a task registry (A:StorageTaskManager.java). Shim can do it. |
Field names are given per SDK. "R" = read-only, "S" = settable at upload or update.
| Field | JS (FullMetadata) | Android (StorageMetadata) | iOS (StorageMetadata) | C++ (Metadata) | Dart | Notes |
|---|---|---|---|---|---|---|
| bucket | bucket R | getBucket() R | bucket R | bucket() R | bucket R | |
| fullPath | fullPath R | getPath() R | path R | path() R | fullPath R | |
| name | name R | getName() R | name R | name() R | name R | |
| generation | generation R (string) | getGeneration() R (string) | generation R (Int64) | generation() R (int64) | generation R | JS and Android use a string, and so does Dart (String?). |
| metageneration | metageneration R | getMetadataGeneration() R | metageneration R | metadata_generation() R | metageneration R | |
| size | size R (number) | getSizeBytes() R | size R | size_bytes() R | size R (int) | |
| timeCreated | timeCreated R (ISO string) | getCreationTimeMillis() R | timeCreated R (Date) | creation_time() R (seconds on desktop, C:d metadata_desktop.cc:41) | timeCreated R (DateTime?) | |
| updated | updated R (string) | getUpdatedTimeMillis() R | updated R | updated_time() R | updated R | |
| md5Hash | md5Hash R, and in UploadMetadata settable ("Base64 MD5 of the object being uploaded", public-types.ts:169) | getMd5Hash() R | md5Hash R | md5_hash() R | md5Hash R and S (0.1.0) | SettableMetadata.md5Hash is sent with an upload, as UploadMetadata.md5Hash in JS. Production does not verify it: it stores the real hash of the data, so compare the md5Hash of the returned FullMetadata yourself. |
| cacheControl | S | setCacheControl S | S | set_cache_control S | S | |
| contentDisposition | S | S | S | S | S | |
| contentEncoding | S | S | S | S | S | |
| contentLanguage | S | S | S | S | S | |
| contentType | S | S | S | S | S | |
| customMetadata | customMetadata S (map) | setCustomMetadata(key, value), getCustomMetadataKeys() | customMetadata S | custom_metadata() map, desktop returns a pointer | customMetadata S | |
| downloadTokens | downloadTokens R (string[], from comma list) | — | — | — | downloadTokens R | Only JS surfaces them. |
| Back-reference to reference | ref R (optional) | getReference() | — | reference() | gap (won't do) | Dart FullMetadata has no ref, Reference already holds it. |
| isFile / isFolder | — | — | isFile, isFolder (I:StorageMetadata.swift:130; .folder is never set) | — | gap (won't do) | |
| Raw dictionary form | — | — | dictionaryRepresentation(), init(dictionary:) | — | toJson() | |
| Copy-with | — | Builder(original) | copy() | copy ctor | SettableMetadata.copyWith | |
getMetadata | getMetadata(ref) | getMetadata() | getMetadata(completion:) | GetMetadata() | metadata() | GET /b/<bucket>/o/<path> in all of them. |
updateMetadata | updateMetadata(ref, SettableMetadata) | updateMetadata(metadata) | updateMetadata(_:) | UpdateMetadata(metadata) | updateMetadata | PATCH. JS semantics for "clear a field" (null) are in implementation/metadata.ts (metadataToDict); the Dart documentation of SettableMetadata states it. |
| Default content type at upload | metadata.contentType, else blob type, else application/octet-stream (requests.ts:300) | from stream/uri, else application/octet-stream | from file extension (I:StorageUploadTask.swift:310), else required | content_type argument | yes (JS rule) |
| Feature | JS | Android | iOS | C++ | Dart | Notes |
|---|---|---|---|---|---|---|
| Upload bytes, simple | uploadBytes(ref, Blob/Uint8Array/ArrayBuffer, metadata) (multipart/related, X-Goog-Upload-Protocol: multipart) requests.ts:330 | putBytes(byte[], metadata?) (always resumable) | putData(_:metadata:) (always resumable) | PutBytes(buffer, size, metadata?, listener?, controller?) (desktop: one POST of the raw body, C:d storage_reference_desktop.cc:445) | putBytes | Only JS has a non-resumable multipart path. Android, iOS use resumable for every size. |
| Upload bytes, resumable, with task | uploadBytesResumable | putBytes returns UploadTask | putData returns StorageUploadTask | PutBytes returns a future plus Controller | startUpload | |
| Resumable threshold | data > 256 KiB resumable; smaller single request (task.ts:172) | always | always | none (single POST) | startUpload: up to 256 KiB one multipart request, above that a session; putBytes and putString always one multipart request (0.1.0) | As JS for startUpload. putBytes and putString never open a session, whatever the size. |
| String upload | uploadString(ref, value, format, metadata) | — | — | — | putString | |
| String formats | raw (UTF-8), base64, base64url, data_url (J:implementation/string.ts:38-62) | — | — | — | StringFormat.raw/base64/base64Url/dataUrl | invalid-format on bad input. |
| Upload from file | — (browser File is a Blob) | putFile(Uri, metadata?, existingUploadUri?) | putFile(from: URL, metadata?) | PutFile(path, metadata?, listener?, controller?) | putFile(File) in io.dart | iOS on device can use a background URLSession for file uploads (I:StorageUploadTask.swift:130-140); no Dart equivalent. |
| Upload from stream | — (Node/browser streams are not accepted) | putStream(InputStream, metadata?) (unknown length allowed, total byte count -1) | — | — | startStreamUpload(Stream, length:); length optional since 0.2.0 (totalBytes -1 until the stream ended) | Android accepts unknown length through AdaptiveStreamBuffer. Dart without length: always a resumable session started without X-Goog-Upload-Header-Content-Length, chunks of 256 KiB doubling to 16 MiB (or maxUploadChunkSize), one stream event read ahead so the last chunk goes with upload, finalize (an empty stream sends one empty finalize). The chunk stays in memory until confirmed, for retries and resume. |
| Upload from Blob | Blob | — | — | — | n/a | Web only. Dart uses Uint8List. |
| Upload from ArrayBuffer / Uint8Array | yes | byte[] | Data | void* + size | Uint8List | |
| Pause | task.pause() -> bool | pause() | pause() | Controller::Pause() | pause() | |
| Resume | task.resume() -> bool | resume() | resume() | Controller::Resume() | resume() | |
| Cancel | task.cancel() -> bool (JS cancels from running only, in practice paused is ignored; doc says both) | cancel() | cancel() | Controller::Cancel() | cancel() (also from paused, a deliberate fix) | |
| Progress | on('state_changed', next) with UploadTaskSnapshot {bytesTransferred, totalBytes, state, metadata, ref, task} | addOnProgressListener (bytesTransferred, totalByteCount) | observe(.progress) with snapshot.progress | Listener::OnProgress(controller) | progress stream | |
| Paused notification | state paused in state_changed | addOnPausedListener | observe(.pause) | Listener::OnPaused | UploadState.paused on the stream | |
| Success / failure listeners | then, catch, observer complete/error | addOnSuccess/Failure/Complete/Canceled Listener, getResult, getException | observe(.success), observe(.failure) | futures | result future | |
| Canceled as a distinct signal | state canceled, rejection with canceled | addOnCanceledListener, isCanceled | StorageErrorCode.cancelled | kErrorCancelled | canceled exception | |
| Task state query | snapshot.state | isInProgress, isPaused, isComplete, isSuccessful, isCanceled | snapshot.status (resume/progress/pause/success/failure) | Controller::is_paused(), bytes_transferred(), total_byte_count() | state, bytesTransferred, totalBytes | |
| Remove listeners | unsubscribe function from on | removeOn*Listener | removeObserver(withHandle:), removeAllObservers | listener lifetime | n/a | Dart stream subscription cancel. |
| Activity-scoped listeners | — | addOn*Listener(Activity, …) auto-removed on stop (A:internal/ActivityLifecycleListener.java) | — | — | n/a | Android lifecycle. |
| Async/await form | promise is thenable | Task<T> (Play services) and Kotlin taskState Flow (A:Storage.kt:143) | putDataAsync(_:metadata:onProgress:) etc. (I:AsyncAwait.swift) | Future<T> | result future plus stream | |
| Task as Future | UploadTask.then | Task<T> | — | Future<T> | result (client); shim yes | The client's tasks are not Futures (await result). FlutterFire's Task implements Future<TaskSnapshot> over TaskPlatform.onComplete, so await ref.putData(...) and await ref.writeToFile(...) complete with a snapshot through the shim (firebase_storage_dart_platform/test/task_test.dart, group "tasks are futures"). |
| Upload session start | POST X-Goog-Upload-Command: start + X-Goog-Upload-Header-Content-Length/Type (requests.ts:428) | ResumableUploadStartRequest | GTMSessionUploadFetcher (uploadType=resumable, I:StorageUploadTask.swift:112) | — | yes | |
| Upload session query (after failure, pause, resume) | X-Goog-Upload-Command: query, reads X-Goog-Upload-Size-Received (requests.ts:465) | ResumableUploadQueryRequest | GTM | — | yes | |
| Resume the same session after an app restart | — | putFile(uri, metadata, existingUploadUri) plus TaskSnapshot.getUploadSessionUri() (A:StorageReference.java:280, UploadTask.java:622) | — (GTM keeps a session in-process; background session for files) | — | UploadTask.sessionUri, existingSessionUri on startUpload, startStreamUpload, putFile (0.1.0) | Decided for 0.1.0, after Android. The uploaded bytes are asked from the server (query) before sending. |
Session cancel on cancel() | X-Goog-Upload-Command: cancel | ResumableUploadCancelRequest | GTM stop | — | yes (JS) | |
| Chunk size, first | 256 KiB (RESUMABLE_UPLOAD_CHUNK_SIZE) | 256 KiB (PREFERRED_CHUNK_SIZE) | whole object by default (.max), caller can cap | — | 256 KiB | |
| Chunk growth | doubles after each success while size*2 < 32 MiB, so the cap is 16 MiB (task.ts:336) | doubles while < 32 MiB, resets to 256 KiB after a failed send (A:UploadTask.java:486-497) | none | — | doubling, cap 16 MiB (or maxUploadChunkSize), when chunked | Android resets the chunk size after a failure, JS does not. Dart chunks streams, the web and instances with maxUploadChunkSize; on the VM bytes and files go in one request. |
| Upload commands | upload, upload, finalize, finalize with X-Goog-Upload-Offset (requests.ts:538) | same | GTM | — | yes | |
| Checksum on upload | md5Hash in UploadMetadata; no client-side verification | none; HTTP 409 maps to ERROR_INVALID_CHECKSUM (A:StorageException.java:89) | none (nonMatchingChecksum exists, but nothing raises it, I:StorageError.swift:121) | kErrorNonMatchingChecksum (mapped from iOS/Android) | gap: the client does not verify; production does not either | No official SDK verifies the MD5 or CRC32C on the client. JS has a TODO for per-range x-range-md5 (requests.ts:560). |
| Server size mismatch guard | server-file-wrong-size when status total differs from the data (requests.ts:529) | "Unexpected error. The server lost a chunk update." (A:UploadTask.java:406) | — | — | server-file-wrong-size | |
| Retry of a failing chunk | whole-request backoff (see section 10) | per-chunk loop with sleepTime that resets on success (A:UploadTask.java:341-456) | GTM retry | desktop retries whole POST | JS backoff, with the wait reset |
| Feature | JS | Android | iOS | C++ | Dart | Notes |
|---|---|---|---|---|---|---|
| Bytes into memory | getBytes(ref, maxDownloadSizeBytes?) -> ArrayBuffer | getBytes(long maxDownloadSizeBytes) (required) | getData(maxSize:completion:), data(maxSize:) async | GetBytes(buffer, buffer_size, listener?, controller?) | getBytes({maxSize}) | Different semantics below. |
| Behaviour at the size limit | Sends Range: bytes=0-N, accepts 200 or 206, then truncates to N silently (J:reference.ts:157-170, requests.ts:228). No error. | Throws IndexOutOfBounds ("the maximum allowed buffer size was exceeded"), mapped to unknown (A:StorageReference.java:411) | Cancels the task with downloadSizeExceeded(total:maxSize:) (I:StorageReference.swift:196, 563) | Android/iOS wrappers return kErrorDownloadSizeExceeded; desktop copies what fits the buffer | getBytes throws download-size-exceeded (0.1.0) | Decided for 0.1.0: the request asks for maxSize + 1 bytes, so one extra byte proves the overflow. JS truncates silently. |
| Blob | getBlob (browser only; Node throws) | — | — | — | n/a | |
| Stream | getStream (Node only: ReadableStream; browser throws) | getStream(), getStream(StreamProcessor) -> StreamDownloadTask | — | — | openRead([start, end]) | |
| Range / offset | Range only via maxDownloadSizeBytes (start fixed at 0) | GetNetworkRequest sets Range: bytes=<start>- to resume (A:network/GetNetworkRequest.java:32) | via GTM resume data | — | openRead(start, end) | Only the Dart plan exposes arbitrary ranges. |
| To a file | — | getFile(File), getFile(Uri) -> FileDownloadTask | write(toFile:) -> StorageDownloadTask, writeAsync | GetFile(path, listener?, controller?) | startDownloadToFile(File) -> DownloadTask and writeToFile(File) -> Future<int> in io.dart (partial sibling, rename on success) | |
| Download task object | — | FileDownloadTask, StreamDownloadTask (both StorageTask) | StorageDownloadTask (observable) | Controller out-parameter | DownloadTask for files, VM only (io.dart, 0.2.0); the shim's writeToFile wraps it | No task for streams: openRead is a Stream, paused and canceled through its subscription. |
| Pause / resume / cancel download | — | pause(), resume(), cancel() on both tasks | pause(), resume(), cancel() (resume data in memory, I:StorageDownloadTask.swift:67) | Controller (desktop uses curl pause) | DownloadTask.pause(), resume(), cancel() (0.2.0); cancel from paused too | A pause closes the connection (a held-open response times out on the server); resume() sends Range: bytes=<written>- from the partial file. |
| Resume after failure | — | file download resumes from the written offset and fails when the ETag changes (A:FileDownloadTask.java:213-225); stream task throws "The ETag on the server changed" (A:StreamDownloadTask.java:133) | GTM resume data | — | DownloadTask (and writeToFile) resume from the written offset after a broken body, with the backoff and download time of StorageRetryPolicy, reset by bytes received (0.2.0) | Generation guard instead of the ETag: each response's x-goog-generation is compared with the metadata's generation; without the header the metadata is read again before a resumed request and before the rename. A change fails with object-changed. The ETag is not used: it changes with the metageneration (a metadata-only update), which would fail downloads whose bytes did not change. |
| Download progress | — | addOnProgressListener on both | observe(.progress), progress: Progress | Listener::OnProgress | DownloadTask.progress (0.2.0) | At most one event per 64 KiB and 100 ms, plus the size once the metadata is read and every change of state; no replay, as uploads (gap 7). openRead has no progress. |
| Download chunk size | — | 256 KiB (PREFERRED_CHUNK_SIZE, both tasks) | — | — | n/a | |
| Download URL | getDownloadURL(ref) -> https://<host>/v0/b/<bucket>/o/<path>?alt=media&token=<first token> (metadata.ts:166-190) | getDownloadUrl() -> Uri | downloadURL(completion:) | GetDownloadUrl() | downloadUrl() | JS throws no-download-url when the object has no token (reference.ts:474). iOS builds the same URL (StorageGetDownloadURLTask.swift:69). |
| Download URL with a token that is missing | no-download-url | StorageException (object has no token) | StorageError.unknown/404 | error | no-download-url (0.1.0) | Dart raises it, as JS does. |
| Download over emulator | URL uses http://host:port | same | same | same | as JS |
| Feature | JS | Android | iOS | C++ | Dart | Notes |
|---|---|---|---|---|---|---|
| One page | list(ref, {maxResults, pageToken}) | list(int maxResults), list(int, String pageToken) | list(maxResults:), list(maxResults:pageToken:) | List(max_results_per_page = 1000, page_token) | list({maxResults, pageToken}) | Request has delimiter=/, prefix=<path>/, maxResults, pageToken. |
| All pages | listAll(ref) (recursive helper, default page size 1000) | listAll() | listAll(completion:) | — (loop List yourself) | listAll() | |
| Lazy paging as a stream | — | — | — | — | listPages({pageSize}) | Dart extra. |
maxResults bounds | 1..1000, invalid-argument | 1..1000, IllegalArgumentException (A:StorageReference.java:562-587) | none client-side | none client-side (default 1000) | 1..1000 | |
| Result fields | items, prefixes, nextPageToken | getItems(), getPrefixes(), getPageToken() | items, prefixes, pageToken | items(), prefixes(), next_page_token() | ListResult(items, prefixes, nextPageToken) | Android and iOS call it pageToken. |
| Prefix and items as references | StorageReference | StorageReference | StorageReference | StorageReference | Reference | |
| Listing needs Rules v2 | yes | yes | yes (doc, I:Result.swift:83) | yes | doc | Note in Dart docs. |
| Kotlin destructuring | — | component1..3 | — | — | n/a |
| Feature | JS | Android | iOS | C++ | Dart | Notes |
|---|---|---|---|---|---|---|
| Delete object | deleteObject(ref) | delete() | delete(completion:) | Delete() | delete() | DELETE /b/<bucket>/o/<path>. |
| Delete a folder or prefix | — | — | — | — | — | No SDK supports recursive delete. |
| Delete a missing object | object-not-found | ERROR_OBJECT_NOT_FOUND | objectNotFound | kErrorObjectNotFound | object-not-found |
Mapping from HTTP status (all SDKs read the status; error body use differs). "Raised?" says whether the code is produced anywhere in that SDK's source.
| Code (JS name) | JS | Android | iOS | C++ | Dart | Notes |
|---|---|---|---|---|---|---|
unknown | yes (any other status) | ERROR_UNKNOWN -13000 | unknown -13000 | kErrorUnknown | unknown | |
object-not-found | 404 | ERROR_OBJECT_NOT_FOUND -13010 (404) | objectNotFound -13010 (404) | kErrorObjectNotFound | object-not-found | |
bucket-not-found | defined, never raised | ERROR_BUCKET_NOT_FOUND -13011, never raised | bucketNotFound -13011, never raised | kErrorBucketNotFound, never raised on desktop | not raised | Server 404 is ambiguous, all SDKs report object-not-found. |
project-not-found | defined, never raised | ERROR_PROJECT_NOT_FOUND -13012, never raised | projectNotFound -13012, never raised | kErrorProjectNotFound | not raised | |
quota-exceeded | 402 | ERROR_QUOTA_EXCEEDED -13013 (no 402 mapping in calculateErrorCode) | quotaExceeded (402) | kErrorQuotaExceeded (402) | quota-exceeded | |
unauthenticated | 401 | ERROR_NOT_AUTHENTICATED -13020 | unauthenticated -13020 | kErrorUnauthenticated | unauthenticated | |
unauthorized | 403 | ERROR_NOT_AUTHORIZED -13021 | unauthorized -13021 | kErrorUnauthorized | unauthorized | |
unauthorized-app | 401 with body text "Firebase App Check token is invalid" (requests.ts:112) | — | — | — | unauthorized-app (from the body of the error response) | JS only. |
retry-limit-exceeded | backoff budget spent (request.ts:182, task.ts:130) | ERROR_RETRY_LIMIT_EXCEEDED -13030 (NETWORK_UNAVAILABLE); getIsRecoverableException() | retryLimitExceeded -13030 | kErrorRetryLimitExceeded (also 408 on desktop, C:d curl_requests.cc:84) | retry-limit-exceeded | |
invalid-checksum | defined, never raised | ERROR_INVALID_CHECKSUM -13031 (HTTP 409) | nonMatchingChecksum -13031, never raised | kErrorNonMatchingChecksum | not raised | Mapped by status 409 only on Android. |
download-size-exceeded | — | — (wrapped as unknown) | downloadSizeExceeded -13032 | kErrorDownloadSizeExceeded | download-size-exceeded | |
object-changed | — | "The ETag on the server changed" (text of a StorageException, A:StreamDownloadTask.java:133) | — | — | object-changed (0.2.0) | Dart only: a DownloadTask saw a new generation of the object (gap 9). The shim keeps the code. |
canceled | yes | ERROR_CANCELED -13040 | cancelled -13040 | kErrorCancelled | canceled | Spelling differs between SDKs, Dart follows JS. |
invalid-event-name | defined, never raised | — | — | — | gap (won't do) | |
invalid-url | bad gs:///https URL | IllegalArgumentException | bucketMismatch / invalidArgument | log + invalid reference | invalid-url | |
invalid-default-bucket | bad storageBucket in options | — | fatalError | — | ArgumentError | |
no-default-bucket | no storageBucket | — | fatalError (I:Storage.swift:341) | — | ArgumentError | |
cannot-slice-blob | blob slice returned null | — | — | — | gap (n/a) | Blob only. |
server-file-wrong-size | yes | text only | — | — | server-file-wrong-size | |
no-download-url | yes | — | — | — | no-download-url (0.1.0) | Add. |
invalid-argument | validators (e.g. maxResults) | IllegalArgumentException | invalidArgument -13050 | — | invalid-argument | |
invalid-argument-count | defined, never raised | — | — | — | gap (n/a) | |
app-deleted | requests after app.delete() | — | — | — | gap (StateError) | Dart throws StateError after close(). |
invalid-root-operation | root reference | — | — | — | invalid-root-operation (0.1.0) | Add. |
invalid-format | bad string for uploadString | — | — | — | invalid-format | |
internal-error | impossible-state checks | — | internalError -13052 | — | internal-error (0.2.0) | Raised when an upload session reports more bytes than the client sent, or a data source returns another size than asked. Malformed responses stay unknown, as JS handlerCheck. |
unsupported-environment | missing polyfill, getBlob in Node | — | — | — | gap (n/a) | |
bucket-mismatch | — | — | bucketMismatch -13051 | GetReferenceFromUrl check (C:common storage.cc:199) | follow JS | |
path-error | — | — | pathError -13053 | — | gap (n/a) | |
| HTTP status on the error | StorageError.status (set, but 0 for object-not-found, error.ts:42) | getHttpResultCode() | ResponseErrorCode in userInfo | — | httpStatus (always set) | |
| Server body on the error | customData.serverResponse (raw string) | — | ResponseBody in userInfo | — | serverResponse (16 KiB cap) | |
| Underlying cause | — | getCause() | NSUnderlyingErrorKey | — | cause (with its stackTrace) | Never part of the message or toString: the text of a provider's error may hold a credential. |
| Numeric codes | — (string) | -13000 series | -13000 series | Error enum (no values stable across wrappers) | n/a | The shim maps to FlutterFire strings. |
| Feature | JS | Android | iOS | C++ | Dart | Notes |
|---|---|---|---|---|---|---|
| Observer API | on('state_changed', next?, error?, complete?) or StorageObserver object; returns Unsubscribe | per-state addOn…Listener | observe(status, handler) -> handle string | Listener subclass (OnPaused, OnProgress) | progress broadcast stream | |
| States | running, paused, success, canceled, error | isInProgress/isPaused/isComplete/isSuccessful/isCanceled | StorageTaskStatus {unknown, resume, progress, pause, success, failure} | paused flag | UploadState {running, paused, success, canceled, error} | iOS has a distinct resume event. |
| Replay the last state to a late subscriber | on delivers the current state first (observer.ts) | listeners get a callback if already complete | observe after success fires immediately | — | progress starts with the current snapshot and does not replay earlier events (0.1.0) | Decided for 0.1.0: a late subscriber gets the snapshot of the moment it listens, then the new events. state, bytesTransferred and result give the rest. |
| Thread / queue of callbacks | event loop | main thread by default, Executor overloads | callbackQueue (default main) | arbitrary thread | event loop | |
| Task scheduling | — | StorageTaskScheduler thread pools (A:StorageTaskScheduler.java); the upload pool has 2 threads | dispatchQueue | one thread per retried request (std::thread, C:d storage_reference_desktop.cc:341) | FirebaseStorage(maxConcurrentUploads:), default 8 (0.1.1) | A first-in, first-out queue per instance; putBytes and putString count. A waiting task is running with 0 bytes, can be paused or canceled, and a paused task gives its turn away. |
| Continuations | then/catch | continueWith, continueWithTask, onSuccessTask | — | OnCompletion on Future | n/a | |
| Progress is throttled | per chunk (XHR upload progress inside a chunk too, request.ts:100) | per chunk | per GTM callback | per curl callback | on each chunk and state change | JS also reports sub-chunk progress through the connection's upload progress listener. Dart does the same on the VM (per byte, at most every 100 ms) and reports per chunk on the web, where the browser gives no upload progress. |
| Item | JS | Android | iOS | C++ | Dart | Notes |
|---|---|---|---|---|---|---|
| Retryable statuses | 5xx, 408, 429, plus request-specific extra codes (J:implementation/utils.ts); network failure that never reached the server is retried too (request.ts:128) | 5xx, 408, 429, network unavailable (A:internal/ExponentialBackoffSender.java:60) | GTMSessionFetcher defaults (5xx, 408, 429) plus "not connected to Internet" (I:Internal/StorageFetcherService.swift:90) | 5xx, 408, 429 (C:d storage_reference_desktop.cc:412) | "per JS" | |
| First wait | 1 s base, (waitSeconds + random) * 1000 where waitSeconds doubles before the first retry, so the first wait is 2 to 3 s (J:implementation/backoff.ts:35-70) | 1000 ms + 0..249 ms | GTM: 1 s, doubling | 1000 ms | yes | |
| Growth | doubles while < 64, so cap is 64 s | doubles until MAXIMUM_WAIT_TIME_MILLI = 30 s | doubles, maxRetryInterval derived from the retry time (I:Storage.swift:324) | doubles, cap 30 s | JS | |
| Jitter | Math.random() seconds (0 to 1 s) | random.nextInt(250) ms | GTM | none | injected random | |
| Wait reset on success | each request starts its own backoff at 1 s; within one request the wait never resets (waitSeconds only grows) | chunk sleepTime resets to 0 after a successful send (A:UploadTask.java:453) | GTM | per request | reset after a successful request (a deliberate fix) | JS's sleepTime in the upload task's retry loop never resets; Dart's does. |
| Overall deadline | timeout per request, from maxOperation/maxUploadRetryTime | clock.elapsedRealtime() + retryTime | derived retry interval | end_time loop | StorageRetryPolicy | |
| Cancel during backoff | stop() ends the wait, one more request is made with canceled | cancel() flag, checked after sleeping | task cancel | Controller::Cancel | injected delay is cancellable | |
| Offline handling | treated as a retryable failure | polls every second while NETWORK_UNAVAILABLE, does not double (A:ExponentialBackoffSender.java:93) | explicit retry when not connected | — | as JS | |
| Test hooks | — | static sleeper, clock | testBlock | g_retry_all_errors_for_testing | injected clock, random, delay |
| Feature | JS | Android | iOS | C++ | Dart | Notes |
|---|---|---|---|---|---|---|
| Node streams | getStream -> ReadableStream (api.node.ts:58) | — | — | — | openRead | |
| Browser Blob | getBlob, Blob upload input | — | — | — | n/a | |
| File upload from OS URI | — | putFile(Uri) (content://, file://) | putFile(from: URL) | PutFile(path) | putFile(File) in io.dart | |
| File download to OS URI | — | getFile(Uri), getFile(File) | write(toFile: URL) | GetFile(path) | writeToFile(File) | |
| Background transfers | — | — | background URLSession for file uploads on device | — | gap (won't do) | Platform runtime. |
| Lifecycle-aware listeners | — | Activity overloads | — | — | n/a | |
| Controller / listener split | — | — | — | Controller (Pause/Resume/Cancel/is_paused/bytes_transferred/total_byte_count/GetReference) and Listener (OnPaused, OnProgress) are passed to the call | n/a | Dart UploadTask plays both roles. |
| Future "last result" accessors | — | — | — | <Op>LastResult() per method | n/a | C++ Future API. |
| Kotlin extensions | — | Firebase.storage, storageMetadata {}, destructuring, taskState Flow | — | — | n/a | |
| Swift concurrency | — | — | async overloads plus Result completion overloads (I:AsyncAwait.swift, I:Result.swift) | — | n/a | |
| FirebaseServerApp | appCheckToken setting honoured (service.ts:182) | — | — | — | n/a | Server runtime object. |
| Large-file memory | Blob slice per chunk | AdaptiveStreamBuffer reads chunk by chunk | GTM reads file | desktop reads the whole file into memory for PutFile (TODO in C:d storage_reference_desktop.cc:493) | stream from disk | |
| Wire protocol | REST https://firebasestorage.googleapis.com/v0/b/<bucket>/o… | same | same (www.googleapis.com rewrite for uploads, I:StorageUploadTask.swift:103) | same | yes | |
| CORS (web) | the browser enforces it; the bucket needs a CORS configuration | — | — | — | the production bucket answers access-control-allow-origin: *, exposes the x-goog-upload-* headers on the session responses, and its preflight to the upload URL allows x-goog-upload-command and x-goog-upload-offset (verified, see the README of the package) | |
| HTTP client | XHR / fetch (Node) | HttpURLConnection | GTMSessionFetcher | curl | package:http |
The reasons behind the design are in storage_decisions.md.
The state is 0.1.0 (adopted): decided and part of the first release; 0.1.1 (adopted): added in 0.1.1; 0.2.0 (adopted): added in 0.2.0; later: wanted, not yet in a release; or won't do.
| # | State | Gap | What 0.1.0 does, or why not |
|---|---|---|---|
| 1 | 0.1.0 (adopted) | md5Hash in upload metadata (JS UploadMetadata.md5Hash) | SettableMetadata.md5Hash. Adding a field to the immutable metadata class later would be a breaking change. Production does not verify the hash on upload; compare the returned md5Hash. |
| 2 | 0.1.0 (adopted) | Size-limit semantics of getBytes (JS truncates silently; Android, iOS and C++ fail) | getBytes throws download-size-exceeded when the object is larger than maxSize. It asks for maxSize + 1 bytes with a Range header, so one extra byte proves the overflow. |
| 3 | 0.1.0 (adopted) | Resuming an upload session after the process was killed (Android existingUploadUri) | UploadTask.sessionUri, and existingSessionUri on startUpload, startStreamUpload and putFile. |
| 4 | 0.1.0 (adopted) | Error codes invalid-root-operation and no-download-url, which JS raises | Both exist, with the JS meaning. |
| 5 | 0.1.0 (adopted) | One request or a session for small uploads | startUpload sends a single multipart request up to 256 KiB and uses a resumable session above, as JS. putBytes and putString are always one multipart request. |
| 6 | 0.1.0 (adopted) | Tokens over plain http (iOS refuses unless https or loopback) | The client attaches a token only over https, to emulatorHost, or to a loopback host. |
| 7 | 0.1.0 (adopted) | Replay of the last state to a late subscriber (JS on does) | The progress stream starts with the current snapshot and does not replay earlier events. state and bytesTransferred are readable at any time, and result completes for a task that already finished. |
| 8 | 0.2.0 (adopted) | Pause, resume and progress for downloads (Android and iOS tasks, C++ controllers) | startDownloadToFile in io.dart returns a DownloadTask (progress, pause, resume, cancel, result); a pause closes the connection and resume sends Range: bytes=<written>- from the partial file; a broken body is resumed the same way. writeToFile runs on it, and the shim's writeToFile wraps it. VM only: the web has no file. |
| 9 | 0.2.0 (adopted) | An ETag or generation guard on resumed downloads (Android fails when the ETag changed) | The generation: each response's x-goog-generation against the metadata's generation, or a metadata read before each resumed request and before the rename when the server does not send the header. A change fails with object-changed. Not the ETag, which changes with metadata-only updates. |
| 10 | 0.2.0 (adopted) | Stream upload of unknown length (Android putStream) | length of startStreamUpload is optional. Without it: a resumable session even for small data, the start omits the total, each chunk is kept until the server confirms it, and one stream event is read ahead to know which chunk is the last. totalBytes is -1 until the stream ended, as Android's getTotalByteCount(). existingSessionUri works as with a length: pass the whole stream again, the bytes the server has are skipped; a session found final takes the server's size. |
| 11 | 0.2.0 (adopted) | internal-error for impossible states | internal-error, message Internal error: … as JS. Used where the client's own invariants break (a session reporting bytes never sent, a source returning another size than asked). Malformed responses keep unknown and size mismatches keep server-file-wrong-size, as JS. |
| 12 | 0.1.1 (adopted) | Chunk size cap (iOS) and per-chunk retry limit (Android) | FirebaseStorage(maxUploadChunkSize:): null (one request on the VM, like the iOS default) or a cap rounded down to 256 KiB multiples. It is transport configuration of the instance, as uploadChunkSizeBytes is on the iOS Storage, so it sits next to maxConcurrentUploads and not in StorageRetryPolicy, which is about retry time. The per-chunk retry limit stays a gap: the upload retry time covers it. |
| 13 | later | Emulator over https (JS, Cloud Workstations) | emulatorHost with an explicit scheme. Rare. |
| 14 | won't do | Active task registry, compareTo, FullMetadata.ref, isFile and isFolder, Kotlin and Swift sugar, Activity listeners, callback queues, Blob, Node streams, FirebaseServerApp, background URL sessions | Tied to another runtime, or covered by Dart streams and futures. The shim can add a task registry. |
| 15 | won't do | app-deleted, invalid-event-name, invalid-argument-count, cannot-slice-blob, unsupported-environment, path-error | Not reachable in Dart, or replaced by StateError or ArgumentError. |
Each of these is a fix, an addition or a choice. Each one has a test, named in the last column (paths are relative to firebase_storage/firebase_storage_dart).
| # | JS behaviour | Dart behaviour | Pinned by |
|---|---|---|---|
| 1 | X-Firebase-GMPID is never sent (_appId is always null, request.ts:251) | Sends X-Firebase-GMPID: <app.options.appId>, as Android and iOS do | test/requester_test.dart: headers > version and app id on every request, no token without a provider |
| 2 | StorageError.status is 0 for object-not-found (error.ts:42) | httpStatus holds the real HTTP status for every error | test/conformance/errors_conformance_test.dart: status mapping > 404 is object-not-found, with the status and the body (one test per status) |
| 3 | The body of an error response is not read for the status | serverResponse holds the body, capped at 16 KiB, never headers or tokens; a body that says the App Check token is invalid maps to unauthorized-app | test/conformance/errors_conformance_test.dart: the body in serverResponse is cut at 16 KiB; 401 with the App Check message in the body is unauthorized-app |
| 4 | cancel() acts from running only, although its doc says paused too | cancel() works from paused as well as running, as on Android | test/conformance/task_conformance_test.dart: cancel works from paused; test/upload_task_test.dart: cancel from paused |
| 5 | Chunks double while the size stays under 32 MiB; the effective cap is 16 MiB | Chunks start at 256 KiB, double after each successful chunk, stop at 16 MiB, and are a multiple of 256 KiB except the last | test/upload_task_test.dart: chunks double from 256 KiB and stop at 16 MiB |
| 6 | The backoff wait of the upload retry loop (sleepTime) never resets | The wait starts again from the beginning after a successful request | test/conformance/task_conformance_test.dart: the retry wait resets after a successful chunk; test/upload_task_test.dart: the wait doubles while chunks keep failing and starts over after a success |
| 7 | A 401 is final and maps to unauthenticated | One forced token refresh and one more request on a 401; a second 401 maps to unauthenticated. No official SDK does this. In production an invalid ID token gets 403 (unauthorized), not 401, so the refresh is not reached by invalid tokens; it applies when the backend answers 401 | test/requester_test.dart: 401 > is retried once with a refreshed token, a second 401 is unauthenticated; test/conformance/errors_conformance_test.dart: a 401 is sent again once with a refreshed token |
| 8 | Tokens are sent over any scheme | Tokens are sent only over https, to emulatorHost, or to a loopback host | test/hardening_test.dart: tokens travel only over https, to the emulator or to loopback; test/security/hosts_test.dart: token scope of the request layer |
| 9 | getBytes truncates silently at maxDownloadSizeBytes | getBytes throws download-size-exceeded | test/reference_operations_test.dart: an object larger than maxSize is download-size-exceeded; test/security/limits_test.dart: asks for maxSize + 1 bytes with a Range header |
| 10 | Downloads use the operation retry time (2 minutes) | StorageRetryPolicy.download has its own value, 10 minutes, as Android, iOS and C++ | test/requester_test.dart: downloads and uploads use their own retry time |
| 11 | Every resumable upload goes in chunks of 256 KiB doubling to 16 MiB | On the VM, an upload of bytes or of a file sends the rest of the object in one streamed request (upload, finalize); after a failure or a pause it queries the offset and streams from there. Streams, the web and instances with maxUploadChunkSize are chunked as JS | test/upload_single_request_test.dart: one request > bytes go in one request of the session, a failure in the middle resumes from the server offset (bytes, and a file) |
| 12 | No limit on uploads at once | maxConcurrentUploads (8 by default) queues the uploads of an instance, putBytes and putString included | test/upload_single_request_test.dart: maxConcurrentUploads > runs uploads in order, at most the limit at once |
userInfo or log it.cancel() only acts from running in the code path; Android cancels paused tasks. Dart follows Android.This document compares the public API of the JS SDK's firebase/auth with two Dart packages:
Read from docs/auth_parity.md on origin/main at 9122437c.
firebase_auth/firebase_auth_providers_dart, as on main. It has TOTP, the loopback exchange, link, reauthentication and GitHub flows, the request timeout and the session rules.firebase_auth/firebase_auth_dart_platform, as on main.The client was audited on 2026-11-20 against firebase-js-sdk main at a086865 (packages/auth: index.ts and what it re-exports). The shim is described as on main. Both Dart packages were checked against their code, not their READMEs. References to Dart code name the file and the symbol, not a line number. References to the JS SDK keep line numbers, which are those of commit a086865.
The Status column describes the Dart client, and the Shim column holds the shim's own result. Status is one of:
Path shorthand:
FUA and F mean lib/src/firebase_user_auth.dart.CRED means lib/src/auth_credential.dart.D: means firebase_auth_providers_dart/lib/src.S: means the shim's lib/src.J: means packages/auth/src in the JS SDK.auth_user.dart is in the client's lib/src, except where the shim column names a shim file.Same: Dart has it as the official SDKs do. Different: Dart has it, in another shape or with other behaviour. Missing: a gap Dart could close. Won't do: will not be done, is not needed, makes no sense in Dart or does not apply to it; none of it is a gap. The Status column describes the Dart client and keeps the doc's wording; “n/a” and “n/a outside a browser” are tagged Won't do.
| JS export | Dart client | Shim | Status | Notes |
|---|---|---|---|---|
| signInAnonymously | signInAnonymously() FUA | signInAnonymously firebase_auth.dart | same | |
| createUserWithEmailAndPassword | createUserWithEmailAndPassword({email,password}) FUA | positional args, firebase_auth.dart | same | Named vs positional is only a FlutterFire convention. |
| signInWithEmailAndPassword | signInWithEmailAndPassword({email,password}) FUA | firebase_auth.dart | same | |
| sendSignInLinkToEmail | sendSignInLinkToEmail({email, actionCodeSettings}) FUA | firebase_auth.dart | same | |
| isSignInWithEmailLink | isSignInWithEmailLink FUA (via ActionCodeURL.parseLink) | firebase_auth.dart | same | |
| signInWithEmailLink | signInWithEmailLink({email,emailLink}) FUA | firebase_auth.dart | same | Tenant mismatch check matches JS. JS also allows omitting email (read from storage); Dart requires it, as FlutterFire does. |
| signInWithCustomToken | signInWithCustomToken FUA | firebase_auth.dart | same | |
| signInWithCredential | signInWithCredential FUA | firebase_auth.dart | different | Client handles OAuth, email and phone credentials. Shim throws for Play Games and Game Center credentials (convert.dart clientCredentialOf), and argument-error for a phone credential of credentialFromToken (Android only). |
| linkWithCredential | FUA | user.dart | same | Re-checks provider-already-linked after a reload, like JS _assertLinkedStatus. |
| reauthenticateWithCredential | FUA | user.dart | same | Maps user-not-found and uid mismatch to user-mismatch, like JS. |
| unlink | unlink(providerId) FUA | user.dart | same | |
| signInWithPopup | none; native alternative signInWithOAuthLoopback(OAuthLoopbackProvider) FUA (PKCE, loopback redirect, system browser) | throws unimplemented firebase_auth.dart | n/a outside a browser | Needs window.open. The loopback flow is the native equivalent, but it is a different API (OAuthLoopbackProvider, not AuthProvider). The shim runs it from signInWithProvider (see Shim coverage). |
| linkWithPopup | linkWithOAuthLoopback FUA | throws user.dart | n/a outside a browser | |
| reauthenticateWithPopup | reauthenticateWithOAuthLoopback FUA | throws user.dart | n/a outside a browser | |
| signInWithRedirect | none | throws firebase_auth.dart | n/a outside a browser | Page navigation. |
| linkWithRedirect | none | throws user.dart | n/a outside a browser | |
| reauthenticateWithRedirect | none | throws user.dart | n/a outside a browser | |
| getRedirectResult | none | throws firebase_auth.dart | n/a outside a browser | |
| browserPopupRedirectResolver | none | none | n/a outside a browser | Resolver for DOM operations. |
| signInWithPhoneNumber | verifyPhoneNumber(phoneNumber, appVerification:) then signInWithCredential(PhoneAuthProvider.credential(...)) FUA; phone_auth.dart | signInWithPhoneNumber → DartConfirmationResult (S:phone.dart) | different | Two steps as in the iOS SDK (verifyPhoneNumber returns the verification id) instead of a ConfirmationResult; the proof is an AppVerification instead of an ApplicationVerifier. verifyPhoneNumberInteractively FUA does both steps with secure_flow for programs without a code field. Unit tests only (see 18). |
| linkWithPhoneNumber | linkWithCredential(PhoneAuthCredential) FUA | User.linkWithPhoneNumber → DartConfirmationResult user.dart | different | A number of another account is credential-already-in-use (the iOS/Android code; JS throws account-exists-with-different-credential, and the backend's PHONE_NUMBER_EXISTS maps to the same code). As in the iOS SDK, its credential is a PhoneAuthCredential of the temporary proof and the number, which signInWithCredential takes to sign in to that account; the shim passes it as a DartPhoneProofCredential. Its toString and the message show neither. The shim's linkWithPhoneNumber reads the account first and throws provider-already-linked before any SMS, as JS does. |
| reauthenticateWithPhoneNumber | reauthenticateWithCredential(PhoneAuthCredential) FUA (operation: REAUTH) | reauthenticateWithCredential with a phone credential (FlutterFire has no such method) | different | A number of no account or another account is user-mismatch. |
| updatePhoneNumber | updatePhoneNumber(PhoneAuthCredential) FUA | User.updatePhoneNumber user.dart | same | accounts:signInWithPhoneNumber with the ID token, as JS sends it. |
| RecaptchaVerifier | AppVerification.recaptchaV2Loopback() (RecaptchaFlow of secure_flow) and AppVerification (app_verification.dart) | on the web DartInPageRecaptchaVerifier (S:phone.dart): the widget in the page, container/size/theme/callbacks mapped; elsewhere DartRecaptchaVerifierFactory renders nothing and the proof is the appVerification of FirebaseAuthDart.use | different | On the web the v2 widget renders into the page (InPageRecaptchaPresenter, dart:js_interop); on desktop and command line the loopback page renders the checkbox on http://localhost:<port> in the system browser and posts the token back; AppVerification.recaptchaV2(source) takes a token from elsewhere (WebView, backend). Site key from getRecaptchaSiteKey() FUA (v1/recaptchaParams, JS getRecaptchaParams). Tested with a simulated browser and, in Chrome, against a fake grecaptcha. On 2026-11-28, against a real Firebase project, Google issued a v2 token on localhost for the project's own key; whether Firebase accepts it was not checked (only an SMS request takes a v2 token). |
| initializeRecaptchaConfig | initializeRecaptchaConfig() FUA, returns the RecaptchaConfig; recaptchaConfig | through the client (S:firebase_auth.dart) | different | Same request (v2/recaptchaConfig, per tenant). It does not ask the token source for a warm-up token (JS executes once to load the script): a source may show something to the person. Tokens come from FirebaseUserAuth(recaptchaEnterprise:). |
| signOut | FUA | firebase_auth.dart | same | |
| deleteUser | deleteCurrentUser() FUA | user.dart | different | Named differently, and it is on the auth instance, not the user. |
| fetchSignInMethodsForEmail | FUA | firebase_auth.dart | same | Deprecated in JS. |
| getAdditionalUserInfo | UserCredential.additionalUserInfo (auth_user.dart) | convert.dart additionalUserInfoOf | different | A field, not a function. isNewUser, providerId, profile, username are all present. |
| updateCurrentUser | FUA (runs beforeAuthStateChanged callbacks; rejects users of another API key) | none (the setter is a no-op, firebase_auth.dart) | different | Shim drops it. FlutterFire has no public equivalent either. |
| onAuthStateChanged | authStateChanges() FUA | firebase_auth.dart | different | Stream instead of observer and unsubscribe. Emits the current user on listen, as JS does. |
| authStateReady | authStateReady() FUA | none (FlutterFire has none) | same | |
| setPersistence | setStorage(AuthStorage): moves the session to the new storage and deletes it from the old one | setPersistence firebase_auth.dart (storageForPersistence storage.dart): NONE to memory, LOCAL and INDEXED_DB to the app's storage; SESSION to WebAuthStorage.session on the web without storageFor, else memory | different | Takes a storage object rather than a Persistence name. |
| inMemoryPersistence | InMemoryAuthStorage auth_storage.dart (default) | via setPersistence | same | |
| browserLocalPersistence / browserSessionPersistence / indexedDBLocalPersistence / browserCookiePersistence | WebAuthStorage (storage/web_auth_storage_web.dart), IndexedDbAuthStorage and BestWebAuthStorage (storage/indexed_db_auth_storage_web.dart), and FileAuthStorage (storage/file_auth_storage_io.dart) | defaultStorage() storage.dart (BestWebAuthStorage on the web) | different | Equivalent in purpose. The web storage is not selectable by name, and there is no cookie variant. |
| revokeAccessToken | revokeAccessToken(token) FUA (tokenType: 'ACCESS_TOKEN', tenantId sent); also revokeToken(authorizationCode) FUA (tokenType: '3', as the iOS SDK, tenantId sent) | revokeAccessToken and revokeTokenWithAuthorizationCode call the client | different | Same v2/accounts:revokeToken endpoint and body as JS. With no signed-in user the client throws null-user; JS returns silently. |
| sendPasswordResetEmail, confirmPasswordReset, verifyPasswordResetCode, checkActionCode, applyActionCode, sendEmailVerification, verifyBeforeUpdateEmail, updateProfile, updateEmail, updatePassword, reload | all present (FUA to 828, 1471) | all wired (firebase_auth.dart to 380, user.dart) | same | Listed for completeness; account management is probably another auditor's area. |
| JS export | Dart client | Shim | Status | Notes |
|---|---|---|---|---|
| AuthCredential (providerId, signInMethod, toJSON, fromJSON) | abstract AuthCredential CRED (providerId, signInMethod) | FlutterFire AuthCredential | different | EmailAuthCredential, OAuthCredential and PhoneAuthCredential have toJson/fromJson (rows below); the abstract class has none. |
| OAuthCredential | OAuthCredential CRED (idToken, accessToken, secret, rawNonce, pendingToken, appleFullPersonName) | DartOAuthCredential wraps it (convert.dart) | different | Has pendingToken and Apple name, which JS lacks. toJson is in the JS shape and leaves the Apple name out. |
| OAuthCredential.fromJSON | OAuthCredential.fromJson CRED | none | different | Returns null for JSON that is not a credential, as JS does. Text that is not JSON throws FormatException. A field that is present and not a string also gives null. |
| EmailAuthCredential | CRED (email, password, emailLink) | converted both ways in convert.dart | same | |
| EmailAuthProvider | abstract final class CRED; credential, credentialWithLink, PROVIDER_ID='password', EMAIL_PASSWORD_SIGN_IN_METHOD, EMAIL_LINK_SIGN_IN_METHOD | FlutterFire's own | same | Named args, not positional. |
| PhoneAuthCredential | PhoneAuthCredential (verificationId and verificationCode, or temporaryProof and phoneNumber; phone_auth.dart) | converted by clientPhoneCredentialOf (convert.dart); a temporary proof as DartPhoneProofCredential | different | toJson/fromJson in the JS format (see the row of PhoneAuthCredential toJSON). |
| PhoneAuthProvider (credential, verifyPhoneNumber, PROVIDER_ID) | PhoneAuthProvider.credential(verificationId:, verificationCode:), PROVIDER_ID; verifyPhoneNumber on FirebaseUserAuth | verifyPhoneNumber: codeSent, verificationFailed, codeAutoRetrievalTimeout after timeout (firebase_auth.dart) | different | Names after the iOS SDK. No instant verification or SMS auto-retrieval outside Android: verificationCompleted is never called; no resend token. |
| GoogleAuthProvider | abstract final class CRED; credential({idToken,accessToken}), PROVIDER_ID, GOOGLE_SIGN_IN_METHOD | FlutterFire's own | different | JS is instantiable (new GoogleAuthProvider(), addScope, setCustomParameters) and has credentialFromResult, credentialFromError, credentialFromJSON. Dart has none of these, because there is no popup flow. |
| GithubAuthProvider | CRED; credential(accessToken) | same | same | Instance methods missing, as above. |
| FacebookAuthProvider | CRED; credential(accessToken) | same | same | |
| TwitterAuthProvider | CRED; credential({required accessToken, required secret}) | same | different | JS takes (token, secret) positionally. |
| OAuthProvider | class OAuthProvider(providerId) CRED; credential({accessToken,secret,idToken,rawNonce,signInMethod}) | FlutterFire's own | different | JS also has addScope, setScopes, getScopes, setCustomParameters, credentialFromResult, credentialFromError. credentialFromJson exists (see below). Dart has secret and signInMethod instead of JS OAuthCredentialOptions {idToken, accessToken, rawNonce}. pendingToken is not accepted by credential. |
| OAuthCredentialOptions (type) | none (named args instead) | none | different | |
| SAMLAuthProvider | none | none | missing | new OAuthProvider('saml.x') does build a credential shape, but SAML is a redirect/popup flow. It has no credential factory in JS either, so it is practically n/a outside a browser. |
| CustomParameters (type) | OAuthLoopbackProvider.customParameters (oauth_loopback.dart) | setCustomParameters and addScope of the FlutterFire provider are added to the registered loopback provider's request (S:oauth_provider.dart oauthRequestOf, S:firebase_auth.dart loopbackProviderFor) | different | The client has them only on the loopback provider. |
| AppleAuthProvider, MicrosoftAuthProvider, YahooAuthProvider | CRED | FlutterFire's own | same | Not exported by JS index.ts (JS uses OAuthProvider('apple.com')). Dart extras, in line with FlutterFire. |
| ProviderId, SignInMethod, OperationType enum maps | ProviderId and SignInMethod classes of constants (D:auth_constants.dart), also the per-provider PROVIDER_ID and *_SIGN_IN_METHOD constants; ActionCodeOperation and OperationType enums | none | same | Dart's ProviderId and SignInMethod also list Apple, Microsoft and Yahoo. |
| ActionCodeURL, parseActionCodeURL | ActionCodeURL.parseLink action_code.dart | none | different | Static factory, returns null on failure. |
| signInWithFacebookDevice (no JS peer) | FirebaseUserAuth.signInWithFacebookDevice(FacebookDeviceFlow) firebase_user_auth.dart; the flow is FacebookDeviceFlow of secure_flow (Facebook Login for Devices) | none | n/a | Dart-only: Facebook sign-in on desktop and command line without a browser on the machine, then signInWithIdp with the access token. Pass the client token, never the app secret: both have the shape <app id>|<value>, so this API cannot tell them apart. A secret in an app binary is exposed to anyone with the binary. Not run against the real Facebook yet. |
| OAuthLoopbackProvider (no JS peer) | OAuthLoopbackProvider.google/.github/.oidc/.discover oauth_loopback.dart; copyWith(scopes:, customParameters:) | exported; passed to FirebaseAuthDart.use(oauthProviders:) for signInWithProvider and the user's link and reauthenticate variants | n/a | A Dart-only native OAuth flow; the closest thing to popup. |
| JS export | Dart client | Shim | Status | Notes |
|---|---|---|---|---|
| User uid, email, emailVerified, displayName, photoURL, phoneNumber, isAnonymous | AuthUser fields | userDetailsOf (convert.dart) | same | auth_user.dart; photoUrl plus a photoURL getter |
| User.tenantId | AuthUser.tenantId | convert.dart | same | auth_user.dart |
| User.metadata | UserMetadata with DateTime | converted to millis (convert.dart) | different | JS creationTime/lastSignInTime are strings; auth_user.dart |
| User.providerData / UserInfo | List<UserInfo> | passed through | same | auth_user.dart |
| User.refreshToken | FirebaseUserAuth.refreshToken (the session's, null when signed out), not on AuthUser | User.refreshToken while that user is signed in, else null (user.dart) | different | JS has it on User, and user.toJSON() includes it; here a printed or serialized AuthUser never carries it. FlutterFire's User.toString() prints it. firebase_user_auth.dart |
User.providerId ('firebase') | AuthUser.providerId auth_user.dart | — | same | A getter that returns 'firebase'. |
| updateProfile({displayName, photoURL}) | updateProfile({displayName, photoUrl}) on the client | user.dart | different | '' removes, null keeps; firebase_user_auth.dart |
| updateEmail | updateEmail on the client | user.dart | same | firebase_user_auth.dart |
| updatePassword | updatePassword on the client | user.dart | same | firebase_user_auth.dart |
| verifyBeforeUpdateEmail | verifyBeforeUpdateEmail(newEmail, actionCodeSettings) | user.dart | same | firebase_user_auth.dart |
| reload | reload | user.dart | same | firebase_user_auth.dart |
| delete | deleteCurrentUser | user.dart | same | firebase_user_auth.dart |
| User.toJSON | AuthUser.toJson() auth_user.dart | — | different | Same keys as JS, but no stsTokenManager, apiKey or appName, so it cannot restore a session. |
| getAdditionalUserInfo(cred) | UserCredential.additionalUserInfo (isNewUser, providerId, profile, username) | passed through (convert.dart) | different | a field, not a function; auth_user.dart |
| UserCredential {user, providerId} | UserCredential extends AuthUser + user, credential | DartUserCredential (user.dart) | different | No providerId, by design: UserCredential extends AuthUser, whose providerId is 'firebase' as on a JS User. The sign-in provider is in credential.providerId and additionalUserInfo.providerId. auth_user.dart |
| UserCredential.operationType | UserCredential.operationType (OperationType: signIn, link, reauthenticate) auth_user.dart | none | same |
| JS export | Dart client | Shim | Status | Notes |
|---|---|---|---|---|
| getIdToken(user, forceRefresh) | getAccessToken({forceRefresh}) FUA returns GetTokenResult; .token is the string | DartUser.getIdToken user.dart | different | Different name (it is the AuthTokenProvider interface). Throws FirebaseNoSignedInUserException rather than null-user. |
| getIdTokenResult(user, forceRefresh) | getAccessToken returns GetTokenResult (firebase_core internal/auth.dart) | idTokenResultOf convert.dart | different | See field rows below. |
| IdTokenResult.token | GetTokenResult.token | token | same | |
| IdTokenResult.claims | claims map | claims | same | |
| IdTokenResult.issuedAtTime | issuedAtTimestamp (DateTime; 1970 if absent) | issuedAtTimestamp ms | different | JS returns a UTC string and throws internal-error when an ID token lacks exp, auth_time or iat, so its times are never null either. Dart returns a DateTime; the epoch only for a token that is not a Firebase ID token (an OAuth access token), which JS never parses. The shim passes null for a missing claim. |
| IdTokenResult.authTime | authTimestamp (1970 if absent) | authTimestamp | different | Same. |
| IdTokenResult.expirationTime | expirationTimestamp | expirationTimestamp | different | Same. |
| IdTokenResult.signInProvider | signInProvider (also falls back to a top-level claim) | signInProvider | same | |
| IdTokenResult.signInSecondFactor | signInSecondFactor (the firebase.sign_in_second_factor claim) | read from the same claim | same | |
(no JS peer) extraClaims | GetTokenResult.extraClaims | none | n/a | Dart extra. |
| onIdTokenChanged | idTokenChanges() FUA (current user on listen, then every new token) and onTokenChanged FUA (raw token stream) | firebase_auth.dart | different | Streams, not observers. Two APIs in the client (see Ideas). |
| onAuthStateChanged | authStateChanges() FUA | firebase_auth.dart | same | |
(FlutterFire userChanges) | userChanges() FUA | firebase_auth.dart (merges two streams, deduplicated per turn) | same | JS has no such stream; Dart extra. |
| beforeAuthStateChanged | beforeAuthStateChanged(cb, {onAbort}) FUA; throws login-blocked, reverse-order onAbort, skipped on backend session end | none (FlutterFire has no such API) | different | In the client, not in the shim. Needs a shim extension type to reach it. |
| Token refresh (proactive) | refreshBefore 5 min, back-off 30 s to 16 min, only while a listener exists (FUA) | uses client | same | JS refreshes while any listener is attached too. |
| Token refresh (reactive, session invalidation) | user-disabled and user-token-expired sign the user out (FUA); also _refreshAfterRejection and a 1 h and 24 h lifetime clamp (_standardTokenLifetime) | uses client | different | The lifetime clamp and the refresh after a rejection have no direct JS counterpart. |
| reload | FUA | user.dart | same | |
requestTimeout (JS networkTimeout, 30 s) | requestTimeout ctor arg, default 30 s, FUA and | not passed | different | Fails with network-request-failed, like JS. The shim constructs without it. |
| Auth.tenantId, languageCode, useDeviceLanguage | tenantId FUA, languageCode, setLanguageCode FUA, useDeviceLanguage FUA | firebase_auth.dart to 165 | same | The shim has no useDeviceLanguage (FlutterFire's setLanguageCode(null) does it). |
| MFA token fields (sign_in_second_factor) | see row above | see row above | different | MFA belongs to another area. |
| JS export | Dart client | Shim | Status | Notes |
|---|---|---|---|---|
| sendPasswordResetEmail | yes | firebase_auth.dart | same | firebase_user_auth.dart |
| confirmPasswordReset | named params | same | firebase_user_auth.dart | |
| verifyPasswordResetCode | yes | same | firebase_user_auth.dart | |
| sendEmailVerification | on the client | user.dart | same | firebase_user_auth.dart |
| applyActionCode | yes | same | firebase_user_auth.dart | |
checkActionCode / ActionCodeInfo data | ActionCodeInfo (email, previousEmail, multiFactorInfo) | convert.dart | same | firebase_user_auth.dart; action_code.dart |
| ActionCodeSettings | flat fields: url, handleCodeInApp, iOSBundleId, androidPackageName, androidInstallApp, androidMinimumVersion, linkDomain | actionCodeSettingsOf | different | no deprecated dynamicLinkDomain; action_code.dart |
| ActionCodeURL / parseActionCodeURL | ActionCodeURL.parseLink | — | same | unwraps Dynamic Links; action_code.dart |
| ActionCodeOperation | enum (+ unknown) | mapped | same | action_code.dart |
| isSignInWithEmailLink | yes | same | firebase_user_auth.dart | |
| sendSignInLinkToEmail | yes | same | firebase_user_auth.dart | |
| signInWithEmailLink | yes | same | firebase_user_auth.dart | |
| fetchSignInMethodsForEmail | yes | same | firebase_user_auth.dart | |
| validatePassword | returns PasswordValidationStatus; cached policy, re-fetched on failure | FirebaseAuthDart.validatePassword(app, password) | same | FirebaseAuth.validatePassword never reaches the platform (it fetches the policy from production itself), so the shim offers a static that goes through the client; firebase_user_auth.dart |
| PasswordPolicy / PasswordValidationStatus | flat fields; meets*Requirement | none | different | JS contains*, customStrengthOptions; password_policy.dart |
| JS export | Dart client | Shim | Status | Notes |
|---|---|---|---|---|
| multiFactor(user).enrolledFactors | AuthUser.enrolledFactors | DartMultiFactor.getEnrolledFactors reads the client's current user (Phone/Totp subtypes) | different | auth_user.dart; shim multi_factor.dart |
| MultiFactorUser.getSession | none | DartMultiFactorSession: keeps the user, id = uid; nothing is sent (the backend session starts in generateSecret) | different | shim multi_factor.dart |
| MultiFactorUser.enroll (TOTP) | startTotpEnrollment → finalizeTotpEnrollment(secret, code, displayName) | finalizeTotpEnrollment; argument-error without a displayName | different | firebase_user_auth.dart; shim multi_factor.dart |
| MultiFactorUser.unenroll | unenrollMultiFactor(uid) (SMS factors too) | factorUid or multiFactorInfo.uid → unenrollMultiFactor | different | uid only in the client; firebase_user_auth.dart; shim multi_factor.dart |
| getMultiFactorResolver | FirebaseAuthMultiFactorException.resolver (also on reauth) | exceptionOf wraps the client's resolver in DartMultiFactorResolver (convert.dart) | different | auth_exception.dart; firebase_user_auth.dart |
| MultiFactorResolver.hints | hints | DartMultiFactorResolver | same | multi_factor.dart |
| MultiFactorResolver.session | MultiFactorResolver.session: a MultiFactorSession of type MultiFactorSessionType.signIn that wraps the pending credential; the same object for the life of the resolver | DartMultiFactorSignInSession with an opaque id (sign-in-<n>); verifyPhoneNumber(multiFactorSession:) with it sends the SMS of the sign-in | different | JS MultiFactorSessionImpl.toJSON writes the pending credential; the Dart session has no JSON form and no member or toString that shows it, and the shim's id is not the credential. The resolver's methods take no session: it is the resolver's own. The client makes no enrolment session (see getSession). multi_factor.dart; shim multi_factor.dart |
| MultiFactorResolver.resolveSignIn(assertion) | resolveSignInWithTotp(code, enrollmentId), startPhoneSignIn(enrollmentId:, appVerification:) + resolveSignInWithPhone(credential) | TOTP or phone assertion, for sign-in and reauthentication; the SMS is sent by verifyPhoneNumber with the resolver's session; other assertions argument-error | different | multi_factor.dart; shim multi_factor.dart |
| PhoneMultiFactorGenerator | startPhoneEnrollment / finalizePhoneEnrollment FUA, startPhoneSignIn / resolveSignInWithPhone on the resolver (v2 mfaEnrollment and mfaSignIn with the phone fields) | getAssertion → DartPhoneAssertion; enroll and resolveSignIn take it | different | No assertion object in the client: the methods take the PhoneAuthCredential. Unit tests only (see 20). |
| TotpMultiFactorGenerator | folded into the enroll/resolve methods | generateSecret → startTotpEnrollment; the assertions carry the secret or enrollment id and the code | different | shim multi_factor.dart |
| TotpSecret | TotpSecret (secretKey, hashingAlgorithm, codeLength, codeIntervalSeconds, enrollmentCompletionDeadline, otpauthUri) | DartTotpSecret: generateQrCodeUrl → otpauthUri (issuer defaults to the app name, as in JS); openInOtpApp throws unimplemented (needs a URL launcher) | different | JS generateQrCodeUrl; multi_factor.dart; shim multi_factor.dart |
| MultiFactorInfo / PhoneMultiFactorInfo / TotpMultiFactorInfo | one MultiFactorInfo; enrollmentTime is a DateTime | shim builds Phone/Totp subtypes (convert.dart) | different | multi_factor.dart |
| FactorId | FactorId.phone, FactorId.totp; MultiFactorInfo.phoneFactorId, totpFactorId, unknownFactorId | — | same | |
| MFA error codes | all 8 JS codes | — | same | auth_exception.dart |
| MultiFactorError | FirebaseAuthMultiFactorException (hints, pendingCredential, resolver) | — | different |
| JS export | Dart client | Shim | Status | Notes |
|---|---|---|---|---|
inMemoryPersistence (J:core/persistence/in_memory.ts:65) | InMemoryAuthStorage, default storage (D:auth_storage.dart) | Persistence.NONE moves the session to an in-memory store through the client's setStorage | same | JS is a NONE class; Dart is a KV map shared by instance, so one instance can be reused to restore a session. |
browserLocalPersistence (J:platform_browser/persistence/local_storage.ts:232) | WebAuthStorage.local (D:storage/web_auth_storage_web.dart) | On the web the second choice of the default BestWebAuthStorage (when IndexedDB is unavailable); Persistence.LOCAL means the app's storage (the secure store or the session file on VM) | different | Dart is plain window.localStorage get/set, and changes(key) follows the storage events of other tabs (see Cross-tab sync). JS also falls back to polling (_POLLING_INTERVAL_MS = 1000, local_storage.ts:30) in browsers that miss those events in background tabs, and works around IE 10; Dart does neither. |
browserSessionPersistence (J:.../session_storage.ts:54) | WebAuthStorage.session (web_auth_storage_web.dart) | Persistence.SESSION is WebAuthStorage.session on the web when the app passed no storageFor (memory with storageFor, and outside a browser); a reloaded tab starts on it when it holds the session (S:storage.dart sessionStorageFor, initialStorage, storageForPersistence) | different | Client is equivalent. Shim: JS restores from every persistence of its list; the shim looks at sessionStorage before the app's storage, and only on the web without storageFor. Outside a browser SESSION behaves like NONE (lost at process end). The web wiring is unit-tested on the VM with fakes; the shim has not run in a browser. |
indexedDBLocalPersistence (J:.../indexed_db.ts:622) | IndexedDbAuthStorage (D:storage/indexed_db_auth_storage_web.dart): own database firebase_auth_providers_dart, store sessions; isAvailable() probe that never throws; a 2.5 s limit per request that aborts the transaction (IndexedDbTimeoutException), as JS's DBPromise; blocked opens and deletions fail at once; reopens once after a closed connection, a deleted database or a transaction aborted by the browser, closes on versionchange; recreates a store-less database only under the default name; writes complete on the transaction's complete (durability: 'strict'); calls in order; typed IndexedDbAuthStorageException without the value. BestWebAuthStorage: IndexedDB, else localStorage, else memory, decided once, and moves a localStorage session of the same key to IndexedDB; writes made without IndexedDB mark the key so that the next IndexedDB load keeps their state | Persistence.INDEXED_DB and LOCAL are the app's storage, by default BestWebAuthStorage on the web (S:storage.dart defaultStorage) | different | Not the JS SDK's blob format or database (firebaseLocalStorageDb), so no session sharing with the JS SDK. JS's fallback ends at sessionStorage, Dart's at memory. Cross-tab sync by polling, as JS's _poll (see Cross-tab sync); no service-worker messaging (initializeReceiver). The browser tests (test/browser/indexed_db_auth_storage_test.dart) pass in headless Chrome on dart2js and dart2wasm. |
browserCookiePersistence (J:.../cookie_storage.ts:166) | none | none | n/a outside a browser | Exported by index.ts; type 'COOKIE'. Needs document.cookie. |
setPersistence(auth, persistence) (J:core/auth/auth_impl.ts:477) | setStorage(AuthStorage) (D:firebase_user_auth.dart) | Implemented on the client's setStorage: memory for NONE, the app's storage for LOCAL and INDEXED_DB, sessionStorage for SESSION on the web without storageFor, else memory (S:firebase_auth.dart setPersistence) | different | Takes a storage, not a Persistence. JS removes the user from the old persistence before writing the new one; the client writes the new storage first, so a failed write changes nothing. It waits for a restore in progress and rewrites a session that changed during the move. |
Persistence type ('SESSION','LOCAL','NONE','COOKIE', J:model/public_types.ts:346) | none (WebAuthStorageKind only says which storage BestWebAuthStorage chose) | FlutterFire Persistence enum (NONE/SESSION/LOCAL/INDEXED_DB) is accepted | missing | No client-level type; only AuthStorage instances. |
initializeAuth({persistence: [..]}) fallback order and migration (J:core/persistence/persistence_user_manager.ts:205-217) | Fixed order only: BestWebAuthStorage (IndexedDB, localStorage, memory) moves a localStorage session to IndexedDB | The web default is BestWebAuthStorage; a failed write falls back to memory for the rest of the process (S:storage.dart _persistentFailed) | different | JS picks the first available persistence of any array and migrates the user from the others. Dart has no configurable list; the one migration is localStorage to IndexedDB (written, read back, then deleted; IndexedDB wins when it already has a session, unless a write made without IndexedDB marked the key). The browser tests (test/browser/indexed_db_auth_storage_test.dart) pass in headless Chrome on dart2js and dart2wasm. |
Cross-tab sync (PersistenceInternal._addListener/_removeListener, J:core/persistence/index.ts:46; _onStorageEvent, J:core/auth/auth_impl.ts:216) | ObservableAuthStorage.changes(key) (D:auth_storage.dart), implemented by WebAuthStorage (storage events), IndexedDbAuthStorage (a readonly read of the listened keys every pollInterval, 800 ms as _POLLING_INTERVAL_MS, paused on pagehide) and BestWebAuthStorage (the storage it chose); FirebaseUserAuth listens from construction to dispose and follows setStorage (F _followStorage, _adoptStoredSession) | FallbackStorage passes the changes through (S:storage.dart), ignored once memory took over | different | Same outcomes as JS: another tab's sign-out signs out, another user switches, same-user tokens and data are taken over; beforeAuthStateChanged callbacks skipped as in JS; polls and listeners only while listened to, stopped at close(). Differences: JS's _updateCurrentUser writes the adopted user back to the persistence, Dart never writes what it read; before storing an update of the same user (rotated refresh token, new data) Dart reads the storage and adopts a sign-out or another user found there instead of writing over it (JS has no such check, so an update in a tab that has not polled yet can undo a sign-out); for the same user Dart keeps its own ID token (the stored value has none) instead of JS's adopted access token. No polling fallback for localStorage, no service-worker messaging. Two tabs where BestWebAuthStorage chose differently follow each other through the localStorage copy: the IndexedDB tab hears the other's writes when they delete a session from IndexedDB (the marker path keeps the copy), the localStorage tab hears the IndexedDB tab's writes once a copy exists (the IndexedDB writes update it); before the first write of the localStorage tab they do not see each other. When the marked state cannot be read from localStorage, the read throws instead of answering null (which would read as a sign-out). Unit tests test/cross_tab_test.dart; browser tests test/browser/cross_tab_sync_test.dart (two clients on one IndexedDB database, localStorage with dispatched storage events, the polls' life, the fallback marker); shim test/web_storage_mapping_test.dart |
Stored key and blob (firebase:authUser:<apiKey>:<appName> of a user JSON) | key firebase_auth_providers_dart:<apiKey>, JSON with version: 2 (D:firebase_user_auth.dart, auth_storage.dart doc) | key firebase_auth_providers_dart:<apiKey>:<appName> (S:firebase_auth.dart storageKeyOf) | different | Not readable by the JS SDK or by FlutterFire web; no cross-SDK session sharing. |
| Public Persistence is an opaque marker, custom persistence is internal | AuthStorage abstract class is public: read/write of a string, any backend (D:auth_storage.dart) | DartAuthConfig.storageFor per app (S:firebase_auth.dart) | different | Dart is more open than JS (JS has PersistenceInternal, only React Native's getReactNativePersistence is public). |
| FileAuthStorage (no JS equivalent) | owner-only file, atomic rename, mode checks (D:storage/file_auth_storage_io.dart) | the fallback outside the web when the secure store cannot be used: FileAuthStorage in defaultSessionFile() (S:storage_path_io.dart) | different | Dart-only; JS has no file storage. |
| Secure storage (Keychain, Keystore, libsecret) | none in the package, which has no Flutter dependency; SecureAuthStorage of the separate Flutter package firebase_auth_secure_storage_flutter is an AuthStorage the app can pass (D:auth_storage.dart doc) | the default outside the web: secureDefaultStorage (S:storage.dart, S:secure_default_storage.dart) keeps the sessions in SecureAuthStorage (Keychain, Keystore-wrapped key, libsecret, DPAPI), moves a session file of an earlier version into it, and falls back to the owner-only session file (memory on Android and iOS) where the secure store cannot be used; BestWebAuthStorage on the web | different | A Dart program without Flutter (a command line tool, a server) keeps the refresh token in the owner-only (0600) FileAuthStorage unless it passes SecureAuthStorage of firebase_auth_secure_storage_dart (next row). The Flutter package has run against the real macOS data-protection keychain, not yet against the iOS Keychain, the Android Keystore, a Secret Service or DPAPI. |
| Secure storage outside Flutter (no JS equivalent) | SecureAuthStorage of the separate package firebase_auth_secure_storage_dart (0.1.0, unreleased): the macOS login keychain (Security.framework), libsecret on Linux, DPAPI-encrypted files on Windows, through dart:ffi; isAvailable() probe; migrateFrom a FileAuthStorage | — (the shim uses firebase_auth_secure_storage_flutter) | different | Dart-only, for command line tools and servers. Same key scheme, migrateFrom rules and isUnavailable shape as the Flutter package; never falls back on its own. Unit-tested with fakes; the integration tests run in CI against the real store on Linux (libsecret, gnome-keyring), Windows (DPAPI) and macOS (login keychain). |
| JS export | Dart client | Shim | Status | Notes |
|---|---|---|---|---|
| connectAuthEmulator(auth, url) | emulatorHost ctor arg, forApp(emulatorHost:) and useEmulator(host, options:) FUA; accepts host:port or http(s)://host:port; rejects userinfo, path, query, bad port and Google hosts (FUA) | useAuthEmulator(host, port) firebase_auth.dart, calling FirebaseUserAuth.useEmulator | different | useEmulator may be called at any time and later requests follow it. JS requires http:// or https:// in the URL; Dart accepts bare host:port. |
connectAuthEmulator options {disableWarnings} | AuthEmulatorOptions(disableWarnings:) on the constructor (emulatorOptions), forApp and useEmulator; warns (log) only for a non-loopback host, FUA | none | different | JS warns for every emulator and adds a banner; Dart does neither for a loopback host. |
emulator-config-failed guard (cannot connect after a request was made) | none, by design: useEmulator may be called at any time | same | different | JS throws emulator-config-failed. Dart lets later requests follow the new config; a request in flight keeps the old origin. |
Auth.emulatorConfig ({protocol,host,port,options}) | emulatorConfig (AuthEmulatorConfig, auth_emulator_config.dart) FUA | none | same | Null for the real service. |
(no JS peer) FIREBASE_AUTH_EMULATOR_HOST | emulatorHostFromEnvironment FUA; emulatorOrigin() FUA | not read | n/a | Dart extra. The shim does not read the variable. |
| JS export | Dart client | Shim | Status | Notes |
|---|---|---|---|---|
| Auth.tenantId | mutable tenantId | firebase_auth.dart | same | sent on requests; firebase_user_auth.dart |
| Auth.languageCode | languageCode / setLanguageCode | same | firebase_user_auth.dart | |
| useDeviceLanguage | yes | setLanguageCode(null) | same | firebase_user_auth.dart |
| Auth.settings.appVerificationDisabledForTesting | AppVerification.none() | setSettings(appVerificationDisabledForTesting: true) sends the phone requests without a proof | different | JS sends a random recaptchaToken instead; a real project takes a request without one for a test number (checked 2026-11-21). |
| initializeAuth | FirebaseUserAuth(...) (storage, requestTimeout, appCheck) | DartFirebaseAuth | different | firebase_user_auth.dart |
| getAuth | FirebaseUserAuth.forApp(app) | delegateFor | different | firebase_user_auth.dart |
| Auth.app | FirebaseUserAuth.app, set by forApp; null for an instance made with the constructor | FirebaseAuth.app of firebase_auth | same | |
| Auth.name | app?.name | FirebaseAuth.app.name | different | No separate getter: the name is the app's. |
| Auth.config | separate members: apiKey, appId, emulatorConfig, clientVersion | — | different | No config object. apiHost, apiScheme and tokenApiHost are the real service unless emulatorConfig is set; authDomain is not used, as there is no hosted sign-in page. |
| Auth.currentUser | currentUser | same | firebase_user_auth.dart | |
| Auth.emulatorConfig | emulatorConfig (AuthEmulatorConfig) | useAuthEmulator | same | firebase_user_auth.dart |
| onAuthStateChanged / onIdTokenChanged | authStateChanges(), idTokenChanges(), userChanges() streams | different | streams, not callbacks; firebase_user_auth.dart | |
| beforeAuthStateChanged | yes, with onAbort | none | same | firebase_user_auth.dart |
| updateCurrentUser | yes | none | same | firebase_user_auth.dart |
| signOut | yes | same | firebase_user_auth.dart | |
| authStateReady | yes | none | same | firebase_user_auth.dart |
| JS export | Dart client | Shim | Status | Notes |
|---|---|---|---|---|
SERVER_ERROR_MAP, 48 server codes to client codes (J:api/errors.ts:134) | _codes, the same 48 keys and values, plus 9 phone codes listed explicitly (D:auth_exception.dart) | uses client mapping via exceptionOf (S:convert.dart) | same (48 of 48) | Includes the single-code oddities: USER_NOT_FOUND to user-token-expired, INVALID_PENDING_TOKEN and INVALID_TEMPORARY_PROOF to invalid-credential, BLOCKING_FUNCTION_ERROR_RESPONSE and 4 MISSING_* to internal-error. Of the 9 phone codes, 7 give what the kebab rule gives; MISSING_CODE is missing-verification-code (the iOS and FlutterFire name) where JS gives missing-code, and PHONE_NUMBER_EXISTS is credential-already-in-use (iOS) where JS gives phone-number-exists. |
Unmapped server code: lowercase, _/space to - (J:api/index.ts:238) | same rule (D:auth_exception.dart) | same | same | e.g. QUOTA_EXCEEDED to quota-exceeded. |
API key not valid text | mapped to invalid-api-key (D:auth_exception.dart) | same | different | JS has no such special case in api/index.ts (INVALID_API_KEY is asserted client-side only, J:core/util/handler.ts:73); JS would yield a kebab-cased message code. Dart is nicer, but is a divergence. |
Tagged errors: FEDERATED_USER_ID_ALREADY_LINKED, EMAIL_EXISTS, USER_DISABLED, needConfirmation (J:api/index.ts:215-233) | same four (D:auth_exception.dart) | email, phone, tenant, credential copied | same | |
AuthErrorCodes, client codes (105 distinct, J:core/errors.ts:503; enum has 108) that Dart emits or maps (76) plus the 3 enum-only codes login-blocked, password-does-not-meet-requirements, unsupported-password-policy-schema-version | emitted at D:firebase_user_auth.dart (login-blocked), :949 (password-does-not-meet-requirements), :917 (unsupported-password-policy-schema-version), rest via _codes and literals | passes through | same (79 of 108) | Verified by searching for each code as a string literal in the client. |
already-initialized | not emitted | n/a | missing | JS throws on a second initializeAuth with other options. |
app-deleted | a call after dispose throws FirebaseUserAuthDisposedError, a StateError | app-deleted (S:convert.dart guard) | different | JS defines the code but its Auth does not throw it: a deleted Auth ignores later state changes and observers. |
dependent-sdk-initialized-before-auth | not emitted | n/a | missing | Init-order guard between Firebase SDKs; low relevance. |
emulator-config-failed | not emitted, by design (useEmulator may be called at any time) | useAuthEmulator has no check | missing | JS throws if the emulator is configured after a request was made. |
invalid-emulator-scheme | not emitted, by design; ArgumentError for a bad emulatorHost, also for a scheme other than http or https (D:firebase_user_auth.dart) | becomes argument-error via guard (S:convert.dart) | missing | Different code for the same condition. |
user-signed-out | not emitted | no-current-user instead (S:convert.dart) | same | JS defines the code but does not throw it. Dart uses null-user and the shim no-current-user for a user operation without a signed-in user. |
missing-continue-uri | not emitted (server value maps to internal-error) | n/a | same | JS does not emit it either: both SDKs check ActionCodeSettings.url client-side and throw invalid-continue-uri for an empty one (ActionCodeSettings.toRequest, JS _setActionCodeSettingsOnRequest), and both map the server's MISSING_CONTINUE_URI to internal-error. |
missing-phone-number | verifyPhoneNumber / startPhoneEnrollment with an empty number (before anything is sent), and MISSING_PHONE_NUMBER | same code | same | |
missing-verification-code | an empty code in a phone credential (before anything is sent), and MISSING_CODE | same code | same | The iOS name; JS leaves MISSING_CODE to the kebab rule (missing-code). |
Browser/env-only client codes (20): popup-blocked, popup-closed-by-user, cancelled-popup-request, redirect-cancelled-by-user, redirect-operation-pending, missing-iframe-start, cordova-not-ready, invalid-cordova-configuration, invalid-auth-event, no-auth-event, unauthorized-domain, auth-domain-config-required, web-storage-unsupported, cors-unsupported, operation-not-supported-in-this-environment, unsupported-persistence-type, invalid-persistence-type, app-not-authorized, app-not-installed, missing-app-credential | none | none | n/a outside a browser | Popup, redirect, iframe, cordova, auth domain, web storage, reCAPTCHA/app verification. The last three are Android/web app-verification for phone auth. |
AuthErrorCodes constants object (J:core/errors.ts:503) | AuthErrorCode: every JS code plus the 5 codes only this client has, as lowerCamelCase constants (D:auth_constants.dart) | none | same | e.code == AuthErrorCode.invalidCredential. |
| Dart-only codes | cancelled, invalid-oauth-response, oauth-state-mismatch (loopback, D:oauth_loopback/oauth_loopback_io.dart), timeout (oauth_loopback_io.dart, JS enum has timeout) | no-current-user, no-options, unimplemented (S:convert.dart) | different | Native FlutterFire has no-current-user; the others are not in the JS enum. |
| Code format and class | code has no auth/ prefix; FirebaseAuthException extends FirebaseException(plugin: 'firebase_auth') (D:auth_exception.dart) | FlutterFire FirebaseAuthException | different | JS: FirebaseError with code: 'auth/...', name: 'FirebaseError'. Dart matches FlutterFire, by design. |
Message text (_debugErrorMap, 108 messages, J:core/errors.ts:141; format Firebase: <msg> (auth/<code>).) | _messages 70 codes, shortened, no prefix/suffix (D:auth_exception.dart) | same text | different | Codes without a message fall back to the server message or the code. |
| customData.appName | none | none | missing | Not needed with one client per app, but absent. |
| customData.email, phoneNumber, tenantId | top-level fields email, phoneNumber, tenantId (D:auth_exception.dart), set only for the 3 tagged codes and needConfirmation | copied to FlutterFire exception (S:convert.dart) | different | JS sets them in more places (e.g. MFA errors and user-bound operations). FlutterFire exposes them top-level, so Dart is consistent with the shim target. |
customData._tokenResponse (raw server body on tagged errors, J:api/index.ts:369) | FirebaseAuthException.serverResponse, on the same four errors; unmodifiable, and its toString prints keys only | not passed on | same | The shim's exception does not carry it; firebase_auth has no field for it. |
customData._serverResponse / MultiFactorError (J:mfa/mfa_error.ts:28-50) | FirebaseAuthMultiFactorException with pendingCredential and hints (D:auth_exception.dart); resolver and TOTP (D:multi_factor.dart) | converted to FirebaseAuthMultiFactorExceptionPlatform whose resolver finishes TOTP through the client's (S:multi_factor.dart) | different | |
credentialFromError (GoogleAuthProvider.credentialFromError etc.) | FirebaseAuthException.credential (D:auth_exception.dart) | credential | different | A property instead of per-provider static helpers; same data. |
Dart-only fields serverCode, httpStatus, invalidatesSession (D:auth_exception.dart) | present | serverCode and httpStatus kept on DartFirebaseAuthException (S:convert.dart) | different | Not on a multi-factor error, which firebase_auth rebuilds as its own class. invalidatesSession is not passed on. |
Counts for the AuthErrorCodes comparison: 105 distinct client codes in JS map (106 entries, INVALID_IDP_RESPONSE and INVALID_LOGIN_CREDENTIALS both invalid-credential), 108 in the enum. Dart covers 79; 9 missing individually (listed above); 20 browser-only.
| JS export | Dart client | Shim | Status | Notes |
|---|---|---|---|---|
debugErrorMap (J:core/errors.ts:421) | private _messages of 70 codes (D:auth_exception.dart) | same | different | Not exposed and not selectable as an AuthErrorMap; the JS Auth.settings/initializeAuth({errorMap}) hook has no Dart counterpart. |
prodErrorMap (J:core/errors.ts:430) | none | none | n/a outside a browser | One-message map, a bundle-size device for web; Dart messages are always present. |
| browserPopupRedirectResolver | none; the desktop substitute is signInWithOAuthLoopback (D:oauth_loopback/oauth_loopback_io.dart) | signInWithPopup/Redirect/getRedirectResult throw unimplemented (S:firebase_auth.dart) | n/a outside a browser | Needs iframe/popup handler. |
| RecaptchaVerifier, ApplicationVerifier, RecaptchaParameters | AppVerification (sealed: RecaptchaV2Verification, RecaptchaEnterpriseVerification, NoAppVerification; D:app_verification.dart) and AppVerification.recaptchaV2Loopback (RecaptchaFlow of secure_flow/secure_flow) | on the web the RecaptchaVerifierFactoryPlatform parameters map onto InPageRecaptchaPresenter and its token is the proof unless use got an appVerification; elsewhere unused, the phone members use the appVerification of FirebaseAuthDart.use (none with the emulator or after setSettings(appVerificationDisabledForTesting: true)) | different | ApplicationVerifier.verify() is a token source of the v2 or Enterprise shape; NoAppVerification sends no proof (iOS test mode, where JS sends a random recaptchaToken). RecaptchaParameters: RecaptchaFlow(size:, theme:) (RecaptchaSize, RecaptchaTheme) and the presenter's onVerified, onExpired, onError. |
initializeRecaptchaConfig (J:core/index.ts:97), handleRecaptchaFlow (J:platform_browser/recaptcha/recaptcha_enterprise_verifier.ts) | initializeRecaptchaConfig() and recaptchaConfig (D:firebase_user_auth.dart), RecaptchaConfig (D:recaptcha_config.dart), the request logic in D:recaptcha_enterprise.dart | through the client (S:firebase_auth.dart); recaptchaEnterprise of use, on the web reCAPTCHA Enterprise in the page by default | different | Same requests and fields as JS (captchaResponse, captchaResp for getOobCode, clientType, recaptchaVersion; NO_RECAPTCHA with the v2 token; AUDIT fallback on missing-recaptcha-token and invalid-app-credential). Differences: no warm-up token; clientType is that of the token source, not always web; a failing source is asked again except after a timeout, cancel or overtaken check; under AUDIT a source that still fails gives the v2 token (SMS) or NO_RECAPTCHA (password), like JS's FAKE_TOKEN after a failed execute, while under ENFORCE its error reaches the caller (JS sends NO_RECAPTCHA and lets the backend refuse); a configuration without recaptchaKey is kept with no site key (JS throws recaptchaKey undefined). Without a source nothing changes. |
parseActionCodeURL / ActionCodeURL (J:core/action_code_url.ts:89,162) | ActionCodeURL.parseLink (D:action_code.dart), handles link, deep_link_id, iOS double deep link, 6 operations | not in the platform interface (client only through userAuthFor) | same | Static factory instead of a top-level function. |
| ActionCodeOperation | enum ActionCodeOperation (D:action_code.dart) | converted (S:convert.dart actionCodeInfoOf) | same | |
OperationType (J:model/enum_maps.ts:76) | enum OperationType (D:auth_user.dart); UserCredential.operationType | none | same | The shim does not copy it; FlutterFire has no operationType. |
ProviderId (J:model/enum_maps.ts:34) | ProviderId (D:auth_constants.dart), plus the per-provider PROVIDER_ID constants | n/a | same | Also Apple, Microsoft and Yahoo. |
SignInMethod (J:model/enum_maps.ts:54) | SignInMethod (D:auth_constants.dart), plus the per-provider *_SIGN_IN_METHOD constants | n/a | same | |
FactorId (J:model/enum_maps.ts:23) | FactorId.phone, FactorId.totp (D:auth_constants.dart); MultiFactorInfo.unknownFactorId for a factor of another kind | multiFactorInfoOf switches on them (S:convert.dart) | same | |
EmailAuthCredential toJSON / fromJSON (J:core/credentials/email.ts:92,109) | toJson and fromJson (D:auth_credential.dart), JS format | none | same | fromJson returns null for JSON that is not an email credential. For an email link, toJson keeps only the code and the tenant. |
OAuthCredential toJSON / fromJSON, OAuthProvider.credentialFromJSON (J:core/credentials/oauth.ts:116,137) | OAuthCredential.toJson/fromJson (D:auth_credential.dart), OAuthProvider.credentialFromJson (:411) | none | different | credentialFromJson keeps secret (JS drops it), so a Twitter credential still signs in. fromJson returns null for a non-credential; credentialFromJson throws ArgumentError, as JS throws. Used to persist a pending credential across an account-exists-with-different-credential flow. |
SAMLAuthCredential and SAMLAuthProvider toJSON / fromJSON (J:core/credentials/saml.ts:70,87) | no SAML class | none | missing | |
PhoneAuthCredential toJSON / fromJSON (J:core/credentials/phone.ts:100,121) | PhoneAuthCredential.toJson/fromJson (D:phone_auth.dart), JS format: providerId, then the values that are set and not empty | none (FlutterFire's PhoneAuthCredential has no JSON form) | same | Both forms read back: a verification id and its code, and a temporary proof and its number (the credential of credential-already-in-use). As in JS, providerId is not looked at, an empty value counts as missing, and fromJson returns null when all four values are missing; text that is not JSON throws FormatException. Also null for JSON that is not a map or a value that is not a string. toString still shows no value. |
getReactNativePersistence (J:platform_react_native/persistence) | analogue: custom AuthStorage | storageFor | n/a outside a browser | React Native only; the Dart analogue exists in spirit (AuthStorage). |
Cordova helpers (J:platform_cordova: cordovaPopupRedirectResolver etc.) | none | none | n/a outside a browser | Cordova WebView plugins. |
revokeAccessToken(auth, token) (J:core/index.ts:264, auth_impl.ts:609: providerId apple.com, tokenType ACCESS_TOKEN, optional tenantId) | revokeAccessToken(token) (D:firebase_user_auth.dart) and revokeToken(authorizationCode) (:754, tokenType '3'); both send tenantId | both call the client (S:firebase_auth.dart) | different | With no user, the client throws null-user; JS returns silently. |
The shim never throws Dart's UnimplementedError: every missing member throws a FirebaseAuthException with code unimplemented (S:convert.dart, text constant noBrowserFlow; noProviderFlowFor and noLoopbackOnWeb in S:oauth_provider.dart).
| JS export | Dart client | Shim | Status | Notes |
|---|---|---|---|---|
| FirebaseAuthPlatform members implemented (32): delegateFor, setInitialValues, dispose, currentUser get/set, sendAuthChangesEvent, tenantId get/set, languageCode, setLanguageCode, useAuthEmulator, setPersistence, setSettings, authStateChanges, idTokenChanges, userChanges, signInAnonymously, createUserWithEmailAndPassword, signInWithEmailAndPassword, signInWithCustomToken, signInWithCredential, signInWithEmailLink, isSignInWithEmailLink, signOut, sendPasswordResetEmail, sendSignInLinkToEmail, applyActionCode, checkActionCode, confirmPasswordReset, verifyPasswordResetCode, fetchSignInMethodsForEmail, signInWithProvider | present | implemented (S:firebase_auth.dart) | same | setSettings is a silent no-op, currentUser setter, sendAuthChangesEvent and setInitialValues are no-ops by design. userChanges merges the token and user streams. |
| UserPlatform members implemented (14): delete, getIdToken, getIdTokenResult, linkWithCredential, reauthenticateWithCredential, reload, sendEmailVerification, unlink, updateEmail, updatePassword, updateProfile, verifyBeforeUpdateEmail, linkWithProvider, reauthenticateWithProvider | present | implemented (S:user.dart) | same | |
signInWithProvider (S:firebase_auth.dart signInWithProvider) | signInWithOAuthLoopback (VM) | the loopback flow of the OAuthLoopbackProvider passed to use for the provider id; the presenter (a SecurePresenter of secure_flow) runs the browser part (the system browser by default) | different | Each provider id needs an OAuthLoopbackProvider at use; another id throws unimplemented (noProviderFlowFor). The FlutterFire provider's scopes and custom parameters are added. On the web, and on Android and iOS without a presenter, it throws unimplemented. |
signInWithPopup, signInWithRedirect, getRedirectResult (:395,399,403) | none | unimplemented, noBrowserFlow | n/a outside a browser | |
signInWithPhoneNumber, verifyPhoneNumber (:409,423) | verifyPhoneNumber, signInWithCredential | implemented (S:firebase_auth.dart, S:phone.dart) | different | no instant verification or auto-retrieval; see the sign-in rows |
initializeRecaptchaConfig (:427) | initializeRecaptchaConfig() | through the client | different | No warm-up token (see above). |
| revokeAccessToken, revokeTokenWithAuthorizationCode | revokeAccessToken and revokeToken (authorization code) in client | calls the client | same | |
User.linkWithProvider, reauthenticateWithProvider (S:user.dart) | linkWithOAuthLoopback, reauthenticateWithOAuthLoopback | as signInWithProvider | different | no-current-user before the browser opens for a user that is no longer signed in. |
User.linkWithPopup, linkWithRedirect, reauthenticateWithPopup, reauthenticateWithRedirect (:127,131,136,140) | none | unimplemented, noBrowserFlow | n/a outside a browser | |
User.linkWithPhoneNumber, updatePhoneNumber (:146,150) | linkWithCredential, updatePhoneNumber | implemented (S:user.dart) | same | |
MultiFactor getSession, enroll, unenroll, getEnrolledFactors (S:multi_factor.dart) | present in the client (D:multi_factor.dart, multi_factor_api.dart) | implemented (TOTP and SMS) | same | |
MultiFactorResolver.resolveSignIn (:129) | resolver in the client | implemented for TOTP and SMS assertions | same | |
| MultiFactorResolver.session | MultiFactorResolver.session | DartMultiFactorSignInSession (opaque id), taken by verifyPhoneNumber(multiFactorSession:) | different | See the Multi-factor table: no JSON form, and the client makes no enrolment session. |
PhoneMultiFactorGenerator.getAssertion (:161) | PhoneAuthCredential | implemented (DartPhoneAssertion) | same | |
TotpMultiFactorGenerator generateSecret, getAssertionForEnrollment, getAssertionForSignIn (:173,186,202) | in the client (D:multi_factor.dart TotpSecret) | implemented | same | |
TotpSecret generateQrCodeUrl, openInOtpApp (:229,241) | TotpSecret.otpauthUri | generateQrCodeUrl implemented; openInOtpApp unimplemented (needs a URL launcher) | different | |
Credentials: Play Games, Game Center (S:convert.dart) | none | unimplemented | missing | Play Games and Game Center need native SDKs. A phone credential of credentialFromToken (Android only) is argument-error. |
Unimplemented in the shim: 9 members (3 on FirebaseAuthPlatform, 4 on UserPlatform, TotpSecret.openInOtpApp, RecaptchaVerifier.verify off the web) plus 2 credential kinds. Breakdown of the 9: 7 browser-only (3 sign-in popup/redirect, 4 user popup/redirect), RecaptchaVerifier.verify off the web (the proof comes from the appVerification of use; on the web it returns the token of the widget), and TotpSecret.openInOtpApp (needs a URL launcher).
Also fixed on this branch: a failed storage write no longer loses the new session (_setSession), and forApp sets the auth provider even when the storage read fails.
Run against a real Firebase project on 2026-11-20: Google sign-in with a Desktop client, TOTP enrolment, sign-in and unenrolment, and a generic OIDC provider with discover and with exchangeCode. GitHub was run with a real OAuth App: account-exists-with-different-credential for an existing email, then link and unlink on that account. On 2026-11-21, with a test phone number of the project and no proof: phone link, sign-in, reauthentication and unlink, and an SMS second factor (enrolment, sign-in through the resolver, unenrolment). On 2026-11-28 (secure_flow 0.3.0, the production verification kit, see tool/verify_production_secure_flow/reports/2026-11-28.md): Google sign-in through OAuthFlow.discovery with the discovery cache on disk, the GitHub loopback sign-in, and a reCAPTCHA v2 token on localhost. Not run on a real project: tenants, a real SMS with a reCAPTCHA proof, revokeToken and revokeAccessToken.
Effort: S takes hours, M a few days, L more than a week or needs outside pieces. Each entry also says whether it needs a browser or a new dependency.
| # | State | Gap | Effort | Browser | New dependency | Value | Why |
|---|---|---|---|---|---|---|---|
| 1 | closed | Bring TOTP, the loopback exchange, the request timeout and the session rules together on one branch | M | no | no | high | MFA, requestTimeout, revokeToken and the loopback link and reauthenticate methods each lived on one branch, and all of them change firebase_user_auth.dart. |
| 2 | closed | Signing out while the storage write fails leaves the old session on disk, and the next restore signs the user back in (_clearSession) | S | no | no | high | This is a bug, not a parity item. It is the counterpart of the _setSession write-failure fix. |
| 3 | closed | Connect the shim's multi-factor classes to the client's TOTP API (9 members) | M | no | no | high | The shim enrols, unenrols, lists and resolves TOTP through the client (S:multi_factor.dart); openInOtpApp throws unimplemented (phone assertions: see 20). |
| 4 | closed | Back the shim's signInWithProvider, linkWithProvider and reauthenticateWithProvider with the loopback OAuth flow | M | system browser | no | high | This is the usual desktop sign-in. The providers are passed to FirebaseAuthDart.use(oauthProviders:), with an optional presenter; tested with a simulated browser, not yet against a real project through the shim. |
| 5 | closed | toJson/fromJson for EmailAuthCredential, OAuthCredential and PhoneAuthCredential, plus OAuthProvider.credentialFromJson | S | no | no | med | Keeps a pending credential across the account-exists-with-different-credential flow. Uses the JS JSON format. |
| 6 | closed | revokeAccessToken(token) (ACCESS_TOKEN, tenantId) in the client, and both revoke methods in the shim | S | no | no | med | The endpoint call already exists. Apple's account-deletion rule makes it matter on iOS and macOS. |
| 7 | partly closed: emulatorConfig and disableWarnings done; no emulator-config-failed or invalid-emulator-scheme code, by design | Emulator parity: an emulator-config-failed guard, an invalid-emulator-scheme code, a parsed emulatorConfig, and disableWarnings | S | no | no | med | Today a late emulator setting silently mixes origins, and a bad host throws ArgumentError. |
| 8 | closed; UserCredential.providerId not added, by design (see the user table) | User.providerId, User.refreshToken and User.toJson; UserCredential.operationType and providerId | S | no | no | med | Plain fields that JS exposes. |
| 9 | closed (as setStorage(AuthStorage)) | setPersistence and a Persistence enum in the client, using the shim's SwitchableStorage | S | no | no | med | The shim already has this logic. Without it, apps that don't use the shim pick storage only at construction. |
| 10 | closed (validatePassword as FirebaseAuthDart.validatePassword) | Shim passthroughs: validatePassword, and keeping serverCode and httpStatus in exceptionOf | S | no | no | med | The client has them; the shim drops them. |
| 11 | closed (serverResponse) | Keep the raw server response on tagged errors (JS _tokenResponse) | S | no | no | low-med | Helps handle linking and debugging. |
| 12 | closed: the Flutter package firebase_auth_secure_storage_flutter, the shim's default storage outside the web; and the pure-Dart package firebase_auth_secure_storage_dart for command line tools and servers (0.1.0; its integration tests run in CI against the real store on Linux, Windows and macOS) | An optional secure-storage adapter (Keychain, Keystore, libsecret), as a separate package | M | no | yes | med | Without Flutter the refresh token still sits in a file with mode 0600. |
| 13 | closed (app-deleted in the shim; missing-continue-uri and user-signed-out are not thrown by JS either) | Client-side validation codes: missing-continue-uri, and app-deleted or user-signed-out after dispose | S | no | no | low | Today these show up as server errors, StateError or null-user. |
| 14 | closed (AuthErrorCode, ProviderId, SignInMethod, FactorId) | An error-code constants class; aggregate ProviderId, SignInMethod and FactorId; OperationType | S | no | no | low | Typo safety only. |
| 15 | closed (signInSecondFactor; times stay non-null, as in JS, see the token rows) | IdTokenResult parity: nullable times and signInSecondFactor | S | no | no | low | GetTokenResult lives in firebase_app_dart and returns epoch 0 for a missing time. |
| 16 | closed (app; name and config as the members of the app and the client) | Auth.name, Auth.app, Auth.config | S | no | no | low | Introspection only. |
| 17 | closed | IndexedDB storage on the web | M | yes | no | low-med | IndexedDbAuthStorage and BestWebAuthStorage, the shim's web default. The stored data can't be shared with the JS SDK because the format differs. Cross-tab sync added afterwards (see the Persistence table). |
| 18 | closed (code and unit tests; run against a real project on 2026-11-21 with a test phone number and no proof; not run with a real SMS or against the emulator) | Phone sign-in: verifyPhoneNumber with an AppVerification, PhoneAuthProvider.credential, sign-in, link, reauthentication, updatePhoneNumber, verifyPhoneNumberInteractively; shim verifyPhoneNumber, signInWithPhoneNumber, linkWithPhoneNumber, updatePhoneNumber | L | for production | no | med | Ran: unit tests against a fake REST backend for every path and every mapped error, including that no error holds the number, the verification id, the code or the token. Written, not run: test/phone_auth_emulator_test.dart and the shim's emulator_test.dart, and the phone step of the real-project harness (a console test number). Real numbers need a reCAPTCHA token (the loopback page or the app's own); Play Integrity and APNs are out of scope. |
| 19 | closed (code and tests; not run against a real project) | reCAPTCHA Enterprise (initializeRecaptchaConfig, token on sign-in) | L | yes, or a WebView | no | high where enforcement is on | initializeRecaptchaConfig() reads v2/recaptchaConfig; with a token source (recaptchaEnterprise) the password sign-in and sign-up, password credentials, password reset and email link emails and the SMS requests carry an Enterprise token as in JS's handleRecaptchaFlow (ENFORCE, AUDIT with the v2 fallback, retry after missing-recaptcha-token). The token comes from RecaptchaFlow.enterprise of secure_flow (in the page on the web; a page on localhost elsewhere) or the app's own source; the client gained no dependency. Tests: unit tests against a fake REST backend (configuration, every enforcement state, attach, retry, fallback, codes, no token in errors or logs); browser tests of the in-page Enterprise execute against a fake grecaptcha. Not run: a real project (it needs reCAPTCHA Enterprise on for Identity Platform and a key whose allowed domains include the page that makes the token, localhost for the desktop page). |
| 20 | closed (code and unit tests; run against a real project on 2026-11-21 with a test phone number and no proof; not run with a real SMS or against the emulator) | Phone second factor: startPhoneEnrollment / finalizePhoneEnrollment, MultiFactorResolver.startPhoneSignIn / resolveSignInWithPhone; shim PhoneMultiFactorGenerator, verifyPhoneNumber with a multi-factor session | L | yes | yes | med | Ran: unit tests against a fake Identity Platform for enrolment, sign-in and reauthentication through the resolver, unenrolment and every mapped error. Written, not run: the SMS test of test/phone_auth_emulator_test.dart and of the shim's emulator_test.dart, and the sms step of the real-project harness. |
| 21a | closed (code and tests; not run in a Flutter web app or against Google) | reCAPTCHA on the web: in-page presenter | M | yes | no | med | InPageRecaptchaPresenter of secure_flow renders the v2 widget (visible or invisible) into the page, or runs the Enterprise execute, with dart:js_interop alone (secure_flow stays without dependencies); SecureEnvironment.current() offers it on the web and RecaptchaFlow ranks it first. The shim's RecaptchaVerifier maps container, size, theme and the callbacks onto it. Tests: in Chrome (dart2js and dart2wasm) against a fake grecaptcha, the shim's mapping on the VM. Not run: Google's scripts, a Flutter web app. |
| 21b | not planned, by design | Popup and redirect sign-in | L | yes | yes | low | They need window.open, page navigation and the auth domain's handler. The loopback flow covers native apps; on the web, get the provider's token and use signInWithCredential. |
Not counted as gaps, by design:
FirebaseAuthException codes have no auth/ prefix and the class is FlutterFire's.UserCredential has no providerId of its own: it extends AuthUser, whose providerId is 'firebase'.This page compares cloud_firestore_dart (with firebase_app_dart) with the Firestore part of the Firebase JS SDK, area by area, and then lists every gap and behaviour difference we know of.
Read from docs/parity.md on origin/main at 9122437c.
Compared against: @firebase/firestore 4.20.0 (Firebase JS SDK 13.3.0), source at firebase-js-sdk commit c03d2aa of 2026-11-12, recorded in [docs/upstream_sync/js_reference.md](upstream_sync/js_reference.md) with how to compare next time. The rest of docs/upstream_sync/ tracks the sync with the Android SDK, which this port follows more closely. Where the Android and JS SDKs differ, the port usually follows Android and says so.
How the status was decided: from the code and the tests of this repository, not from the documentation alone. A row marked supported cites a test file where the support is not obvious from the API. Test paths are relative to cloud_firestore/cloud_firestore_dart/. The exact public signatures are in test/unit/api/public_api.golden.txt.
The area tables below at a glance, one mark per row; most gaps are in multi-client and the platforms:
Same: Dart has it as the official SDKs do. Different: Dart has it, in another shape or with other behaviour. Missing: a gap Dart could close. Won't do: will not be done, is not needed, makes no sense in Dart or does not apply to it; none of it is a gap. The doc's own words are kept in the Status column and mapped to the tags: supported (also “extra”, “preview”, “Enterprise edition”, “in Chrome”) is Same, partial is Different, not supported is Missing, not applicable is Won't do.
These are the numbers behind the statements below. Each one says where it comes from.
| Suite | Result | Source |
|---|---|---|
Unit tests of cloud_firestore_dart (dart test test/unit, no backend) | 5,882 passed, 498 skipped, 0 failed | run for this page on 2026-11-14 |
Integration, test/integration over gRPC (tool/test_integration.sh standard --transport=grpc test/integration, emulator v1.22.0) | 887 passed, 21 skipped, 0 failed | run for this page on 2026-11-14 |
The same tests over the web transport (--transport=webchannel: REST and WebChannel, on the VM) | 882 passed, 26 skipped, 0 failed | run for this page on 2026-11-14 |
The same tests with WebChannel in long-polling mode (--transport=webchannel-longpolling) | 882 passed, 26 skipped, 0 failed | run for this page on 2026-11-14 |
Browser tests in Chrome (tool/test_browser.sh both) | 57 tests per compiler, 56 pass and 1 is skipped, on dart2js and dart2wasm | Platforms; run on 2026-11-17 on the branch wave/web-support |
Production verification kit (tool/verify_production) against a real Standard edition database | 13 of 15 checks passed, 2 skipped | Features and limits, The emulator and testing |
Enterprise edition suite (test/integration_enterprise) against a real Enterprise edition database | 444 passed, 89 skipped, 0 failed | run on 2026-11-21; the skips are tests written for the emulator's answers |
| The same suite against the Enterprise emulator | 446 passed, 86 skipped, 1 failed (examples_enterprise_smoke_test.dart stopped at a build message on stderr; not investigated yet) | run on 2026-11-21 |
Each integration run used a fresh emulator. The same 908 tests run on every transport. The web transport skips five more than gRPC: two because the emulator's JSON endpoints store -0.0 as 0.0, two backoff measurements that only apply to gRPC, and one that needs two increments in flight at once. Among the skips on every transport: 8 large-document tests (production only), 7 tests against the real JS SDK (they need Node.js, which the machine that ran them does not have) and the opt-in scale soak. The standard suite against the Enterprise emulator was not run for this page.
Most of the testing is against the Firestore emulator. The standard integration suite has an opt-in mode for a real project that has not been run yet; see Known limitations.
| JS feature | Status | Dart API or gap |
|---|---|---|
doc, collection, collectionGroup, references and paths | supported | firestore.doc, collection, collectionGroup; DocumentReference.id/path/parent |
getDoc, getDocFromCache, getDocFromServer | supported | ref.get(), ref.get(const GetOptions(source: Source.cache)), ... Source.server; test/integration/firebase/firestore/source_test.dart |
setDoc, setDoc(..., {merge}), {mergeFields} | supported | set(data, const SetOptions(merge: true)), SetOptions(mergeFields: [...]) |
updateDoc (map and varargs forms) | supported | update(map), with String or FieldPath keys |
deleteDoc, addDoc | supported | delete(), CollectionReference.add |
serverTimestamp, increment, arrayUnion, arrayRemove, deleteField | supported | FieldValue.serverTimestamp(), .increment, .arrayUnion, .arrayRemove, .delete(); numeric_transformas_test.dart, array_transforms_test.dart, server_timestamp_test.dart (all under test/integration/firebase/firestore/) |
minimum / maximum field transforms | supported | FieldValue.minimum / .maximum; test/integration/firebase/firestore/min_max_transforms_test.dart |
Value types: Timestamp, GeoPoint, Bytes, DocumentReference, maps, arrays | supported | Timestamp, GeoPoint, Blob, DocumentReference; test/integration/firebase/firestore/type_test.dart, value_fidelity_test.dart |
vector() / VectorValue | supported | VectorValue; test/integration/firebase/firestore/vector_test.dart |
BSON types (MinKey, MaxKey, Int32Value, Decimal128Value, BsonObjectId, BsonTimestamp, RegexValue, BSON binary) | supported (Enterprise edition) | Same class names, Blob.bsonBinary; test/integration_enterprise/bson_types_test.dart. Differences in Known limitations |
withConverter, FirestoreDataConverter, withConverter(null) | supported | withConverter<T>(...), withoutConverter(); test/integration/firebase/firestore/converter_test.dart |
SnapshotOptions.serverTimestamps ('estimate', 'previous') | supported | snapshot.data(serverTimestamps: ServerTimestampBehavior.estimate) or per field; server_timestamp_test.dart |
refEqual, queryEqual, snapshotEqual | supported | == on references, queries and snapshots |
toJSON / fromJSON on Timestamp, GeoPoint, Bytes, VectorValue, DocumentReference | supported | toJson() / .fromJson(...) in the JSON format of the JS SDK; test/unit/firebase/firestore/snapshot_json_test.dart. A cross-SDK test against the real JS SDK exists (test/integration/firebase/firestore/js_interop_test.dart) but is skipped unless Node.js and its harness are installed |
Named databases (getFirestore(app, 'db')) | supported | FirebaseFirestore.instanceFor(app: app, databaseId: 'db'); test/integration/firebase/firestore/firestore_test.dart |
| Documents up to 16 MB | supported (Enterprise edition) | test/integration/firebase/firestore/large_document_test.dart passes against a real Enterprise edition database (8 tests with documents of 15.9 MB, 2026-11-21). A Standard edition database rejects a field value over 1 MiB with invalid-argument, as the emulator does |
UpdateData<T> / WithFieldValue<T> typing | not applicable | TypeScript typing; update takes Map<String, Object?> |
ignoreUndefinedProperties | not applicable | Dart has no undefined |
Temporal.Instant conversion | not applicable | JS type |
| JS feature | Status | Dart API or gap |
|---|---|---|
where with ==, <, <=, >, >=, array-contains, in, array-contains-any | supported | where('f', isEqualTo: ...) named arguments or Filter(...) objects |
!= and not-in | supported | isNotEqualTo, whereNotIn; test/integration/firebase/firestore/query_test.dart (testSDKUsesNotEqualFiltersSameAsServer, testSDKUsesNotInFiltersSameAsServer) |
or() / and() composite filters | supported | Filter.or([...]), Filter.and([...]); test/integration/firebase/firestore/or_query_test.dart |
| Range and inequality filters on several fields | supported | test/integration/firebase/firestore/composite_index_query_test.dart |
orderBy, limit, limitToLast | supported | orderBy, limit, limitToLast; test/integration/firebase/firestore/limit_to_last_test.dart |
Cursors startAt, startAfter, endAt, endBefore (values or snapshot) | supported | startAt([...]), startAtDocument(snapshot), ...; test/integration/firebase/firestore/cursor_test.dart |
documentId() | supported | FieldPath.documentId; test/integration/firebase/firestore/query_where_test.dart |
getDocs, getDocsFromCache, getDocsFromServer | supported | query.get(), get(const GetOptions(source: Source.cache)), ... Source.server |
Vector search findNearest on a classic query | supported (extra) | Query.findNearest(...), server only. Not in any official client SDK on a classic query: JS, Android and iOS have it only as a pipeline stage, C++ not at all. test/integration/firebase/firestore/vector_test.dart |
| JS feature | Status | Dart API or gap |
|---|---|---|
getCountFromServer | supported | query.count().get() |
getAggregateFromServer with count(), sum(), average() | supported | query.aggregate([AggregateField.count(), .sum('f'), .average('f')]), or aggregateWithAliases({...}) for named results; test/integration/firebase/firestore/aggregation_test.dart |
Aggregations in Lite (getCount, getAggregate) | supported | Same API in lite.dart; test/integration/firebase/firestore/lite_test.dart |
| JS feature | Status | Dart API or gap |
|---|---|---|
onSnapshot on documents and queries | supported | ref.snapshots(), query.snapshots() (a Stream); cancel the subscription to stop |
includeMetadataChanges | supported | snapshots(includeMetadataChanges: true) |
source: 'cache' (listen to the cache only) | supported | snapshots(source: ListenSource.cache); test/integration/firebase/firestore/listen_source_test.dart, snapshot_listener_source_test.dart |
docChanges() and change types | supported | snapshot.docChanges, DocumentChangeType |
SnapshotMetadata (hasPendingWrites, fromCache) | supported | snapshot.metadata.hasPendingWrites, .isFromCache |
onSnapshotsInSync | supported | firestore.snapshotsInSync() stream; test/integration/firebase/firestore/firestore_test.dart |
QuerySnapshot.toJSON, DocumentSnapshot.toJSON, querySnapshotFromJSON, documentSnapshotFromJSON | supported | toJson(), QuerySnapshot.fromJson, DocumentSnapshot.fromJson; test/integration/firebase/firestore/snapshot_json_test.dart |
onSnapshotResume (listen from a serialized snapshot) | supported | firestore.querySnapshotsFromJson(json), documentSnapshotsFromJson(json); snapshot_json_test.dart |
Error callback of onSnapshot | supported | The stream's onError |
| JS feature | Status | Dart API or gap |
|---|---|---|
runTransaction with retries and backoff, maxAttempts | supported | firestore.runTransaction(fn, maxAttempts: 5); test/integration/firebase/firestore/transaction_test.dart |
writeBatch | supported | firestore.batch(), runBatch(fn); test/integration/firebase/firestore/write_batch_test.dart |
| Read-only transactions | supported (extra) | readOnly: true, readTime: ... with getQuery and getAggregate. Not in the JS client SDK (the server SDKs have it); test/integration/firebase/firestore/read_only_transaction_test.dart |
waitForPendingWrites | supported | firestore.waitForPendingWrites() |
| Number of pending writes | supported (extra) | firestore.getPendingWriteCount() and the throttled stream pendingWriteCounts(). Not in the official SDKs; see Offline persistence. test/unit/firebase/firestore/pending_write_count_test.dart (memory and SQLite cache, per user, the throttle, a second client on the same SQLite cache) |
terminate | supported | firestore.terminate(); test/integration/firebase/firestore/terminate_in_flight_test.dart, terminated_instance_test.dart |
| JS feature | Status | Dart API or gap |
|---|---|---|
| Memory cache, eager and LRU garbage collection | supported | MemoryCacheSettings(), MemoryCacheSettings(gcSettings: MemoryLruGcSettings(sizeBytes: ...)) |
Persistent cache (persistentLocalCache) with cacheSizeBytes, CACHE_SIZE_UNLIMITED | supported | PersistentCacheSettings(sizeBytes: ...), Settings.cacheSizeUnlimited; you pass an OpenDatabase (SQLite on the VM, SQLite in WebAssembly on the web). See Offline persistence |
| IndexedDB as the storage | not applicable | SQLite file on the VM; on the web SQLite (WebAssembly) stored in IndexedDB or OPFS. test/browser/web_persistence_test.dart, web_persistence_opfs_test.dart |
enableIndexedDbPersistence, enableMultiTabIndexedDbPersistence (deprecated in JS) | not applicable | Use cacheSettings |
clearIndexedDbPersistence | supported | firestore.clearPersistence() after terminate(); test/integration/firebase/firestore/clear_persistence_test.dart |
enableNetwork / disableNetwork | supported | Same names |
| Offline writes, pending writes survive a restart | supported | test/unit/firebase/firestore/local/ (SQLite persistence tests), browser reload tests test/browser/web_persistence_reload_* |
| Recovery from a busy or failing database | supported (extra) | TransientDatabaseException; see Offline persistence |
| A cache in storage the app provides | supported (extra) | keyValueCacheSettings(store: ...) of package:cloud_firestore_dart/cache_store.dart over any CacheStore (an ordered key-value store of bytes); one client per store. Not in the JS SDK. See A cache in your own storage; test/unit/firebase/firestore/local/keyvalue_*_test.dart, test/unit/firebase/firestore/spec/keyvalue_spec_test.dart |
| Merging repeated offline writes of a document into one pending write | supported (extra, opt-in, differs from JS) | mergeUnsentWrites: true on the cache settings, off by default. Not in the JS SDK: the backend ends with the same documents, but rules and functions see one write instead of several, writes to other documents in between reach the backend first, and a rejection rejects every merged write. See Merging repeated offline writes, which ties each merge rule to a test; test/integration/firebase/firestore/merge_unsent_writes_sequences_test.dart, merge_unsent_writes_rules_test.dart |
| JS feature | Status | Dart API or gap |
|---|---|---|
getPersistentCacheIndexManager | supported | firestore.persistentCacheIndexManager (null with a memory cache, as in JS) |
enablePersistentCacheIndexAutoCreation, disable..., deleteAllPersistentCacheIndexes | supported | enableIndexAutoCreation(), disableIndexAutoCreation(), deleteAllIndexes(); test/integration/firebase/firestore/index_engine_test.dart, test/unit/firebase/firestore/persistent_cache_index_manager_test.dart |
setIndexConfiguration (deprecated in JS) | supported | firestore.setIndexConfigurationFromJSON(json) (deprecated here too); test/integration/firebase/firestore/indexing_test.dart |
| Indexes for queries with inequalities on several fields | not supported | Scanned instead, as in the JS SDK |
| Queries served by a persistent cache index | supported, with fixes over JS | Three gaps that the JS and Android SDKs have are fixed here: after one of the client's own writes the index no longer misses documents that watch sends later at an older or equal version; a document that watch sends in a later snapshot at the same version is indexed too; and a limit query refills its window when the document at its edge arrived late from a lagging target. A query served by an index also no longer returns documents that do not match it. Compared with a scan of the cache by test/unit/firebase/firestore/core/view_listeners_property_test.dart ("with and without field indexes") |
| JS feature | Status | Dart API or gap |
|---|---|---|
loadBundle (bytes, string, stream) with progress | supported | loadBundle(bytes), loadBundleStream(stream) (encode a string with utf8.encode), LoadBundleTask.stream / future; test/integration/firebase/firestore/bundle_test.dart |
namedQuery | supported | firestore.namedQuery(name), namedQueryGet(name); bundle_test.dart |
| JS feature | Status | Dart API or gap |
|---|---|---|
firebase/firestore/lite entry point | supported | package:cloud_firestore_dart/lite.dart; test/integration/firebase/firestore/lite_test.dart, browser test/browser/web_lite_test.dart. Emulator and Chrome only. The differences from the JS exports are listed in Firestore Lite |
firebase/firestore/lite/pipelines entry point | not supported | Pipelines are in the main library only (preview), not in lite.dart |
| Reads, writes, batches, transactions, queries, aggregations, converters | supported | Same as the main library, every call one request |
where with named arguments / Filter | supported | The same where and Filter as the main library |
| Small web build | supported | tool/check_size.sh checks that the Lite program contains no sync engine, cache or WebChannel |
Preview, Enterprise edition only, as in the JS SDK. See Pipelines.
| JS feature | Status | Dart API or gap |
|---|---|---|
pipeline().collection/collectionGroup/database/documents and execute | supported (preview) | firestore.pipeline() (extension FirestorePipelines in package:cloud_firestore_dart/pipelines.dart), execute(); test/integration_enterprise/pipeline_test.dart |
Stages where, sort, limit, offset, select, addFields, removeFields, aggregate, distinct, unnest, union, sample, findNearest, replaceWith | supported (preview) | test/integration_enterprise/pipeline_test.dart, android_pipeline_test.dart, pipeline_surface_test.dart |
Expressions (string, array, map, math, timestamp, logical, isType, ifNull, coalesce, regex, parent, ...) | supported (preview) | pipeline_surface_test.dart and the tests above |
| Subqueries, variables | supported (preview) | See Pipelines |
DML stages (delete, update, insert, upsert), literals, atomic execute | supported (preview) | test/integration_enterprise/android_pipeline_dml_integration_test.dart. The emulator denies literals to clients under security rules |
createFrom(query) | supported | createFrom, createFromAggregateQuery, createFromVectorQuery; test/integration_enterprise/pipeline_create_from_test.dart, also against a real Enterprise edition database (2026-11-21). By design it keeps the results of the classic query for != / not-in, which JS 4.20.0 no longer does; see Known limitations |
| Full-text search, geo search, window functions | supported (preview) | Run against a real Enterprise edition database (2026-11-21): test/integration_enterprise/android_pipeline_search_test.dart (12 tests; the collection needs a search index with its text fields and its geo field) and android_pipeline_window_test.dart. The emulator rejects these stages, so there the tests only check the encoding |
| Explain options | supported | PipelineExplainOptions; a real Enterprise edition database answers with the explain statistics (test/integration_enterprise/pipeline_surface_test.dart, pipeline_phase2_test.dart, 2026-11-21). The emulator ignores them |
| Pipelines in a transaction | supported (extra) | transaction.execute(pipeline) in read-only transactions (a read-write transaction rejects it). Not in the JS client SDK; test/integration_enterprise/pipeline_surface_test.dart |
| Real-time pipelines | not supported | Also not public in JS 4.20.0 (RealtimePipeline is marked @internal there); test/integration_enterprise/android_realtime_pipeline_test.dart lists the Android tests as skipped |
| JS feature | Status | Dart API or gap |
|---|---|---|
persistentSingleTabManager | supported | The default: one client per cache. On the web a Web Lock (SQLite caches) or the primary lease (IndexedDB cache) keeps a second tab out (failedPrecondition) |
persistentMultipleTabManager: several clients on one cache, one primary, lease of 5 s | partial | On the web, indexedDbCacheSettings(multiTab: true) (preview, new in 0.3.2): see the two rows below. Clients on one SQLite file (isolates, processes, a Flutter hot restart) elect a primary with the JS lease; the cache stays consistent. test/unit/firebase/firestore/local/sqlite_shared_clients_test.dart, sqlite_shared_processes_test.dart, sqlite_primary_lease_test.dart, test/unit/firebase/firestore/primary_client_test.dart, test/integration/firebase/firestore/shared_cache_isolates_test.dart. See Several clients on one cache |
| Secondary tabs share the primary's listeners and writes | partial | Only with the IndexedDB cache and multiTab: true in Chrome (preview, new in 0.3.2): a secondary gets its listeners' results and the acknowledgement of its writes through the primary (test/browser/web_indexeddb_multi_tab_client_test.dart, test/integration/firebase/firestore/shared_client_state_test.dart). Not with clients on one SQLite file: a secondary there works from the cache, reports itself offline and keeps its writes pending until it becomes primary. Deferred until after 0.1.0 |
| Several tabs on one cache in a browser | partial | indexedDbCacheSettings(multiTab: true) (preview, new in 0.3.2), same lease, rows and localStorage keys as the JS SDK; tested in Chrome, and its browser tests also pass in Firefox. Two differences: a secondary takes the lease at once when it hears a closing tab remove its state (JS waits for the next refresh), and a page restored from the back/forward cache comes back with a terminated client. Not tested: a JS SDK tab beside a tab of this SDK, handover on real visibility changes, different users in the tabs. The SQLite caches (IndexedDB, OPFS) stay at one tab, guarded by a Web Lock. See The IndexedDB cache |
| JS feature | Status | Dart API or gap |
|---|---|---|
| App Check token on every request | supported | An AppCheckTokenProvider on the FirebaseApp adds x-firebase-appcheck over gRPC, WebChannel, REST and Lite; test/integration_auth/credentials_on_the_wire_test.dart, test/unit/firebase/firestore/auth/app_check_token_provider_test.dart. Enforcement was never tested: the emulator does not enforce App Check |
Device attestation (initializeAppCheck with reCAPTCHA and similar providers) | not supported | You supply the provider, for example one that gets tokens from your backend |
| JS feature | Status | Dart API or gap |
|---|---|---|
connectFirestoreEmulator(db, host, port) | supported | Settings().withEmulator(host, port) |
mockUserToken | supported | withEmulator(host, port, mockUserToken: ...); test/integration/firebase/firestore/emulator_mock_user_token_test.dart |
| Emulator UI banner | not applicable | Browser UI of the JS SDK |
| JS feature | Status | Dart API or gap |
|---|---|---|
| WebChannel streams for listen and write | supported in Chrome | Used automatically on the web; the integration suite runs over it on the VM (see the numbers above) and test/browser/web_transport_smoke_test.dart in Chrome |
| REST for one-shot calls (fetch) | supported | test/unit/firebase/firestore/remote/web/rest_transport_test.dart |
experimentalForceLongPolling, experimentalAutoDetectLongPolling | supported | webExperimentalForceLongPolling, webExperimentalAutoDetectLongPolling on Settings; long polling has its own integration run (above) and test/browser/web_robustness_test.dart |
experimentalLongPollingOptions.timeoutSeconds | supported | Settings(webExperimentalLongPollingOptions: WebExperimentalLongPollingOptions(timeoutDuration: Duration(seconds: 25))), validated as in JS (5 to 30 seconds), sent as the TO parameter of long-polling requests; test/unit/firebase/firestore/firestore_settings_test.dart, long_polling_options_test.dart, test/unit/firebase/firestore/remote/web/web_channel_test.dart |
useFetchStreams | not applicable | The web transport always uses fetch |
HTTP/2 flow control window (grpcFlowControlWindow, Node) | supported | Settings.grpcFlowControlWindow on the gRPC transport; test/integration/firebase/firestore/transport_limits_test.dart |
| WebChannel drops duplicate server messages, closes on terminate | supported | test/unit/firebase/firestore/remote/web/web_channel_test.dart, web_channel_transport_test.dart |
| Online state as soon as the stream connects (JS 4.6.1) | supported | The client is online once the WebChannel handshake succeeds (gRPC: at the first message, as JS on Node), not only at the first watch change; test/unit/firebase/firestore/remote/stream_unit_test.dart, remote_store_test.dart, web/web_channel_transport_test.dart, test/integration/firebase/firestore/remote/stream_test.dart |
| JS feature | Status | Dart API or gap |
|---|---|---|
| Browsers | partial (supported in Chrome) | Chrome (dart2js and dart2wasm) is the supported browser. Firefox passed the browser test suite (dart2js and dart2wasm, 2026-11-21, not in CI); a Safari run (dart2js) had timeouts that are not explained yet; Edge is untested. See Platforms |
| Node.js | not applicable | The Dart VM takes its place: servers, command line tools, Flutter apps (Android, iOS, desktop) over gRPC |
| Linux, macOS on the VM | supported | Developed on macOS; unit and integration suites run in a Linux container and on Ubuntu in CI (tool/linux/run_in_container.sh) |
| Windows | partial | Run on one Windows 11 x64 VM against the emulator, not in CI. Nothing in lib/ needed a change; the test suites do not pass cleanly there (timeouts on the VM's slow disk, and test helpers that start dart run or delete a file that is still open). See Platforms |
| React Native, service workers | not applicable | |
| Authentication | partial | No Firebase Auth SDK; firebase_auth_providers_dart gets tokens over REST (user sign-in, service accounts, Application Default Credentials). Tested against the Auth emulator and against a real project: a request with the ID token of an anonymous user is served under the security rules (check 13 of the production verification kit, 2026-11-21). See Authentication |
Every gap and behaviour difference we know of, the ones you are most likely to meet first.
test/integration_enterprise (Enterprise edition); the standard integration suite's real-project mode and long-running load have not.multiTab: true, a preview); compiled to JavaScript (dart2js), integers above 2^53 lose precision, so prefer dart2wasm; against the emulator a query that returns more than about 10,000 documents fails on the web transport (production not checked). See Platforms.firebase_auth_providers_dart, which was tested against the Auth emulator and, for an anonymous user, against a real project. App Check enforcement was never tested.in, not-in, array-contains, array-contains-any, arrayUnion and arrayRemove follows the backend, not the JS SDK.** The integer 1 and the double 1.0 are the same value here (and 0.0 is -0.0), as the backend treats them. The JS SDK compares them strictly, and a cached document that only it matches can stay in limbo.null and NaN match what the backend returns.** a < 1 does not match a NaN, a > null matches nothing, <= / >= hold for null with null and NaN with NaN. The JS SDK evaluates these with the order of values and can show documents the backend does not return.null / NaN documents on a Standard edition database.** In in, array-contains(-any) filters the client first treats null and NaN like an Enterprise database does (as the JS SDK), and removes such a document once the backend has not returned it: a listener sees it with isFromCache: true, then its removal. The JS SDK keeps it in limbo and getDocsFromServer does not complete. See Enterprise edition differences.unavailable offline); no real-time pipelines (not public in JS either). The emulator rejects full-text search, geo search and window functions and ignores explain options; these were run against a real Enterprise edition database instead. That run showed that the backend rejects execute(indexMode: ...) ("Unsupported option: index_mode"), accepts geoDistance only inside search, and answers some wrong-type and error cases differently from the emulator; the local evaluator of the test suite (which the client does not use) follows the emulator, so its comparison tests are skipped there.createFrom(query) keeps classic-query results.** For != and not-in the Dart conversion excludes documents where the field is null or missing, like the query does. JS 4.20.0 (#9444) drops that check, so its pipeline returns documents without the field. A cursor on a field with values of several types only returns documents whose value has the type of the cursor value. Cursors on descending orderings compare in the direction of the ordering (JS and Android always use greater_than for start bounds).!= and not-in with limit on an Enterprise database** can return a page with fewer documents than the limit: the backend counts documents where the field is missing or null, and the client drops them.Decimal128Value accepts only strings that decimal128 holds exactly (the backend rejects the others; JS accepts any and rounds); the sum and average of an aggregation that includes a Decimal128Value are a Decimal128Value; increments on BSON numbers could not be compared with a backend (the emulator replaces the value); a plain Map with a reserved key such as {'__int__': 5} is rejected as document data and read as the BSON value in a query.FirestoreDataConverter.fromFirestore takes only the snapshot; firestore.doc('') throws.toJson() of a missing document writes an empty bundle, which the JS SDK cannot read; this port reads it back as the missing document. A serialized query snapshot whose documents lack a field the query orders by is rejected as invalid (the JS SDK fails an internal assertion).clearPersistence() fails with unknown while another isolate or process has the file open. On Linux, package:sqlite3 needs libsqlite3.so (the example opener falls back to libsqlite3.so.0)._customHeaders setting of the JS SDK.Streams, Source (in GetOptions) replaces getDocFromCache / getDocFromServer, and the API spelling follows the Android SDK and FlutterFire (see Coming from FlutterFire or the JS SDK). Extras over the JS client SDK: Query.findNearest, read-only transactions (also with pipelines), the number of pending writes (getPendingWriteCount, pendingWriteCounts), and the opt-in mergeUnsentWrites, which by design does not behave as the JS SDK (see the row in Offline persistence and cache settings).This document compares the public API and the behaviour of the Firebase Realtime Database client in four official SDKs with firebase_database_dart (firebase_database/firebase_database_dart), feature by feature:
Read from docs/database_parity.md on origin/main at 9122437c.
packages/database and packages/database-compat of firebase-js-sdk at a086865. It is the reference for the protocol and for behaviour.firebase-database of firebase-android-sdk at 2cfdd03.FirebaseDatabase of firebase-ios-sdk at cef246f.database of firebase-cpp-sdk at 09d2e7a (the desktop code speaks the protocol itself; the mobile wrappers delegate to the native SDKs).firebase_database_dart as it is in the code of this repository.The four SDKs were read as clones on 2026-11-22, from GitHub only; their code was read, not run. The Dart column was audited again on 2026-11-28 against the code of main, with a file and line and the test for every built row. Line numbers will drift.
Path shorthand: J: is JS packages/database/src/, JC: packages/database-compat/src/api/, JT: and JCT: their test/ folders; A: is Android firebase-database/src/main/java/com/google/firebase/database/; I: is iOS FirebaseDatabase/Sources/ and IH: its public headers; Ci: is the C++ public API database/src/include/firebase/, Cd: its desktop implementation database/src/desktop/ and CT: database/tests/desktop/. A "—" means the SDK has no such feature; "partly" means it has it with a missing piece or in a weaker form.
Same: Dart has it as the official SDKs do. Different: Dart has it, in another shape or with other behaviour. Missing: a gap Dart could close. Won't do: will not be done, is not needed, makes no sense in Dart or does not apply to it; none of it is a gap. The doc has no Status column for the Realtime Database; the tag is read from the Dart cell: built is Same, won't do, not needed and n/a are Won't do. The doc marks no row as different or missing.
162 feature rows in 19 groups.
| Dart | Rows |
|---|---|
| Built | 139, of which 1 without a test of their own |
| Gaps (wanted, not built) | 0 |
| Won't do or not needed | 17 |
| Not applicable to Dart | 6 |
"Won't do or not needed" rows are decisions, not gaps: each has its reason below and in the decisions. "Not applicable" rows belong to another language or runtime.
The four SDKs, by row (a row that describes a restriction or an extra of one SDK counts as "no" for the others, so "no" is not a defect there):
| JS | Android | iOS | C++ | |
|---|---|---|---|---|
| Yes | 121 | 127 | 123 | 88 |
| Partly | 5 | 7 | 7 | 18 |
| No | 36 | 28 | 32 | 56 |
| Feature | JS | Android | iOS | C++ | Dart | Notes |
|---|---|---|---|---|---|---|
get database (inst.getDatabase) | getDatabase(app = getApp(), url?) J:api/Database.ts:323. Compat: firebase.database(app?, url?). | FirebaseDatabase.getInstance() A:FirebaseDatabase.java:55; getInstance(String url) :70; getInstance(FirebaseApp) :85; getInstance(FirebaseApp, String url) :106. Kotlin: ... | +[FIRDatabase database] IH:FIRDatabase.h:49; databaseWithURL: :57; databaseForApp: :78; databaseForApp:URL: :68 | Database::GetInstance(app, url = nullptr, &init_result) Ci:database.h:68,86 | built: FirebaseDatabase(app, {databaseUrl}); no global cache, two instances are two connections | JS: instances come from the app's component provider, keyed by url; a second getDatabase with the same URL returns the same object. C++: same instance per App (header comment database.h:57). Android and iOS: With no URL the default is https://<projectId>-default-rtdb.firebaseio.com (A:FirebaseDatabase.java:93; I:Api/FIRDatabase.m:77). No project id and no URL: DatabaseException / NSException ... |
default url (inst.defaultUrl) | Default host is <projectId>-default-rtdb.firebaseio.com when options.databaseURL is missing, and fatal when projectId is missing too (J:api/Database.ts:131-135). | FirebaseDatabase.getInstance() A:FirebaseDatabase.java:55; getInstance(String url) :70; getInstance(FirebaseApp) :85; getInstance(FirebaseApp, String url) :106. Kotlin: ... | +[FIRDatabase database] IH:FIRDatabase.h:49; databaseWithURL: :57; databaseForApp: :78; databaseForApp:URL: :68 | — Uses app->options().database_url() only (Cd:database_desktop.cc:67); no default derived from the project id. (inferred) an empty URL ends in a log error Database Url is ... | built: derives <projectId>-default-rtdb.firebaseio.com when no URL is given, as JS, Android and iOS; ArgumentError when there is neither | JS therefore works with only projectId; C++ does not. A URL in the old default form for a non-US region (<ns>.<region>.firebasedatabase.app) is handled by the generic parser in JS. |
url parsing (inst.urlParsing) | parseRepoInfo / parseDatabaseURL J:core/util/libs/parser.ts:59-191: scheme (https, http, ws, wss), host with port, ?ns= query, path part, namespace = first host label or ... | Utilities.parseUrl A:core/utilities/Utilities.java:39-84 | FUtilities parseUrl: plus FIRDatabaseComponent.m:105-124 | partly: ParseUrl::Parse Cd:util_desktop.cc:269-360: only http:// and https:// (else kParseErrorUnknownProtocol), host chars limited to alphanumerics and - (else ... | built: JS rules for a production URL, including regional hosts and ?ns=. With emulatorHost the URL gives only the namespace (its ?ns=, else the first label of its host); its scheme, host (any name or IP) and port are not used to connect. | Edge cases: JS decodeQuery skips segments that do not have exactly one = (warns, parser.ts:49-54). C++ rejects _ in a hostname. JS sets includeNamespaceInQueryParams = namespace !== subdomain (parser.ts:98) so a ?ns= value appears in the WebSocket URL. Android and iOS: Scheme required, host required (A:Utilities.java:44-51). Namespace is the ns query parameter, else the first host label ... |
root only url (inst.rootOnlyUrl) | A database URL with a path is fatal: Database URL must point to the root (J:api/Database.ts:165). | same as inst.urlParsing | same as inst.urlParsing | — not checked; GetReferenceFromUrl takes a path, the instance constructor does not strip one. | built: a URL with a path is refused (FormatException); a trailing / is the root | Cheap validation to copy. |
single repo (inst.singleRepo) | One repo per (app, RepoInfo.toURLString()); a second creation is fatal Database initialized multiple times (J:api/Database.ts:216, cache at Database.ts:77-81). | FirebaseDatabaseComponent.get(RepoInfo) A:FirebaseDatabaseComponent.java:55-70, a map keyed by RepoInfo | databaseForApp:URL: I:Api/FIRDatabaseComponent.m:117-160, keyed by host:path (:131) | One Repo per Database, created lazily (EnsureRepo, Cd:database_desktop.cc:100,106,112); the scheduler thread is process-global and reference counted ... | won't do: not in the client (two instances are two connections); the adapter keeps one instance per app and database, never replaces it, and throws a StateError when the app is recreated under the same name with other options | The URL key is the string form, so https://x.firebaseio.com and https://x.firebaseio.com/ hit the same repo but ?ns= variants differ. Android and iOS: One FirebaseDatabase per (app, database). Repos are additionally registered by https://<host>/<namespace> in RepoManager (A:core/RepoManager.java:92-110, throws IllegalStateException on a second create) |
lazy start (inst.lazyStart) | The connection starts lazily: Database._repo getter calls repoStart on first use (J:api/Database.ts:249-259), and the WebSocket is opened by the first listen/put/get ... | assertUnfrozen A:FirebaseDatabase.java:330-338 and DatabaseConfig.assertUnfrozen; the repo is created lazily by the first reference call (ensureRepo :341-345) | assertUnfrozen: I:Api/FIRDatabase.m:239-248 (FIRDatabaseAlreadyInUse); config isFrozen I:Api/FIRDatabaseConfig.m:53-58 | GetReference etc. call EnsureRepo (Cd:database_desktop.cc:100,106), whose constructor schedules connection_->ScheduleInitialize() at once (Cd:core/repo.cc:110-127). ... | built: connects on the first operation, not at construction | Both stay quiet before first use. Android and iOS: setPersistenceEnabled, setPersistenceCacheSizeBytes, setLogLevel, callbackQueue and useEmulator must be called before the first reference or read. |
delete (inst.delete) | Database._delete() J:api/Database.ts:271-279 (called by deleteApp). Removes the repo, interrupts the connection (repoManagerDeleteRepo :183-191, repoInterrupt). After ... | none: "There's no cleanup path for PersistentConnection (or Repo, etc.). They live forever" A:android/AndroidPlatform.java:120-122 | appWillBeDeleted: disposes all repos I:Api/FIRDatabaseComponent.m:77-90; FRepo dispose interrupts the connection and closes LevelDB I:Core/FRepo.m:300-306 | Database::~Database / DeleteInternal (Ci:database.h:94,193); cleanup registry removes listeners (Cd:database_desktop.cc:87-88). | built: close(), idempotent, never starts an unused instance; open streams end with done and no error; pending Futures fail with database-closed; isConnected is false after close; deleting the app does the same | JS quirk: _delete tests this._rootInternal !== null, but the field starts undefined, and the body calls the _repo getter, which starts a never-used repo just to delete it (Database.ts:272-273, see Quirks U12). Android and iOS: iOS releases the connection and the exclusive disk lock when the app is deleted; Android never does. |
options auth override (inst.options.authOverride) | App option databaseAuthVariableOverride (J:api/Database.ts:257): null sends noauth: true, an object sends authvar on the auth request ... | partly: GAuthToken string (gauth plus a JSON token) becomes action gauth with cred and authvar; A:util/GAuthToken.java:30-60, A:core/PersistentConnectionImpl.java:1075-1085 | — | — not present. | not needed: an admin-only authentication path, not in 0.1 (decisions section 26); mockUserToken is the emulator-only equivalent | Used by the Admin SDK to act as a given uid or unauthenticated. Android and iOS: Admin and legacy server tokens; used when running as admin with an auth override. |
node admin (inst.nodeAdmin) | Internal flag nodeAdmin (parseRepoInfo(url, nodeAdmin)); with the emulator uses the constant token owner (J:api/Database.ts:157-158, AuthTokenProvider.ts:127); lowers ... | partly: same as inst.options.authOverride | — | — not present. | won't do: Node admin path; a service-account client is a different product | A "server mode" Dart client (service-account token, short reconnect cap) is a distinct product; not covered by the JS client API. |
custom host check (inst.customHostCheck) | RepoInfo.isCustomHost() is true unless the domain is firebaseio.com or firebaseio-demo.com (J:core/RepoInfo.ts:66-71). Custom hosts always send ns= in the WebSocket URL ... | Utilities.parseUrl A:core/utilities/Utilities.java:39-84 | FUtilities parseUrl: plus FIRDatabaseComponent.m:105-124 | — none. | built: regional hosts always send ns | New regional hosts (firebasedatabase.app) count as custom here: that is why ns= is always sent. |
host redirect (inst.hostRedirect) | After the handshake the server names the host to use (h in the ServerHello, J:realtime/Connection.ts:383-393); stored as internalHost and cached in persistent storage ... | Connection.onHandshake reads ts, h (host), s (session id) A:connection/Connection.java:60-65, 205-230 | kFWPAsyncServerHello* I:Constants/FConstants.m:60-64 | — Host is fixed from the URL; "cache host" is a TODO (Cd:connection/persistent_connection.cc:151-154). (inferred) the C++ client never follows the h/reset redirect: not ... | built: follows the handshake host and reset | In a browser the cached host skips a redirect on the next load; a desktop process has no persistent storage in the JS port (PersistentStorage falls back to memory, RepoInfo.ts:59). Android and iOS: The server may redirect to another host (h); the next connect sends the last session id as ls (A:core/RepoInfo.java:48-62; I:Core/FRepoInfo.m:173-188). URL: wss://<host>/.ws?ns=<ns>&v=5[&ls=<id>], ... |
app reference (inst.appReference) | Database.app J:api/Database.ts:240 | getApp() A:FirebaseDatabase.java:152 | @property(weak) app IH:FIRDatabase.h:81 | Database::app() Ci:database.h:99 | built: app | Android and iOS hold the app too; iOS holds it weakly. |
freeze setters (inst.freezeSetters) | partly: emulator settings must precede the first use (J:api/Database.ts:364-376) | same as inst.lazyStart | same as inst.lazyStart | set_persistence_enabled is ignored once the repo exists (Cd:database_desktop.cc:180-185) | won't do: configuration is constructor arguments (no setters) | Android and iOS throw when a setter runs after first use. |
| Feature | JS | Android | iOS | C++ | Dart | Notes |
|---|---|---|---|---|---|---|
ref (ref.ref) | ref(db, path?) J:api/Reference_impl.ts:487; returns the root when path is undefined. | getReference() A:FirebaseDatabase.java:162 | -reference IH:FIRDatabase.h:86 | Database::GetReference() and GetReference(const char*) Ci:database.h:111,117 | built: ref([path]) | ref(db, '') is invalid: child validates the path as non-empty (Reference_impl.ts:549-553). |
ref from url (ref.refFromURL) | refFromURL(db, url) J:api/Reference_impl.ts:509-532. Host must match the database's unless it is a custom host (:516-529). | getReferenceFromUrl(String) A:FirebaseDatabase.java:197 | -referenceFromURL: IH:FIRDatabase.h:105 | Database::GetReferenceFromUrl(url) Ci:database.h:124, Cd:database_desktop.cc:109-135: compares HostInfo::ToString() with the database URL; returns an invalid reference ... | built: refFromUrl; ArgumentError for another database | JS throws (fatal), C++ returns an invalid DatabaseReference. C++ parses the URL twice (database_desktop.cc:99-101, harmless). Android and iOS: Android: host must equal the configured host, else DatabaseException (A:FirebaseDatabase.java:204-211); emulator settings are applied to the parsed URL first (:203). iOS: any custom host is accepted, otherwise it must match (I:Api/FIRDatabase.m:148-168) |
child (ref.child) | child(parent, path) J:api/Reference_impl.ts:544-555. Path validated by validatePathString (validation.ts:341-360): non-empty, no . # $ [ ] or control characters ... | child(String) A:DatabaseReference.java:94; null throws NullPointerException | -child: IH:FIRDatabaseReference.h:53 | partly: DatabaseReference::Child(const char*) Ci:database_reference.h:143. No validation found in Cd: (inferred) (a search for the illegal characters, key length and depth ... | built: child(path) with the JS path rules | Server rejects invalid keys on write, so C++ fails later and with a server error. Android and iOS: Invalid path characters [ ] . # $ (A:core/utilities/Validation.java:35; I:Utilities/FValidation.m:26). .info is allowed only as first segment of a root-relative path (A:DatabaseReference.java:98-102, Validation.java:52-60; I:Utilities/FValidation.m:88-108). Multi-segment strings are split on / |
parent root key (ref.parentRootKey) | ref.parent, ref.root, ref.key; key is null for the root (J:api/Reference_impl.ts:111-117,258-271). Compat: getParent(), getRoot(), getKey() (JC:Reference.ts:585-606). | getParent() :576, getRoot() :587, getKey() :596, getDatabase() :552, toString() :558 (full URL), equals/hashCode :604-609 (all A:DatabaseReference.java) | parent :871, root :878, key :886, URL :894, database :901, description :860 (IH:FIRDatabaseReference.h) | GetParent(), GetRoot(), key(), key_string(), is_root() Ci:database_reference.h:93-135 | built: parent, root, key, path, database; Query.path | root walks parents in a loop (Reference_impl.ts:265-270). Android and iOS: getKey() is null at root. |
path limits (ref.pathLimits) | Writes are validated for key depth MAX_PATH_DEPTH = 32 (J:core/util/Path.ts:23,318-324) and path length MAX_PATH_LENGTH_BYTES = 768 UTF-8 bytes (Path.ts:26,308-316); a ... | key path at most 768 UTF-8 bytes and depth at most 32, checked on every write (A:core/ValidationPath.java:35-36,99-114); control characters rejected in keys ... | partly: path length and depth are not enforced; key characters [].#$/ only (I:Utilities/FValidation.m:27); an empty key is invalid (:118) | — none checked (inferred). | built: depth 32 and 768 bytes checked at the call | Limits are enforced client side only on data you write, not on child() paths. The server enforces its own (key 768 bytes, depth 32). Android and iOS: Android only. Validated when a value is written (ValidationPath.validateWithObject A:DatabaseReference.java:279), including keys of nested maps, skipping keys that start with . (:59) |
to string (ref.toString) | ref.toString() returns <repoURL><urlencoded path> (J:api/Reference_impl.ts:154-156); toJSON() same; isEqual compares repo, path, query identifier (:136-148). | same as ref.parentRootKey | same as ref.parentRootKey | DatabaseReference::url() Ci:database_reference.h:383; operator== :440. | built: url, == and hashCode on database, path and query | isEqual in JS includes the query identifier, C++ == is on references. |
path normalisation (ref.pathNormalisation) | Path splits on / and drops empty parts (J:core/util/Path.ts); ref('/a//b/') equals ref('a/b'). (inferred) from the class; not re-read here. | same as ref.child | same as ref.child | Path from the firebase app library, not read. | built: as JS | Normalisation affects listens map keys (PersistentConnection.ts:969). |
info (ref.info) | ref(db, '.info/connected') allowed (validateRootPathString); writes to .info rejected by validateWritablePath (validation.ts:379-383), but update() skips that check ... | child(String) A:DatabaseReference.java:94; null throws NullPointerException | -child: IH:FIRDatabaseReference.h:53 | partly: .info handled by the prefix test in Repo::AddEventCallback (Cd:core/repo.cc:154,167); no write check found (inferred). | built: .info/* readable; writes rejected for every write call | See net.info. |
| Feature | JS | Android | iOS | C++ | Dart | Notes |
|---|---|---|---|---|---|---|
get (read.get) | get(query): Promise<DataSnapshot> J:api/Reference_impl.ts:818-829. Compat: Query.get() JC:Reference.ts:306. | Query.get(): Task<DataSnapshot> A:Query.java:175 -> Repo.getValue A:core/Repo.java:515-598 | -getDataWithCompletionBlock: IH:FIRDatabaseQuery.h:142 -> FRepo getData:withCompletionBlock: I:Core/FRepo.m:521-600 | partly: Query::GetValue(): Future<DataSnapshot> Ci:query.h (GetValueLastResult). Desktop does not use a g request: it adds a one-shot value listener ... | built: get(): a covering active view answers; else the server, with no client timer while connected; not connected, wait 3 s (Android's GET_TIMEOUT_MS), then a complete cache, else unavailable; after goOffline() there is no wait; a refusal by rules is ... | JS first looks in the sync tree: if a listener already holds complete server data the promise resolves from it (J:core/Repo.ts:470-473). Otherwise it sends a g request (PersistentConnection.get, :194-222), merges the answer into the sync tree and raises events for listeners that were registered while it was pending (Repo.ts:486-530). While offline get waits for the connection (queued in ... |
get errors (read.getErrors) | The promise rejects with new Error(payload), where payload is the server status string (e.g. permission_denied): no .code, no path (J:core/Repo.ts:532-535, ... | plain Exception from get() A:PersistentConnectionImpl.java:420 | NSError domain kFirebaseCoreErrorDomain, code 1 I:Core/FRepo.m:575-583 | The future completes with Error code and message (Cd:database_desktop.cc:58-61, SingleValueListener::OnCancelled). | built: one typed exception with the server status; the failure is logged at debug with the query shape only, no bounds or values | Different error shape from set errors (see err.shapes). Android and iOS: Neither maps get errors to the write error codes. |
once (read.once) | Modular: no once; use onValue(q, cb, {onlyOnce: true}) (J:api/Reference_impl.ts:974-983) or get. Compat: Query.once(eventType, cb?, failureOrContext?, context?) returns ... | addListenerForSingleValueEvent(ValueEventListener) A:Query.java:185 | -observeSingleEventOfType:withBlock: IH:FIRDatabaseQuery.h:155 and three more overloads :169, :187, :207 | partly: none (use GetValue). | built: once([type]): the first event of that type, then cancel; may answer from the cache and includes pending local writes. onValue.first is equivalent | onlyOnce removes the registration before calling the user callback (Reference_impl.ts:976-979). Android and iOS: Android registers a normal listener that removes itself on the first event (A:Query.java:185-205). Unlike get, it waits for the first event: with an active complete listener or a complete cache entry that is immediate, otherwise it fires when the server answers (inferred from the ... |
key indexed get on query (read.keyIndexedGetOnQuery) | get on a non-default query: result is a snapshot ordered by the query index (Reference_impl.ts:822-827). | same as read.get | same as read.get | GetValue on a query uses the query's QuerySpec listen. | built: as JS | A get on a limited query asks the server with query params q and registers the query in the sync tree for the duration. |
snapshot (read.snapshot) | DataSnapshot: val(), exportVal(), toJSON(), exists(), child(path), hasChild(path), hasChildren(), forEach(cb), key, ref, priority, size ... | DataSnapshot A:DataSnapshot.java: child(path) :63, hasChild :75, hasChildren :89, exists :98, getValue() :122, getValue(boolean useExportFormat) :151, getValue(Class) ... | FIRDataSnapshot IH:FIRDataSnapshot.h: childSnapshotForPath: :48, hasChild: :56, hasChildren :63, exists :70, valueInExportFormat :82, value :97, childrenCount :104, ref ... | DataSnapshot: exists(), Child(path), children(), children_count(), has_children(), key(), value(), priority(), GetReference(), HasChild(path), is_valid() ... | built: DataSnapshot with value (memoised, unmodifiable), toJson() in place of exportVal, children, childrenCount, hasChild | forEach returns true if the callback returned true (cancel); leaf nodes return false at once (Reference_impl.ts:396-408). child() snapshots iterate in priority order (they get PRIORITY_INDEX, :353,405), only the top-level snapshot uses the query's index. val() turns an object into an array when all keys are 32-bit integer strings and maxKey < 2 * numKeys (J:core/snap/ChildrenNode.ts:203-217); ... |
value types (read.valueTypes) | JSON values: string, number (finite), boolean, null (= missing), object. .value and .priority wrappers in imports (J:core/snap/nodeFromJSON.ts:48-61); undefined, ... | NaN and Infinity rejected (A:core/utilities/Validation.java:84-88); no leaf size limit | string leaf at most 10 MB UTF-8 (I:Constants/FConstants.m:183), object depth at most 1000 (:182), NaN rejected (I:Utilities/FValidation.m:211-225) | Variant: null, int64, double, bool, string, map, vector; blobs rejected in persistence (Cd:persistence/level_db_persistence_storage_engine.cc:515, ... | built: integral values within +-2^53 are int, others double, on the VM and the web; int64 values stay exact on the VM | Measured on the emulator: 1.0 comes back as 1.0 and int64 integers stay exact (9223372036854775807); doubles print as 1.0E21. A leaf string larger than MAX_LEAF_SIZE_ = 10 * 1024 * 1024 UTF-8 bytes is rejected (validation.ts:56,145-160), checked only when length > MAX / 3 as a cheap pre-test. No total write size check client side. Android and iOS: iOS only. Android has no client-side size or depth limit other than the 32-level key path (searched core/utilities and snapshot: no 10 * 1024 * 1024 outside cache size). The ... |
ordering (read.ordering) | Key order: integer-looking keys (32-bit range, tryParseInt) sort numerically before other keys; ties between "1" and "01" break on string length; other keys compare ... | sorts in the client (A:core/view/filter/*); the key order rules were not read | sorts in the client; the key order rules were not read | QueryParamsComparator / Cd:query_params_comparator.cc with the same rules; a TODO notes imperfect comparison in one case (query_params_comparator.cc:229). | built: UTF-16 code unit order, as JS and Android compare; integer-like keys in the int32 range first, numerically; confirmed on the emulator, production not measured | The server orders the same way: UTF-16 code unit, measured on the emulator (production is not measured). Integer-like keys in the int32 range sort first, numerically; the emulator also treats -0, 01 and 007 as integers, and so does the JS comparison (J:core/util/util.ts:496-511); only the array conversion excludes leading zeros (J:core/snap/ChildrenNode.ts:194). Android and iOS: Indexes are defined by the database rules (.indexOn); the client sorts and filters data itself in View/IndexedFilter/LimitedFilter/RangedFilter ... |
offline get (read.offlineGet) | — get waits for the connection with no timeout (J:core/PersistentConnection.ts:218-221, queued in outstandingGets_); (test) JT:test/exp/integration.test.ts:408,433 | partly: GET_TIMEOUT_MS = 3000: answers with the cached value after 3 s, also while connected (A:core/Repo.java:64,535-553); with no cache it stays pending until connected ... | fails after 3 s with Client is offline. and falls back to the cache on any failed get (I:Core/FPersistentConnection.m:917-933, I:Core/FRepo.m:544-575) | — GetValue is a listener and waits as well | built: not connected: wait 3 s, then a complete cache (memory or persisted), else unavailable; no client timer while connected; a refusal by rules is permission-denied with no cache fallback | Android resolves with the cache after 3 s (GET_TIMEOUT_MS); iOS fails after 3 s with Client is offline. and falls back to the cache on any failed get. |
| Feature | JS | Android | iOS | C++ | Dart | Notes |
|---|---|---|---|---|---|---|
on value (listen.onValue) | onValue(query, cb, cancelCb?), onValue(query, cb, options), onValue(query, cb, cancelCb, options) returning Unsubscribe J:api/Reference_impl.ts:1023-1106; options ... | addValueEventListener(ValueEventListener) A:Query.java:152 returns the listener; ValueEventListener.onDataChange(DataSnapshot), onCancelled(DatabaseError) ... | -observeEventType:withBlock: with FIRDataEventTypeValue IH:FIRDatabaseReference.h:226 / FIRDatabaseQuery.h:57; returns FIRDatabaseHandle (NSUInteger, ... | Query::AddValueListener(ValueListener*), RemoveValueListener, RemoveAllValueListeners Ci:query.h; ValueListener::OnValueChanged(snapshot), OnCancelled(error, msg) ... | built: onValue, a Stream.multi: each listen is its own registration with its own initial events | Fires immediately with cached data if complete, then on every change; the first value arrives after the server answers q (listen). The same registration can be removed through an equal query (C++ header note query.h:43). C++ requires the listener object to outlive the registration (query.h comment). Android and iOS: A value event carries the full snapshot of the query; fires once from cache or ... |
child events (listen.childEvents) | onChildAdded, onChildChanged, onChildMoved, onChildRemoved J:api/Reference_impl.ts:1135-1607; callback (snapshot, previousChildName); removed has only the snapshot. | addChildEventListener(ChildEventListener) A:Query.java:165; onChildAdded/Changed/Moved(snapshot, previousChildName), onChildRemoved(snapshot), onCancelled ... | FIRDataEventTypeChildAdded, ChildRemoved, ChildChanged, ChildMoved IH:FIRDataEventType.h:26-36, observed one type per call; ... | Query::AddChildListener(ChildListener*); OnChildAdded/Changed/Moved(snapshot, const char* previous_sibling), OnChildRemoved(snapshot), OnCancelled Ci:listener.h:69-106. | built: onChildAdded, onChildChanged, onChildMoved, onChildRemoved, and Query.onChildEvents: one stream of all child events in their true order | One child listener in C++ receives all four types; JS has one function per type. ChildEventRegistration.respondsTo maps the legacy names children_added and children_removed (Reference_impl.ts:896-902). Android and iOS: child_added fires for each existing child first, in index order. child_moved fires when a changed child changes position in the order. |
unsubscribe (listen.unsubscribe) | Unsubscribe closure returned by each on*; or off(query, eventType?, callback?) J:api/Reference_impl.ts:1634-1650 (all listeners of a type, or all when no type). | removeEventListener(ValueEventListener) A:Query.java:210; (ChildEventListener) :222 | -removeObserverWithHandle: IH:FIRDatabaseQuery.h:223; -removeAllObservers :229 | RemoveValueListener, RemoveChildListener, RemoveAll*. | built: cancel the subscription; no off | off with no callback removes every registration of that type for an equal query: matching uses matches() on the registration (Reference_impl.ts:871-880). Android and iOS: Android has no remove-all (a commented-out removeAllEventListeners at A:Query.java:276). After removal no further events reach the listener: ZombieEventManager.zombifyForRemove (A:Query.java:226-228, ... |
cancel on permission (listen.cancelOnPermission) | A listener that the server revokes (c message, or listen answer other than ok) is cancelled: the cancel callback gets an Error with .code upper-case, message <status> at ... | onCancelled(DatabaseError) on both listener types | withCancelBlock: overloads IH:FIRDatabaseReference.h:270-296 | OnCancelled(error, message); error mapped by StatusStringToErrorCode (used at Cd:connection/persistent_connection.cc:775,878,965, definition not read). | built: server cancel: addError(FirebaseDatabaseException) then close; close() of the database or deleting the app: done, no error | The revoked query is removed from the connection's listen map (PersistentConnection.ts:954-966,305-307). Android and iOS: Raised when the server rejects or revokes a listen (for example permission denied); the failed listen is removed (A:PersistentConnectionImpl.java:1347-1356) and the local data is not kept. |
local events (listen.localEvents) | Local writes raise events synchronously before the server acknowledges (J:core/Repo.ts:564-571,593): set -> syncTreeApplyUserOverwrite then eventQueueQueueEvents then ... | yes | yes | Same model: Repo::SetValue applies to server_sync_tree_ and posts events (Cd:core/repo.cc:554-562 PostEvents). | built: events of a local write are delivered before its Future completes, from the database's queue and not inside the set call | The optimistic layer is the hardest part to port: WriteTree, CompoundWrite, SyncPoint and View (J: about 5,700 lines; C++ Cd:core/, Cd:view/). A shared spec exists: see plat.specVectors. Android and iOS: Local writes raise events immediately, before the server acknowledges (latency compensation, SyncTree.applyUserOverwrite A:core/SyncTree.java:183-205); on failure the write is reverted and a ... |
event order (listen.eventOrder) | EventQueue raises events grouped by path in the order queued; events for a path run as one list (J:core/view/EventQueue.ts:62-160). Listener callbacks run inside the ... | per-listener events in order; local events before server events | same as Android | Events fire on the Repo scheduler thread (Cd:core/repo.cc:554-562, event_registration.cc:23-35). | built: one FIFO per database, drained in a microtask, never inside the call that caused it; order between separate subscriptions holds only while none is paused, and Query.onChildEvents is the one ordered stream of child events. This differs from JS on purpose | Order within a path is deterministic and tested by JT:test/helpers/syncPointSpec.json. |
listen options only once (listen.listenOptionsOnlyOnce) | ListenOptions { onlyOnce?: boolean } J:api/Reference.ts. | same as read.once | same as read.once | partly: none (use GetValue). | built: once() | See read.once. |
dedupe (listen.dedupe) | Duplicate listens at the same path and query share one server q: the connection asserts listen() called twice for same path/queryId ... | SyncTree.getNextQueryTag A:core/SyncTree.java:636, 1006; Tag A:core/Tag.java | listenSpec.tagId I:Core/FPersistentConnection.m:951-956 | WebSocketListenProvider and TrackedQueryManager (Cd:core/web_socket_listen_provider.cc, tracked_query_manager.cc). | built: equal queries share one server listen; each stream is still its own registration with its own initial events | Tags let the server answer different query views at one path. Android and iOS: Non-default queries get a numeric tag (t in the listen request) so server pushes (d/m) for a filtered view carry the tag and are routed to that view only. |
listen warnings (listen.listenWarnings) | A listen answer with w: ["no_index"] logs Using an unspecified index... consider adding ".indexOn"... (J:core/PersistentConnection.ts:316-331). | listen response warnings w logged A:PersistentConnectionImpl.java:1337-1345 | same as Android | — kServerDataWarnings = "w" is defined (Cd:connection/persistent_connection.cc:87); (inferred) no warning is logged. | built: logged once per listen answer, through the logger | A useful diagnostic; costs nothing. Android and iOS: "Using an unspecified index" style warnings. |
too big (listen.tooBig) | Server status too_big -> the listener is cancelled with the message The data requested exceeds the maximum size that can be accessed with a single request. ... | — not found in the Android reading | — not found in the iOS reading | — (inferred) falls to a generic server error code. | built: code too-big | Applies to un-queried listens on big nodes; the server limit is not enforced client side. |
remove all (listen.removeAll) | off(query) with no type removes every listener of that query (J:api/Reference_impl.ts:1634-1650) | — no remove-all; one removeEventListener per listener (A:Query.java:210,222) | -removeAllObservers (IH:FIRDatabaseQuery.h:229) | RemoveAllValueListeners(), RemoveAllChildListeners() (Ci:query.h) | won't do: cancel each subscription; there is no registry of handles to clear | Android has no remove-all (a commented-out method at A:Query.java:276); iOS has removeAllObservers (IH:FIRDatabaseQuery.h:229). |
| Feature | JS | Android | iOS | C++ | Dart | Notes |
|---|---|---|---|---|---|---|
set (write.set) | set(ref, value): Promise<void> J:api/Reference_impl.ts:680-693. Compat Reference.set(value, onComplete?) JC:Reference.ts:611. | setValue(Object): Task<Void> A:DatabaseReference.java:158; setValue(Object, Object priority) :198; setValue(Object, CompletionListener) :236; setValue(Object, Object, ... | -setValue: IH:FIRDatabaseReference.h:92; setValue:withCompletionBlock: :102; setValue:andPriority: :113; setValue:andPriority:withCompletionBlock: :124 | DatabaseReference::SetValue(Variant): Future<void> Ci:database_reference.h:308 | built: set(value, {priority}) | JS validates with validateWritablePath and validateFirebaseDataArg (validation.ts:96-199), then repoSetWithPriority. Local events fire synchronously; the promise resolves on the server ack, or rejects with Error(CODE: reason) and .code (J:core/Repo.ts:892-917). set(ref, null) removes. Arrays are converted to maps keyed by index. C++ allows only one SetValue in flight per DatabaseReference object: ... |
set priority (write.setPriority) | setPriority(ref, priority) (J:api/Reference_impl.ts:707-723): writes to <ref>/.priority. Priority must be null, string, finite number or a server value object ... | setPriority(Object) A:DatabaseReference.java:328; (Object, CompletionListener) :362 | -setPriority: IH:FIRDatabaseReference.h:177; ...withCompletionBlock: :187 | SetPriority(Variant) Ci:database_reference.h:276; priority must be a fundamental Variant type else kErrorInvalidVariantType (Cd:database_reference_desktop.cc:171-175). | built: setPriority | Setting a priority on a node that does not exist locally has no visible effect until the node exists. Android and iOS: Priority is a string, a number (long coerced to double), a server value or null; anything else throws (A:snapshot/PriorityUtilities.java:26-58). Sent as a write at child .priority; the completion listener receives the parent reference when the path ends in .priority ... |
set with priority (write.setWithPriority) | setWithPriority(ref, value, priority) (J:api/Reference_impl.ts:740-761). Throws a string, not an Error, when the key is .length or .keys (:748-750, U8). | same as write.setPriority | same as write.setPriority | SetValueAndPriority(value, priority) Ci:database_reference.h:335: builds {".value": v, ".priority": p} for leaves (Cd:database_reference_desktop.cc:240-248); conflicts ... | built: set(value, priority: p) | Wire form: leaf = {".value":..., ".priority":...}, object = children plus .priority. |
update (write.update) | update(ref, values): Promise<void> J:api/Reference_impl.ts:798-808. Keys may be multi-segment paths (a/b/c); values null delete; keys must not be ancestors of each other ... | updateChildren(Map<String,Object>) A:DatabaseReference.java:391; (Map, CompletionListener) :402 | -updateChildValues: IH:FIRDatabaseReference.h:197; ...withCompletionBlock: :207 | UpdateChildren(Variant map) / (std::map<std::string, Variant>) Ci:database_reference.h:356,369; a non-map gives kErrorInvalidVariantType ... | built: update(Map), multi-segment keys; a key naming the location itself ('', '/') throws ArgumentError at the call, nothing is sent; an update that empties and refills a node keeps the node's priority, as the server does | update does not call validateWritablePath, so update(ref('.info'), ...) passes client validation (U9). Multi-path updates are atomic on the server. Android and iOS: Keys may be multi-segment paths. Two keys where one is an ancestor of the other throw (A:Validation.java:155-166). A key whose last segment is .value or .sv throws (:144-146). Empty map: no-op, completion fires with success ... |
push (write.push) | push(parent, value?) returns a ThenableReference whose key is known at once; the promise resolves to a plain Reference (J:api/Reference_impl.ts:598-630). With no value ... | push() A:DatabaseReference.java:117; PushIdGenerator.generatePushChildName(serverTime) A:core/utilities/PushIdGenerator.java:40-66 | -childByAutoId IH:FIRDatabaseReference.h:65; I:Utilities/FNextPushId.m | partly: PushChild(): DatabaseReference Ci:database_reference.h:156, then SetValue; Cd:database_reference_desktop.cc:116-121. | built: push() makes the reference only; push().set(v) writes | Id = 8 timestamp chars + 12 random chars from -0-9A-Z_a-z (64 chars), PUSH_CHARS J:core/util/NextPushId.ts:29-30; same millisecond: the random part increments (:79-90) so ids stay ordered. JS uses server time (repoServerTime, Reference_impl.ts:605). C++ uses time(nullptr) * 1000 (local clock, second resolution, Cd:database_reference_desktop.cc:117), so ids from one process within a second are ... |
remove (write.remove) | remove(ref) = set(ref, null) J:api/Reference_impl.ts:646-649. | removeValue(): Task<Void> :436; removeValue(CompletionListener) :445 (both setValue(null)) | -removeValue :139; -removeValueWithCompletionBlock: :148 | RemoveValue() Ci:database_reference.h:170 | built: remove() | remove on the root is allowed unless a rule forbids. |
in flight limit (write.inFlightLimit) | — none. | — | — | One outstanding SetValue/SetPriority/SetValueAndPriority/UpdateChildren per reference object; docs say use RunTransaction for concurrency ... | n/a: Not a protocol limit. | A C++ API restriction, not a protocol one. The Dart client does not copy it. |
data validation (write.dataValidation) | validateFirebaseData (J:core/util/validation.ts:112-199): rejects undefined, functions, NaN/Infinity, strings over 10 MiB, invalid keys (INVALID_KEY_REGEX_ = [ ] . # $ / ... | key path at most 768 UTF-8 bytes and depth at most 32 (A:core/ValidationPath.java:35-36); invalid-key regex with control characters ... | key characters [].#$/ (I:Utilities/FValidation.m:27); string leaf at most 10 MB (I:Constants/FConstants.m:183); object depth at most 1000 (:182); NaN rejected ... | — no data validation in Cd: (inferred). | built: JS rules, thrown as ArgumentError, in release builds too | Error text names the failing path (validationPathToErrorString). |
batched acks (write.batchedAcks) | Each write gets an increasing write id (J:core/Repo.ts:445-447); acks remove the write from the WriteTree (syncTreeAckUserWrite). Failed writes are reverted and warned ... | write ids and acks in SyncTree; a failed write is reverted with a correcting event (A:core/SyncTree.java:235-279) | the same design (I:Core/FRepo.m, not read in detail) | next_write_id_ (Cd:core/repo.cc), AckWriteAndRerunTransactions (:427-441). | built: rejected writes roll back with events and fail the Future | A failed write fires events a second time (the revert). Android and iOS: Writes are sent in order; after a reconnect puts are re-sent sorted by id (A:PersistentConnectionImpl.java:1171-1177) |
offline queue (write.offlineQueue) | Writes sent while disconnected are buffered in outstandingPuts_ and replayed in order after reconnect (J:core/PersistentConnection.ts:584-600,1048-1052). On disconnect ... | puts are buffered and sent again after a reconnect (A:PersistentConnectionImpl.java:1171-1177); with persistence the writes table survives a restart | the same; with persistence the writes LevelDB survives a restart | PersistentConnection keeps outstanding puts and replays them (Cd:connection/persistent_connection.cc, RestoreOutstandingRequests :1044); CancelSentTransactions at :312. | built: memory queue; survives a restart only with persistence; if the disk store degrades, writes answered after the error are deleted at close and not sent again | Lost on process exit in JS and in C++ without persistence; with persistence the C++ pending-write records are saved ($user_write_records/, Cd:persistence/level_db_persistence_storage_engine.cc:63,318-380). |
purge outstanding (write.purgeOutstanding) | — none (Android/iOS have it too). | FirebaseDatabase.purgeOutstandingWrites() A:FirebaseDatabase.java:230 | -purgeOutstandingWrites IH:FIRDatabase.h:119 | Database::PurgeOutstandingWrites() Ci:database.h:144: rolls back all pending writes locally (events fire), aborts transactions with kErrorWriteCanceled, drops them from ... | built: purgeOutstandingWrites() | Needed to recover from a stuck write that the server will never accept (rules changed while offline). Android and iOS: Reverts all pending writes locally (with events), aborts all transactions with WRITE_CANCELED, drops queued onDisconnect requests, removes persisted writes (A:Repo.java:653-663, SyncTree.java:281-296, PersistentConnectionImpl.java:464-478; I:Core/FRepo.m:511-523, ... |
at least once (write.atLeastOnce) | after a reconnect every unacknowledged put is sent again with a new request number and no de-duplication (J:core/PersistentConnection.ts:1048-1052, request counter reset ... | after a reconnect puts are re-sent sorted by id (A:PersistentConnectionImpl.java:1171-1177) | outstanding puts are sent again after a reconnect (reading of I:Core/FPersistentConnection.m for the order not done) | same: RestoreOutstandingRequests (Cd:connection/persistent_connection.cc:1044) | built: at-least-once, documented and pinned by a test; a degraded disk store does not resend writes it saw answered, but after a crash an increment can still apply twice; whether increment gets special treatment is not decided | A write whose acknowledgement was lost can apply twice in every SDK; no client-side fix exists. Measured on the emulator: an increment sent, the socket closed before the answer, then the same put sent on a new connection gave 2. Android sends the puts again in id order. |
| Feature | JS | Android | iOS | C++ | Dart | Notes |
|---|---|---|---|---|---|---|
timestamp (sv.timestamp) | serverTimestamp(): object returns {".sv": "timestamp"} J:api/ServerValue.ts:27. Resolved locally with repoServerTime() = Date.now() + .info/serverTimeOffset ... | ServerValue.TIMESTAMP ({".sv":"timestamp"}) A:ServerValue.java:33 | +[FIRServerValue timestamp] IH:FIRServerValue.h:32 | partly: const Variant& ServerTimestamp() Ci:common.h ({".sv":"timestamp"}). Local resolution uses time(nullptr) * 1000 + server_time_offset (Cd:core/server_values.cc:30-36): ... | built: ServerValue.timestamp | Local events show the estimated value first, then the server value replaces it (a second event). The offset only exists after the first handshake (PersistentConnection.handleTimestamp_, :930-933). Android and iOS: Resolved locally with the server clock for the optimistic event (ServerValues.generateServerValues(serverClock) A:core/ServerValues.java:34-37, Repo.java:455-475) and sent unresolved; ... |
increment (sv.increment) | increment(delta: number) {".sv": {"increment": delta}} J:api/ServerValue.ts:38. Local resolution adds delta to the existing leaf number, or uses delta when the existing ... | ServerValue.increment(long) :50; increment(double) :68 | +increment:(NSNumber *) IH:FIRServerValue.h:49 | — Not provided: no Increment function, and ResolveDeferredValue only looks up string keys in the server-values map, so a {".sv": {"increment": n}} map is left unresolved ... | built: ServerValue.increment(num) | Atomic counters are one of the main reasons to use update; the Dart client matches JS. Increment on a path with a pending local write must read the optimistic value: JS uses DeferredValueProvider (calc complete event cache, ServerValues.ts:55-72). Android and iOS: Wire {".sv":{"increment":n}}. Local resolution against the current local value: a missing or non-number existing value yields ... |
in priority (sv.inPriority) | .sv allowed as a priority value (validation.ts:86-90) and resolved in resolveDeferredValue (J:core/util/ServerValues.ts:194-241). | server values are valid priorities (DeferredValueNode) A:snapshot/PriorityUtilities.java:26-33 | same as Android | ResolveDeferredValueSnapshot resolves the priority too (Cd:core/server_values.cc:75-82). | built: as JS | Rarely used. |
on disconnect (sv.onDisconnect) | Server values in onDisconnect().set are resolved at disconnect time with the then-current offset (J:core/Repo.ts:671-705). | SparseSnapshotTree onDisconnect A:core/SparseSnapshotTree.java:23; applied in runOnDisconnectEvents() A:Repo.java:813-832 | FSparseSnapshotTree I:Core/FRepo.m:874-900 | Repo::RunOnDisconnectEvents same idea (Cd:core/repo.cc:577-). | built: resolved at disconnect time | See od.localSimulation. Android and iOS: After the server acknowledges the registration the client remembers it; when the connection drops the client applies the same values locally (with the current clock) so local listeners see the result, even though the server did the real write. |
after restart (sv.afterRestart) | — | persisted writes keep .sv placeholders (node.getValue(true) A:android/SqlPersistenceStorageEngine.java:223); restored writes resolve with a fresh ... | valForExport:YES I:Persistence/FLevelDBStorageEngine.m:322-337; resolved at restore I:Core/FRepo.m:224-262 | — not checked | built: placeholders stay unresolved on disk; the estimate is recomputed on load | Persisted writes keep their .sv placeholder, and the clock offset is zero until the first handshake, so the first local estimates can be off. |
| Feature | JS | Android | iOS | C++ | Dart | Notes |
|---|---|---|---|---|---|---|
compose (query.compose) | query(q, ...constraints) applies QueryConstraint._apply in order (J:api/Reference_impl.ts:2252-2263); each factory returns a constraint object (QueryConstraint.type, ... | each Query method returns a new Query (A:Query.java:390-871) | each FIRDatabaseQuery method returns a new query (IH:FIRDatabaseQuery.h:320-459) | Chainable methods that return a new Query (Ci:query.h:104-308). | built: immutable Query, chained | Immutable: each call copies QueryParams (J:core/view/QueryParams.ts:184-201). |
order by child (query.orderByChild) | orderByChild(path): rejects $key, $priority, $value (J:api/Reference_impl.ts:2079-2094), invalid path (validatePathString), empty path (:2044-2048); error You can't ... | orderByChild(String path) A:Query.java:810 | -queryOrderedByChild: IH:FIRDatabaseQuery.h:277 | partly: OrderByChild(const char*) / (std::string) Ci:query.h:104,114: no validation, a later OrderBy* replaces the earlier one (Cd:query_desktop.cc:317-340). | built: orderByChild, JS validation | Wire index i = ".key", ".value", ".priority" or the child path (QueryParams.ts, queryParamsGetQueryObject :386-430). Android and iOS: Path may be nested (a/b). $key/.key, $priority/.priority, $value/.value as the path throw and tell you to use the dedicated method (A:Query.java:813-831); empty path throws (:834-836); invalid path characters throw. Only one orderBy per query: "You can't combine ... |
order by key (query.orderByKey) | orderByKey() J:api/Reference_impl.ts:2121. With a key index startAt/endAt/equalTo must be a string and may not use the second (key) argument (validateQueryEndpoints ... | orderByKey() :857 | -queryOrderedByKey :287 | OrderByKey(); same string-only rule, checked in ValidateQueryEndpoints (Cd:query_desktop.cc:48-90) but the failure only logs a warning and returns an invalid query. | built: orderByKey | Invalid C++ queries are silent: is_valid() false, listeners do nothing (inferred). Android and iOS: With startAt/endAt/equalTo the value must be a String and the two-argument (key) forms are rejected (A:Query.java:86-118; I:Api/FIRDatabaseQuery.m:95-125) |
order by value (query.orderByValue) | orderByValue() J:api/Reference_impl.ts:2178; start/end values may not be objects (:221-229). | orderByValue() :871 | -queryOrderedByValue IH:FIRDatabaseQuery.h:297 (not on the reference header) | OrderByValue(). | built: orderByValue | Needs .indexOn: ".value" for server-side filtering, otherwise the data downloads and filters client side (no_index warning). |
order by priority (query.orderByPriority) | orderByPriority(); with priority index, values must be valid priorities (validateQueryEndpoints :204-214). | orderByPriority() :843 | -queryOrderedByPriority :307 | OrderByPriority(); same check, warns and returns an invalid query (Cd:query_desktop.cc:77-88). | built: orderByPriority | Default order when no orderBy* is applied is priority, then key (QueryParams.ts:86). Android and iOS: Default order. Start/end values must be valid priorities (A:Query.java:109-117) |
start at (query.startAt) | startAt(value = null, key?) J:api/Reference_impl.ts:1869-1875. Value must be string, number, boolean or null; "Starting point was already set" if one exists ... | startAt(String, double or boolean[, String key]) A:Query.java:390-476 | -queryStartingAtValue: IH:FIRDatabaseQuery.h:320; ...childKey: :338 | StartAt(Variant) / StartAt(Variant, const char* child_key) Ci:query.h:203,222; non-scalar value, or a second call, logs a warning and returns an invalid query ... | built: startAt(value, {key}) | JS wire: sp (value), sn (name), sin (inclusive flag, QueryParams.ts:390-399). Android and iOS: Value must be a leaf (string, number, boolean or null) (A:Query.java:466-469). Calling startAt, startAfter or equalTo twice throws (:470-473). The key narrows ties on the same value. |
start after (query.startAfter) | startAfter(value, key?) J:api/Reference_impl.ts:1929-1935; implemented as startAt with sin: false and, for non-key indexes without a key, name MAX_NAME ... | startAfter(String, double or boolean[, String key]) :295-380 (@since 19.6) | -queryStartingAfterValue: :352; ...childKey: :371 | — Missing: no StartAfter in Ci:query.h (grep of the header). | built: startAfter; the emulator honours sin when the key name is sent (measured) | JS error text mentions startBefore by mistake (Reference_impl.ts:1834, U10). Android and iOS: Android: startAfter(value) = startAt(value, MAX_KEY_NAME) (A:Query.java:295-300); on orderByKey it uses PushIdGenerator.successor (:339-345). iOS: FNextPushId successor on the key (I:Api/FIRDatabaseQuery.m:204-232). The two successor functions use different sentinel chars: Android - and z ... |
end at (query.endAt) | endAt(value, key?) J:api/Reference_impl.ts:1744-1750, constraint :1687-1719; error text says "Starting point was already set" (copy-paste, :1707-1710, U10). | endAt(...) :595-680 | -queryEndingAtValue: :384; ...childKey: :401 | EndAt(...) Ci:query.h:237,256. | built: endAt | queryParamsEndAt tests key !== undefined while startAt tests key != null (QueryParams.ts:294 vs :258), unreachable via the public API because validateKey rejects null (U11). |
end before (query.endBefore) | endBefore(value, key?) J:api/Reference_impl.ts:1805-1811; mirror of startAfter with name MIN_NAME (QueryParams.ts:304-317). | endBefore(...) :500-590 | -queryEndingBeforeValue: :415; ...childKey: :431 | — Missing. | built: endBefore; the emulator honours ein when the key name is sent (measured) | Wire: ep, en, ein false. Android and iOS: Symmetric, using predecessor |
equal to (query.equalTo) | equalTo(value, key?) J:api/Reference_impl.ts:2235-2240: fails if a start or end already exists (:2194-2203), then applies startAt and endAt with the same arguments ... | equalTo(String, double or boolean[, String key]) :692-770 | -queryEqualToValue: :444; ...childKey: :459 | EqualTo(Variant) / EqualTo(Variant, key) Ci:query.h:268,287, Cd:query_desktop.cc:440-480. | built: equalTo | The only point-lookup form. Android and iOS: Implemented as startAt(v).endAt(v) (A:Query.java:731-734); "Cannot combine equalTo() with startAt() or endAt()" (:128-136) |
limit to first (query.limitToFirst) | limitToFirst(n): n must be a positive integer (J:api/Reference_impl.ts:1979-1981); once only (:1945-1950). Wire l, vf: "l". | limitToFirst(int) A:Query.java:772 | -queryLimitedToFirst: IH:FIRDatabaseQuery.h:253 | LimitToFirst(size_t) Ci:query.h:301, Cd:query_desktop.cc:483-487: no validation (0 accepted), separate fields limit_first and limit_last, so (inferred) both can be set. | built: limitToFirst, positive integer | JS rejects limit with both start and end and no anchored limit: Can't combine startAt(), startAfter(), endAt(), endBefore(), and limit() (validateLimit, :236-248). Android and iOS: limit <= 0 throws (A:Query.java:773-775); a second limit throws (:776-779; the message names limitToLast for both, cosmetic). iOS: NSUInteger, must be less than 2^31 (I:Api/FIRDatabaseQuery.m:406-408). Combining ... |
limit to last (query.limitToLast) | limitToLast(n): J:api/Reference_impl.ts:2026-2032; wire vf: "r". | limitToLast(int) :791 | -queryLimitedToLast: :264 | LimitToLast(size_t) Ci:query.h:308. | built: limitToLast | limitToLast evicts from the front on adds; LimitedFilter (J:core/view/filter/LimitedFilter.ts, 314 lines; C++ Cd:view/limited_filter.cc, 222 lines) is the subtle part. (test) JCT:test/query.test.ts (166 cases). Android and iOS: Same validation. Server returns the last N of the index order. |
index behaviour (query.indexBehaviour) | Without .indexOn the server answers with the no_index warning and the client filters; this works but downloads the whole node (J:core/PersistentConnection.ts:316-331). ... | indexes come from the rules; the client sorts and filters itself (A:core/view/filter/*); w warnings are logged (A:PersistentConnectionImpl.java:1337-1345) | the same: client-side filtering; warnings are logged (read in less detail) | partly: same server behaviour; no warning logged. | built: warns once, filters on the client | The Dart client logs the same warning once per query. |
identifier (query.identifier) | _queryIdentifier = ObjectToUniqueKey(queryObject) with "default" for no params (J:api/Reference_impl.ts:123-127); keys the listen map and the tags. | QueryParams.getWireProtocolParams A:core/view/QueryParams.java:42-48 | kFQP* I:Constants/FConstants.m:123-131 | QuerySpec ordering and QueryParamsComparator Cd:. | built: internal | The JSON key ordering must be deterministic (ObjectToUniqueKey sorts keys, util.ts:305-330). Android and iOS: Keys sp, sn (start value and name), ep, en (end), l (limit), vf (view from l or r), i (index, .key, .value, .priority or child path). Default query: {} |
rest params (query.restParams) | queryParamsToRestQueryStringParameters (J:core/view/QueryParams.ts:333-384): orderBy, startAt, startAfter, endAt, endBefore, limitToFirst, limitToLast, as JSON strings, ... | — no HTTP client: every operation is the websocket (searched for HttpURLConnection, OkHttp, forceRestClient; only HttpsURLConnection.getDefaultHostnameVerifier() in ... | — no NSURLSession for data (NSURLRequest only builds the websocket upgrade request, I:Realtime/FWebSocketConnection.m:575) | — not applicable. | won't do: left out with the REST client | This is the REST contract for the read-only REST fallback (see rest.queryParams). |
keep synced (query.keepSynced) | — None in JS (grep for keepSynced found no match in J:). | Query.keepSynced(boolean) A:Query.java:261; .info throws (:262-264); SyncTree.keepSynced A:SyncTree.java:854-865 | -keepSynced: IH:FIRDatabaseQuery.h:240 | Query::SetKeepSynchronized(bool) Ci:query.h, Cd:query_desktop.cc:305-315, with KeepSyncedEventRegistration (Cd:core/keep_synced_event_registration.cc). | built: keepSynced(bool), meaningful with persistence | Only meaningful with persistence: a kept-synced location is not evicted from the disk cache. Android and iOS: Adds or removes a no-op KeepSyncedEventRegistration so the server listen stays open. With persistence this keeps the data fresh on disk (active queries are not prunable). The flag itself is not persisted. |
compound hash (query.compoundHash) | — not used: only the simple hash is sent (J:core/PersistentConnection.ts:289) | getSimpleHash and getCompoundHash A:core/SyncTree.java:82, 100-140; h and ch in the listen request A:PersistentConnectionImpl.java:1301-1325 | FCompoundHash, I:Core/FPersistentConnection.m:951-980 | — defined and never sent: kRequestCompoundHash etc. (Cd:connection/persistent_connection.cc:56-59), // TODO ... Compound Hash :727 | built: Plan said later. Built: sent as ch when the cache is above 1,024 bytes (decisions 25 row 15). | Sent by Android and iOS when the cached node is estimated over 1,024 bytes. The emulator supports ch and rm (measured). |
range merge (query.rangeMerge) | — the rm push is not recognised (J:core/PersistentConnection.ts:693-698, logged as an unrecognised action) | server push rm A:PersistentConnectionImpl.java:259, 947-966; Repo.onRangeMergeUpdate A:core/Repo.java (method after onDataUpdate, about :383) | rm handled (I:Core/FPersistentConnection.m:1138-1173, I:Core/FRangeMerge.m) | — rm is received and ignored (Cd:connection/persistent_connection.cc:867-868) | built: Plan said later. Built together with the compound hash. A range whose boundary falls inside a node keeps the priorities, including those of emptied nodes (0.1.1). | Android and iOS apply rm range merges. |
limit edge (query.limitEdge) | LimitedFilter (J:core/view/filter/LimitedFilter.ts) | limitToFirst(int) A:Query.java:772 | -queryLimitedToFirst: IH:FIRDatabaseQuery.h:253 | Cd:view/limited_filter.cc | built: as JS; checked against the shared sync-point specs | Android and iOS reject a limit of zero or less and a second limit (A:Query.java:773-779); the filter itself is their LimitedFilter equivalents. |
| Feature | JS | Android | iOS | C++ | Dart | Notes |
|---|---|---|---|---|---|---|
run (txn.run) | runTransaction(ref, update, {applyLocally?}): Promise<TransactionResult{committed, snapshot}> J:api/Transaction.ts:94-144. Compat: Reference.transaction(update, ... | runTransaction(Transaction.Handler) A:DatabaseReference.java:470; runTransaction(handler, boolean fireLocalEvents) :482 | -runTransactionBlock: IH:FIRDatabaseReference.h:787; ...andCompletionBlock: :811; ...andCompletionBlock:withLocalEvents: :845 | RunTransaction(fn, trigger_local_events = true): Future<DataSnapshot> Ci:database_reference.h:202,234; the callback takes MutableData* and returns ... | built: runTransaction(handler, {applyLocally}); the handler receives a mutable copy of the value and returns Transaction.success(v) or Transaction.abort() | JS: the update function gets the current value or null and returns the new value; returning undefined aborts (committed=false, no error, J:core/Repo.ts:968-975); returning null deletes. C++ MutableData has set_value, set_priority, Child, children. Android and iOS: Handler.doTransaction(MutableData): Result and onComplete(DatabaseError, boolean committed, DataSnapshot) A:Transaction.java:77-111; ... |
protocol (txn.protocol) | The first run uses the local cache (repoGetLatestState, J:core/Repo.ts:965-967), applies the result locally (syncTreeApplyUserOverwrite with the user's applyLocally, ... | Connection.compareAndPut with hash h A:core/Repo.java:1116-1125 | putData:forPath:withHash: I:Core/FPersistentConnection.m | CompareAndPut(path, data, hash, response) Cd:core/repo.cc:894-927, hash from GetHash (the same SHA-1 over the canonical form). | built: hash on p, rerun on datastale | A transaction on a never-read path first runs with null, then reruns after the server answers datastale: the update function must tolerate null. (test) JCT:test/transaction.test.ts (49 cases). Android and iOS: Sent as put p with the hash of the local view; a mismatch gives status datastale (DATA_STALE, -1), the transaction goes back to RUN and re-runs on fresh server data (A:Repo.java:1174-1190) |
retries (txn.retries) | MAX_TRANSACTION_RETRIES = 25 (J:core/Repo.ts:118, check at :1277-1286) -> error message maxretry (test) JCT:test/transaction.test.ts:534. | TRANSACTION_MAX_RETRIES = 25, error maxretries A:Repo.java:850-852 | kFTransactionMaxRetries = 25 I:Constants/FConstants.m:188; error string maxretry (:189) | TransactionData::kTransactionMaxRetries = 25 (Cd:transaction_data.cc:23, check core/repo.cc:1046) -> kErrorMaxRetries. | built: 25 reruns, then max-retries | Same constant. Android and iOS: After 25 retries the transaction aborts with MAX_RETRIES (-8). The two SDKs spell the status string differently. |
abort reasons (txn.abortReasons) | Aborts: maxretry, set (a plain write hit the path while the transaction was sent; (test) transaction.test.ts:559,588), disconnect (connection dropped while sent; (test) ... | per-path queues in transactionQueueTree A:Repo.java:~870-1060 | FRepo I:Core/FRepo.m:924+ | kErrorOverriddenBySet, kErrorDisconnected, kErrorMaxRetries, kErrorTransactionAbortedByUser, plus server errors Ci:common.h. | built: mapped onto the exception codes | The three error shapes in JS (see err.shapes) include this one. Android and iOS: Transactions at the same or overlapping paths run in order; a set/update over a path aborts the transactions there with OVERRIDDEN_BY_SET (-9) (A:Repo.java:490, 628-635; I:Core/FRepo.m:361, 410) |
nesting (txn.nesting) | Transactions on nested paths are grouped in a Tree and sent as one write at the common ancestor (J:core/Repo.ts:1062-1215, treeSubTree). | per-path queues in transactionQueueTree A:Repo.java:~870-1060 | FRepo I:Core/FRepo.m:924+ | Cd:core/repo.cc mirrors Android's queue tree. | built: queue tree as upstream | The Dart port copies the queue-tree design; the alternative (one transaction at a time) changes semantics. |
update throws (txn.updateThrows) | partly: If the update function throws on the first run, runTransaction throws synchronously (no promise): the call is not wrapped (J:api/Transaction.ts:134-141, run at ... | handler exceptions are caught and abort with USER_CODE_EXCEPTION (-11), message holds the stack trace A:Repo.java:975-985, DatabaseError.java:186-192 | no @try/@catch in I:Core/FRepo.m (searched): an exception in the block propagates | partly: (inferred) exceptions escape on the scheduler thread. | built: the handler's exception fails the Future | The Dart client turns throws into a failed Future with the original error. |
local events (txn.localEvents) | applyLocally (default true) controls whether intermediate states are visible to listeners (Transaction.ts:110). | fireLocalEvents default true A:DatabaseReference.java:470-480 | withLocalEvents default YES | trigger_local_events (default true). | built: applyLocally | Same meaning. Android and iOS: When false the intermediate local result is applied invisibly (A:Repo.java:1028 visible = applyLocally) |
listener cleanup (txn.listenerCleanup) | The listener added by runTransaction is removed synchronously when the transaction commits (J:core/Repo.ts:1160), but via setTimeout(unwatcher, 0) when it aborts ... | hidden value listener at the path A:Repo.java:945-957 | FRepo startTransactionOnPath: I:Core/FRepo.m:924+ | n/a | built: the listen a transaction opens is closed after it finishes | A resource-lifetime detail; the Dart port uses a microtask, not a timer. Android and iOS: runTransaction adds a no-op value listener so the data is synced and kept updated while the transaction is pending. |
not persisted (txn.notPersisted) | — not applicable: JS has no disk cache | every transaction write is applied with persist=false A:Repo.java:1028-1029, 1135, 1272-1283, 1319-1333; one-time info log "transactions will not be persisted across ... | loggedTransactionPersistenceWarning I:Core/FRepo.m:928-934 | — not checked | built: transactions stay in memory, also with persistence on | Android and iOS never persist transactions; one pending at exit is lost and its outcome is unknown after restart. |
priority (txn.priority) | partly: the handler receives the value only (J:core/Repo.ts:967); a returned object may carry .priority (:996-1013), otherwise the current priority is kept (:1303-1310) | MutableData A:MutableData.java:62-329: hasChildren, hasChild, child, getChildrenCount, getChildren, getKey, getValue() (+Class and GenericTypeIndicator), setValue, ... | FIRMutableData IH:FIRMutableData.h:51-126: hasChildren, hasChildAtPath:, childDataByAppendingPath:, value, priority, childrenCount, children, key | MutableData::priority() and set_priority() (Ci:mutable_data.h:102,143) | built: the handler sees the value only; it may set the priority, and the current one is kept when it gives none | Android MutableData and iOS FIRMutableData expose the priority (A:MutableData.java, IH:FIRMutableData.h). |
| Feature | JS | Android | iOS | C++ | Dart | Notes |
|---|---|---|---|---|---|---|
api (od.api) | onDisconnect(ref): OnDisconnect with cancel(), remove(), set(v), setWithPriority(v, p), update(values) J:api/OnDisconnect.ts:55-199, Reference_impl.ts:564. | DatabaseReference.onDisconnect(): OnDisconnect A:DatabaseReference.java:457; OnDisconnect.setValue(Object) A:OnDisconnect.java:63; (Object, String priority) :80; ... | -onDisconnectSetValue: IH:FIRDatabaseReference.h:601; ...withCompletionBlock: :615; ...andPriority: :627; ...andPriority:withCompletionBlock: :642 | DatabaseReference::OnDisconnect(): DisconnectionHandler* with Cancel, RemoveValue, SetValue, SetValueAndPriority, UpdateChildren Ci:disconnection.h:47-137. | built: onDisconnect.set/update/remove/cancel; update throws an ArgumentError for a key that names the location itself ("", "/") and registers nothing | JS set validates the value; cancel does not call validateWritablePath (OnDisconnect.ts:72-80). Android and iOS: Registered on the server as o (A:PersistentConnectionImpl.java:246). Values are validated like writes (A:OnDisconnect.java:168); server values are allowed. |
protocol (od.protocol) | Requests o (put), om (merge), oc (cancel) (J:core/PersistentConnection.ts:471-545); buffered while disconnected and sent after reconnect (onDisconnectRequestQueue_, ... | onDisconnectRequestQueue A:PersistentConnectionImpl.java:304, 578-624, 1179-1186 | onDisconnectQueue I:Core/FPersistentConnection.m:167, 265+ | Same actions (Cd:connection/persistent_connection.cc:68-70,438-475). | built: o, om, oc, queued while offline | The server runs them when it sees the connection die, not on a clean goOffline alone (the connection is closed, so it does fire). Android and iOS: Requests made while not connected are queued and sent after reconnect; sent requests are not repeated (the server forgets them on the next socket drop) |
local simulation (od.localSimulation) | When the client detects the loss, repoRunOnDisconnectEvents applies the registered onDisconnect writes to its own cache immediately (resolving server values) and ... | same as sv.onDisconnect | same as sv.onDisconnect | Repo::RunOnDisconnectEvents (Cd:core/repo.cc:577-). | built: applied locally when the connection drops | This is why presence UIs flip locally on goOffline. |
registration (od.registration) | Registration is only remembered locally after the server answers ok (J:core/Repo.ts:720-737). A failed registration leaves no local effect. | in-memory only (onDisconnect field A:Repo.java:~80, hasOnDisconnects A:PersistentConnectionImpl.java:1466-1471) | same as Android | same (Cd:core/repo.cc:177-200, OnDisconnectResponse::MarkComplete). | built: remembered after the server's ok | Registrations are lost with the connection: they must be re-sent after reconnect, which the client does only for requests still queued; (inferred) the server drops all onDisconnect registrations when it detects the close, so apps re-register inside .info/connected handlers. Android and iOS: Not persisted on either platform: after an app restart no onDisconnect is registered. |
| Feature | JS | Android | iOS | C++ | Dart | Notes |
|---|---|---|---|---|---|---|
info (net.info) | .info/connected (boolean) and .info/serverTimeOffset (ms) are served by a separate infoSyncTree_ (J:core/Repo.ts:291-312,420-443). Initial value false (:312); the offset ... | .info/connected boolean A:core/Constants.java:24; Repo.java:736-742 | kDotInfoConnected I:Constants/FConstants.m:158; I:Core/FRepo.m:217 | Same two plus .info/authenticated (Cd:core/constants.cc:21-24, set false at start core/repo.cc:550, updated by OnAuthStatus, ... | built: onConnected, isConnected, serverTimeOffset, and the .info paths; after close() or app deletion isConnected is false and onConnected ends with done and no error | .info data is not subject to security rules and cannot be written. Android and iOS: Starts false at repo creation. Listeners on .info are served by a separate infoSyncTree with a no-op persistence manager (A:Repo.java:163-195) and do not raise an initial null event (:176-182 "we don't raise null events on initial data") |
go offline (net.goOffline) | goOffline(db) J:api/Database.ts:423-427: repoInterrupt -> persistentConnection.interrupt('repo_interrupt') (Repo.ts:836-840), closes the socket and stops reconnecting. ... | FirebaseDatabase.goOffline() A:FirebaseDatabase.java:253; static DatabaseReference.goOffline() A:DatabaseReference.java:522 | -goOffline IH:FIRDatabase.h:125; +[FIRDatabaseReference goOffline] IH:FIRDatabaseReference.h:745 | Database::GoOffline(), also DatabaseReference::GoOffline() Ci:database.h:128,132, database_reference.h:396,401. Interrupt() (Cd:connection/persistent_connection.cc:477). | built: goOffline(); get() does not wait afterwards; does nothing after close() | interrupt is reason-keyed: a server_kill reason set by the server stays until process end (U4). Android and iOS: Adds the interrupt reason repo_interrupt (A:Repo.java:63, 761-767), closes the socket and stops reconnecting. Writes still apply locally and queue; listeners keep cached data. The static Android call acts on the default DatabaseConfig only ("all connections" per Javadoc) |
go online (net.goOnline) | goOnline(db) J:api/Database.ts:440-444: resume('repo_interrupt') resets the reconnect delay to 1 s and connects (PersistentConnection.ts:919-928). | goOnline() A:FirebaseDatabase.java:245; static :536 | -goOnline IH:FIRDatabase.h:131; static :766 | GoOnline(). | built: goOnline(); does nothing after close() | The state callback for .info/connected goes true only after the handshake and auth. Android and iOS: Removes the reason and reconnects at once. |
reconnect (net.reconnect) | Delay starts at 1,000 ms (RECONNECT_MIN_DELAY, J:core/PersistentConnection.ts:45), multiplies by 1.3 per failure (:48,814-817), caps at 5 min (:46; 30 s for admin ... | RetryHelper min 1000 ms, exponent 1.3, max 30 s, jitter 0.7 A:PersistentConnectionImpl.java:344-350, connection/util/RetryHelper.java:121-124 | kPersistentConnReconnectMinDelay = 1.0, MaxDelay = 30.0, Multiplier = 1.3 I:Constants/FConstants.m:112-114; jitter 0.7 I:Core/FPersistentConnection.m:178-183 | — None: OnDisconnect calls TryScheduleReconnect() immediately (Cd:connection/persistent_connection.cc:300-322); // TODO(chkuang): Implement Exponential Backoff Retry :529; ... | built: JS curve (1 s, x1.3, full jitter) with a 30 s cap, reset on wake or on a connectivity change | The JS jitter protects the server fleet after an outage. Android and iOS: First retry after a success has delay 0 (A:RetryHelper.java:81); then min * 1.3^n capped at 30 s, randomised in [(1-0.7)d, d) (:83-97). A connection counts as successful after it was up for 30 s (SUCCESSFUL_CONNECTION_ESTABLISHED_DELAY A:PersistentConnectionImpl.java:275, 521-532; I:Constants/FConstants.m:115) or after a ... |
visibility (net.visibility) | partly: VisibilityMonitor and OnlineMonitor listen to browser events; outside a browser they stay at visible = true, online = true (J:core/util/VisibilityMonitor.ts:41-65, ... | app background -> interrupt, foreground -> resume A:android/AndroidPlatform.java:119-135 | SCNetworkReachability callback retries now I:Core/FPersistentConnection.m:606-621, 670; system clock change reconnects :633-638; foreground resets backoff :623-631 | — none. | built: OS network and wake events on the VM, replacing the browser events | On desktop JS runs with "always online, always visible" semantics: a laptop that wakes from sleep waits random(0..5 min). Android and iOS: Desktop has none of these hooks by default; network change and wake-from-sleep matter. |
keep alive (net.keepAlive) | WebSocket: send "0" after 45 s of silence in either direction (WEBSOCKET_KEEPALIVE_INTERVAL = 45000, J:realtime/WebSocketConnection.ts:45,425-435). Protocol-level p/o ... | sends "0" every 45 s of silence A:connection/WebsocketConnection.java:37, 321-332; connect timeout 30 s :38 | kWebsocketKeepaliveInterval = 45, kWebsocketConnectTimeout = 30 I:Constants/FConstants.m:108-109 | Connection::kKeepAliveTimeoutMs = 45000 (Cd:connection/connection.cc:34,199-212). | built: keep-alive plus dead-link detection by ping and pong; the emulator answers a ping at any time (measured) | No application-level timeout for requests in either SDK; C++ notes Add timeout handle (persistent_connection.cc:1039). A half-open TCP link is therefore only noticed when a write fails or the OS closes it (inferred). |
connect status events (net.connectStatusEvents) | repoOnConnectStatus updates .info/connected and, when false, simulates onDisconnect (J:core/Repo.ts:420-425). Transactions already sent fail with disconnect ... | .info/connected boolean A:core/Constants.java:24; Repo.java:736-742 | kDotInfoConnected I:Constants/FConstants.m:158; I:Core/FRepo.m:217 | Repo::OnConnect/OnDisconnect (Cd:core/repo.cc:564-575). | built: as JS; the stream ends with done and no error when the database is closed or the app deleted | — |
server kill (net.serverKill) | A shutdown control message (s) makes the client warn and interrupt with reason server_kill and never resume unless the process restarts ... | onKill(reason) A:PersistentConnectionImpl.java:539-555 | kWebsocketServerKillPacket I:Constants/FConstants.m:105; interrupt I:Core/FPersistentConnection.m:481 | OnKill -> InterruptInternal(kInterruptServerKill) (Cd:connection/persistent_connection.cc:328-336). | built: upstream behaviour, logged; goOnline() does not clear it | Used by the server to evict clients (for example a deleted database). Android and iOS: The server can end the session for good; no reconnect. An "Invalid appcheck token" kill is retried up to INVALID_TOKEN_THRESHOLD = 3 (:283, 540-546) |
idle close (net.idleClose) | — none | closes the socket after IDLE_TIMEOUT = 60 s with no listens, gets, requests, onDisconnects or puts A:PersistentConnectionImpl.java:277, 1435-1476; reason connection_idle | — none found (no idle logic in I:Core/FPersistentConnection.m) | — none (// TODO Implement Idle Check, Cd:connection/persistent_connection.cc:311) | won't do: idle_close_emulator_test.dart only measures the emulator's own 120 s idle close. | Android closes the socket after 60 s with no listens, puts, gets or onDisconnects and reconnects on demand. |
lifecycle (net.lifecycle) | partly: browser visibility only (J:core/util/VisibilityMonitor.ts) | app background/foreground listener A:android/AndroidPlatform.java:119-135 | reachability, system clock, foreground I:Core/FPersistentConnection.m:606-681 | — none | not needed: going offline when the app is backgrounded is the app's job: one goOffline() call (decisions section 26) | Android interrupts on background and resumes on foreground; iOS resets the backoff on foreground. |
info authenticated (net.infoAuthenticated) | — not present (J:core/Repo.ts:312 creates connected only) | .info/authenticated A:core/Constants.java:23; Repo.java:230, 746-749 | — not present (only connected and serverTimeOffset in I:Constants/FConstants.m:155-159) | .info/authenticated (Cd:core/constants.cc:23, core/repo.cc:550) | built: readable at .info/authenticated and tested; no typed member | Android and C++ have it; JS and iOS do not. |
| Feature | JS | Android | iOS | C++ | Dart | Notes |
|---|---|---|---|---|---|---|
enable (disk.enable) | — None. J: has no persistence code (searched for persistence, setPersistenceEnabled, keepSynced: only persistenceKey fields in RepoInfo). Offline writes live in memory and ... | FirebaseDatabase.setPersistenceEnabled(boolean) A:FirebaseDatabase.java:284 | persistenceEnabled property IH:FIRDatabase.h:148 | Database::set_persistence_enabled(bool) Ci:database.h:164; must be called before the first reference, else silently ignored (Cd:database_desktop.cc:180-185). Default off ... | built: optional, off by default, VM only; lives in the separate package firebase_database_dart_sqlite, so the client package has no native dependency; shipped in two tiers: restart-safe pending writes first, then the full offline cache; persistenceEnabled reports what was asked for until the store is open, then whether the store is durable (false when it could not be opened, when another owner holds the file, or after a storage error) | C++ is the only desktop reference for this feature. Android and iOS: Off by default. Must be set before first use (see inst.freezeSetters). Off means NoopPersistenceManager (A:core/Context.java:155-171, core/persistence/NoopPersistenceManager.java:34) and persistenceManager = nil on iOS (I:Core/FRepo.m:161) |
engine (disk.engine) | — n/a | SQLite through SQLiteOpenHelper, one database file per cache id URLEncoder(host + "_" + sessionKey) A:android/AndroidPlatform.java:159; ... | LevelDB, two databases server_data and writes plus a version file under <firebaseDir>/<sessionId>/<host>_<namespace>/ I:Core/FRepo.m:136-148; ... | LevelDB (Cd:persistence/level_db_persistence_storage_engine.cc, 885 lines) with FlatBuffers values (flatbuffer_conversions.cc, schemas in persistence/schemas/); key ... | built: synchronous SQLite on the VM; none on the web | Android and iOS use SQLite; The Dart client uses SQLite on the VM. Android and iOS: Android keys by host only, iOS by host and namespace. |
location (disk.location) | — n/a | app databases directory (Android SQLiteOpenHelper) | Documents/firebase, Caches/firebase (tvOS), ~/.firebase (macOS) I:Persistence/FLevelDBStorageEngine.m:277-291 | AppDataDir("<package_name>/<host>", create=true) (Cd:core/repo.cc:477-503); needs options.package_name. | built: the caller passes the path or file to sqlitePersistence; one cache per app name and database URL | package_name is an Android-flavoured option; the Dart client takes the cache path from the caller. |
cache size (disk.cacheSize) | — none | setPersistenceCacheSizeBytes(long) A:FirebaseDatabase.java:302 | persistenceCacheSizeBytes IH:FIRDatabase.h:163 (NSUInteger) | partly: Fixed kDefaultCacheSize = 10 * 1024 * 1024 with LRUCachePolicy (Cd:core/repo.cc:446,458); prune when over, every 1,000 server updates ... | built: cacheSizeBytes, default 10 MiB, 1 MiB to 100 MiB; applies from the second tier (the full offline cache) | The prune is per tracked query, not per byte (inferred). Android and iOS: Default 10 MB (A:core/Context.java:37; I:Api/FIRDatabaseConfig.m:46-47). Below 1 MB: "The minimum cache size must be at least 1MB"; above 100 MB: "doesn't support a cache size larger than 100MB" (A:core/DatabaseConfig.java:165-171; I:Api/FIRDatabaseConfig.m:76-83). The limit is approximate: size may exceed it until the next ... |
keep synced (disk.keepSynced) | — none | same as query.keepSynced | same as query.keepSynced | SetKeepSynchronized(bool): registers a no-op listener that keeps the query active and excluded from pruning (Cd:core/keep_synced_event_registration.cc, ... | built: as query.keepSynced; meaningful from the second tier | — |
failure modes (disk.failureModes) | — n/a | exclusive SQLite lock (PRAGMA locking_mode = EXCLUSIVE, A:android/SqlPersistenceStorageEngine.java:840-868); a second process fails with a DatabaseException that ... | partly: LevelDB lock (I:Core/FRepo.m:303-305); on an open failure it logs, deletes the database directory, retries once, then throws FirebasePersistenceFailure ... | — (1) Initialize opens LevelDB with create_if_missing and calls assert(false) on failure (Cd:persistence/level_db_persistence_storage_engine.cc:305-311): LevelDB holds an ... | built: Lease timings differ from the plan: refresh every 5 s, valid 15 s, a second instance watches 7.5 s (plan: 4 s and 5 s). After a storage error the store continues in memory; writes the server answered after that are removed from the file at close and not sent again, the others are sent at the next start. | The Dart client uses a lease and never crashes on a locked or corrupt cache. Android and iOS: One process per cache. "If you are intentionally using Firebase Database from multiple processes, you can only enable offline persistence in one of them". |
no hash on listen (disk.noHashOnListen) | JS sends the sync-tree hash with every listen (J:core/PersistentConnection.ts:289) so the server answers with only the difference. | same as query.compoundHash | same as query.compoundHash | — C++ does not: // TODO(chkuang): Support Hash and Compound Hash (Cd:connection/persistent_connection.cc:727-729), so every reconnect re-downloads every listened query in ... | built: sends the hash on every listen | With persistence, the cache is loaded, but the missing hash means the benefit is only offline reads. Dart can have both. Android and iOS: Each listen sends the hash of the cached data so the server can answer "no change". Compound hash (ch with ps paths and hs hashes) is added when the cached node is estimated larger than 1024 bytes (SIZE_THRESHOLD_FOR_COMPOUND_HASH, A:SyncTree.java:82, 126-129; ... |
schema version (disk.schemaVersion) | — | DATABASE_VERSION = 2 A:SqlPersistenceStorageEngine.java:159; onUpgrade from 1 drops serverCache, keeps writes (:174-195) | version file "1"; anything else raises NSInternalInconsistencyException I:Persistence/FLevelDBStorageEngine.m:41, 113-142; legacy outstanding_puts migration :145-210 | partly: LevelDB schema files (Cd:persistence/schemas/) | built: a schema version; a file written by a newer major version is moved aside with its pending writes (or left alone and the store runs in memory when another process uses it), and the cache starts empty; no error reaches the app | Android upgrades by dropping the server cache and keeping writes; iOS raises on an unknown version. |
clear (disk.clear) | — | — not public (purgeCache() on the engine A:SqlPersistenceStorageEngine.java:787 is unreachable from the API) | — not public (purgeEverything I:Persistence/FLevelDBStorageEngine.m:256) | — | built: Plan said later. Built in the SQLite package as clearSqlitePersistence; it accepts any spelling of the database URL the constructor accepts (trailing slash, wss, host case, port 443, emulator URL with ?ns=); the client package has no clearPersistence of its own. | Neither SDK has a public call; users delete files. |
cache scope (disk.cacheScope) | — | same as disk.engine | same as disk.engine | cache directory is <package name>/<host> (Cd:core/repo.cc:477-503), not per user | built: one cache per app name and database URL, not per signed-in user; clearSqlitePersistence (SQLite package) deletes it, call it on sign-out; partitioning per user is not decided | Android keys the cache by host and session key; iOS by host and namespace. None partitions by user. |
| Feature | JS | Android | iOS | C++ | Dart | Notes |
|---|---|---|---|---|---|---|
token (auth.token) | FirebaseAuthTokenProvider (J:core/AuthTokenProvider.ts:42-122): getToken(forceRefresh); when the Auth component is not registered yet it waits one tick then treats the ... | AndroidAuthTokenProvider.getToken(forceRefresh) A:android/AndroidAuthTokenProvider.java:47+ (InternalAuthProvider.getAccessToken); change listener addIdTokenListener :72 | FIRDatabaseConnectionContextProvider getTokenForcingRefresh: I:Login/FIRDatabaseConnectionContextProvider.m:137-182 | Calls the Auth module through the app function registry: FnAuthGetTokenAsync (Cd:connection/persistent_connection.cc:530-538); if neither Auth nor App Check is linked, ... | built: app.authProvider, one forced refresh on revoke | A token change triggers refreshAuthToken, which sends a new auth request on the live connection (J:core/PersistentConnection.ts:333-346,380-413). Android and iOS: Token sent as action auth with cred after the socket opens (A:PersistentConnectionImpl.java:1034-1090; I:Core/FPersistentConnection.m:692). "Unauthenticated usage" errors are treated as no token (A:AndroidAuthTokenProvider.java:53). A ... |
request (auth.request) | Action auth when the token looks like a JWT (isValidFormat), gauth otherwise (legacy secrets/OAuth access tokens, J:core/PersistentConnection.ts:383); body {cred, ... | partly: auth with the ID token (A:android/AndroidAuthTokenProvider.java:47+); gauth for a GAuthToken string (A:util/GAuthToken.java:30-60, ... | — auth only, no gauth (I:Login/FIRDatabaseConnectionContextProvider.m:137-182) | Always auth with {cred} (Cd:connection/persistent_connection.cc:1112-1121), unauth when cleared (:1123); no gauth, no header. | built: auth and gauth | Service-account OAuth tokens (gauth) matter for server mode. |
revoked (auth.revoked) | ac push -> onAuthRevoked_: clears the token, forces refresh and closes the connection (J:core/PersistentConnection.ts:985-1004); invalid_token or permission_denied three ... | server push ac A:PersistentConnectionImpl.java:260, 999-1005 | kFWPAsyncServerAuthRevoked I:Constants/FConstants.m:41 | HandleAuthTokenResponse (Cd:connection/persistent_connection.cc:1129-1190): same flow, threshold kInvalidAuthTokenThreshold = 3 (:93), warning text only, no delay change ... | built: as JS, with a guarded close | Android and iOS: Clears the token, forces a refresh on the next connect, closes the socket, sets .info/authenticated false. |
app check (auth.appCheck) | AppCheckTokenProvider (J:core/AppCheckTokenProvider.ts:40-88): token sent as WebSocket URL parameter ac (J:realtime/WebSocketConnection.ts:140-142, constant ... | X-Firebase-AppCheck header on the WebSocket upgrade (A:connection/WebsocketConnection.java:191); appcheck action after auth (A:PersistentConnectionImpl.java:1090-1118); ... | partly: X-Firebase-AppCheck header (I:Realtime/FWebSocketConnection.m:40,575-585); appcheck action (I:Core/FPersistentConnection.m:1424); no apc handling | partly: App Check token passed to the WebSocket client and refreshed via appcheck (Cd:connection/persistent_connection.cc:1195-1227, ... | built: app.appCheckProvider; headers on the VM, URL parameter on the web | Android and iOS: Invalid token response clears it and forces refresh; kill with "Invalid appcheck token" retried 3 times (A:PersistentConnectionImpl.java:539-555) |
token wait (auth.tokenWait) | getToken for auth and App Check run in parallel before every connection attempt (J:core/PersistentConnection.ts:861-864); an error from either is logged and ends the ... | restoreState() A:PersistentConnectionImpl.java:1156-1195 | restoreState I:Core/FPersistentConnection.m | Parallel futures, then HandleTokenFutures (Cd:connection/persistent_connection.cc:540-660). | built: auth and App Check fetched in parallel before each attempt | A broken Auth provider blocks the database from ever connecting in both SDKs. Android and iOS: After reconnect: auth, app check, then re-listen all, re-send puts in id order, send queued onDisconnects, send gets. |
| Feature | JS | Android | iOS | C++ | Dart | Notes |
|---|---|---|---|---|---|---|
connect (emu.connect) | connectDatabaseEmulator(db, host, port, {mockUserToken?}) J:api/Database.ts:350-408. Must be called before any operation; calling again with the same arguments after ... | useEmulator(String host, int port) A:FirebaseDatabase.java:315 | -useEmulatorWithHost:port: IH:FIRDatabase.h:187; I:Api/FIRDatabase.m:179-200 | — No emulator support: no emulator API, no env var, no localhost special case (a search of C:desktop, C:common, Ci: for "emulator" found nothing). (inferred) ... | built: emulatorHost: 'host:port' constructor argument; any host name, IP and port. The database URL gives only the namespace: its ?ns=, else the emulator's own rule for the URL host ('fake-server' for an IP) | The emulator talks the same WebSocket protocol (ws://host:port/.ws?ns=...&v=5). Android and iOS: Sets host host:port, internalHost the same, secure=false (A:core/RepoInfo.java:66-72). Must precede first use: Android IllegalStateException (:317-319), iOS NSInternalInconsistencyException (I:Api/FIRDatabase.m:185-190); iOS also rejects an empty host (:180-184) |
env (emu.env) | FIREBASE_DATABASE_EMULATOR_HOST (Node only): when set, the URL becomes http://<host>?ns=<namespace> (J:api/Database.ts:69,143-152); also ... | — no FIREBASE_DATABASE_EMULATOR_HOST support (searched both source trees) | — | — none. | built: FirebaseDatabase.emulatorHostFromEnvironment reads FIREBASE_DATABASE_EMULATOR_HOST (null when unset, empty or on the web) | Namespace comes from the original URL, so the env var can redirect any database URL. Android and iOS: The JS SDK reads FIREBASE_DATABASE_EMULATOR_HOST |
mock token (emu.mockToken) | mockUserToken: string or EmulatorMockTokenOptions object, turned into an unsecured JWT with createMockUserToken(options, projectId) (J:api/Database.ts:384-388); constant ... | — no mock token API | — | — none. | built: mockUserToken as a String only (JS also takes an object), only with emulatorHost | Lets tests exercise security rules with a chosen uid and claims. Android and iOS: The emulator accepts the unsigned tokens of the Auth emulator through the normal token provider. |
cloud workstation (emu.cloudWorkstation) | isCloudWorkstation(host) makes the emulator use TLS and sends a pingServer first for cookies (J:api/Database.ts:96,393-396). | — | — | — none. | built: an emulator on *.cloudworkstations.dev is reached over TLS | Rare. |
any http is emulator (emu.anyHttpIsEmulator) | isEmulator = !repoInfo.secure for any http:// URL (J:api/Database.ts:154): the handshake host check is relaxed (Connection.ts:348-350). | — | — | — n/a | won't do: the emulator is chosen explicitly | A plain-http production URL is treated as an emulator. |
| Feature | JS | Android | iOS | C++ | Dart | Notes |
|---|---|---|---|---|---|---|
readonly client (rest.readonlyClient) | ReadonlyRestClient (J:core/ReadonlyRestClient.ts, 254 lines) replaces the WebSocket only when the user agent matches a crawler (beingCrawled, ... | — same as query.restParams | — same as query.restParams | — none. | won't do: left out on purpose for this version | get over REST resolves null for a missing node and rejects with new Error(undefined) on other failures (:148-171, U6). |
query params (rest.queryParams) | orderBy, startAt, startAfter, endAt, endBefore, limitToFirst, limitToLast values are JSON-encoded; start/end with a key append ,"<key>" ... | — | — | — none. | won't do: left out with the REST client | format=export includes priorities. |
writes (rest.writes) | — not in the SDK (the public REST API has PUT/PATCH/POST/DELETE). | — same as query.restParams | — same as query.restParams | — none. | won't do: left out with the REST client | Out of scope of both SDKs; documented in the Firebase REST reference only. |
streaming (rest.streaming) | — not in the SDK (REST streaming uses server-sent events). | — same as query.restParams | — same as query.restParams | — none. | won't do: server-sent events are not part of any official client | — |
| Feature | JS | Android | iOS | C++ | Dart | Notes |
|---|---|---|---|---|---|---|
enable (log.enable) | enableLogging(enabled, persistent?) and enableLogging(logger: (msg) => unknown) J:api/Database.ts:453-467, impl J:core/util/util.ts:98-117: true logs everything at ... | FirebaseDatabase.setLogLevel(Logger.Level) A:FirebaseDatabase.java:266; levels DEBUG, INFO, WARN, ERROR, NONE A:Logger.java:22-27, default INFO | +[FIRDatabase setLoggingEnabled:] (BOOL) IH:FIRDatabase.h:178; I:Utilities/FUtilities.m (setLoggingEnabled) | Database::set_log_level(LogLevel) / log_level() Ci:database.h:176-181, per instance, combined with the App log level. | built: logger: constructor argument, per instance | Global (JS) versus per instance (C++). Log lines carry connection ids (p:<id>:, c:<id>:) (PersistentConnection.ts:92, Connection.ts:109). Android and iOS: iOS has only on/off through FFLog/FFDebug macros with stable ids (I-RDB034045) |
diagnostics (log.diagnostics) | repoStats(repo, showDelta) (J:core/Repo.ts:848-877) and StatsCollection counters (bytes_sent, bytes_received); FIREBASE FATAL ERROR:, FIREBASE WARNING:, FIREBASE ... | DatabaseConfig.setDebugLogComponents(List<String>) (hidden, forces DEBUG) A:DatabaseConfig.java:98-103; loggers per component RepoOperation, Transaction, DataOperation, ... | partly | — LogDebug lines for every request. | n/a: Not planned in the plan either. | fatal throws Error (used for misuse such as deleted database). |
telemetry (log.telemetry) | The client reports usage counters to the server: sdk.<js, node or admin_node>.<version> on first connect (J:core/PersistentConnection.ts:1074-1094), and periodic s stats ... | getSdkVersion() A:FirebaseDatabase.java:326 | +sdkVersion IH:FIRDatabase.h:181 | partly: User-Agent Firebase/<wire>/<version>/<sdk>/<os> and sdk.cpp.<version>-<os> (Cd:connection/host_info.cc:36-55); version string is the placeholder Firebase Realtime ... | n/a: Nothing is sent; there is nothing to build or test. | They have no functional effect and cost privacy; the server tolerates their absence (inferred). Android and iOS: Sent in the user agent. |
security debug (log.securityDebug) | sd push: prints FIREBASE: <msg> (security-rules debug) or calls a registered callback (J:core/PersistentConnection.ts:1023-1033). | server push sd logged at INFO A:PersistentConnectionImpl.java:263, 1017-1030 | kFWPAsyncServerSecurityDebug I:Constants/FConstants.m:43 | sd handled at Cd:connection/persistent_connection.cc:83,883 (what it does with the text was not read). | built: routed to the logger; no token, value or query bound value in a message (a failed get logs the query shape only) | Useful with the emulator's rules debug output. Android and iOS: Rules evaluation traces for debugging permission errors. |
| Feature | JS | Android | iOS | C++ | Dart | Notes |
|---|---|---|---|---|---|---|
shapes (err.shapes) | Three shapes: (a) writes and onDisconnect: Error("<STATUS>: <reason>") with .code = STATUS upper-case (J:core/Repo.ts:892-917); (b) listener cancel: Error("<status> at ... | DatabaseError with an int code and a message (A:DatabaseError.java:32-123); get() fails with a plain Exception (A:PersistentConnectionImpl.java:420) | NSError with three mapped codes (I:Utilities/FUtilities.m:252-292); get() fails with code 1 in kFirebaseCoreErrorDomain (I:Core/FRepo.m:575-583) | Error enum (17 values) and GetErrorMessage Ci:common.h:25-70; errors come back through the future, never as exceptions. | built: one FirebaseDatabaseException with a kebab-case code and the raw serverStatus string | (test) transaction messages maxretry, set, disconnect (JCT:test/transaction.test.ts:534,559,588,804). Android and iOS: iOS carries the server reason in the description and has no error enum. |
codes (err.codes) | Server statuses seen in code: ok, permission_denied, datastale, too_big, unavailable, invalid_token, disconnect (client made), maxretry, set, nodata, plus rest_error:<n>. | DatabaseError int constants DATA_STALE -1, OPERATION_FAILED -2, PERMISSION_DENIED -3, DISCONNECTED -4, EXPIRED_TOKEN -6, INVALID_TOKEN -7, MAX_RETRIES -8, ... | partly: NSError domain com.firebase; only three mapped codes: permission_denied 1, unavailable 2, write_canceled 3, everything else 9999 I:Utilities/FUtilities.m:252-292; ... | kErrorDisconnected, kErrorExpiredToken, kErrorInvalidToken, kErrorMaxRetries, kErrorNetworkError, kErrorOperationFailed, kErrorOverriddenBySet, kErrorPermissionDenied, ... | built: 13 public kebab-case codes (permission-denied, disconnected, max-retries, overridden-by-set, unavailable, network-error, write-canceled, index-not-defined, operation-failed, too-big, database-closed, data-stale, unknown); no expired-token or invalid-token code (decisions 25 row 9); user-code-exception is internal | The C++ enum is the best starting point for a Dart enum, adding tooBig, dataStale. |
validation messages (err.validationMessages) | Messages in J:core/util/validation.ts and Reference_impl.ts name the offending argument and path. Several are inexact (U10). | DatabaseException, IllegalArgumentException, IllegalStateException, NullPointerException thrown synchronously (A:DatabaseException.java) | NSException raised (InvalidFirebaseData, InvalidKeyValidation, FIRDatabaseAlreadyInUse ...) I:Utilities/FValidation.m | — Warnings in the log; invalid objects returned. | built: correct messages, named argument and path | — |
misuse fatal (err.misuseFatal) | fatal(...) throws Error('FIREBASE FATAL ERROR: ...') for: deleted database, double init, emulator reconfiguration, bad URL (J:core/util/util.ts:147-151). | DatabaseException, IllegalArgumentException and IllegalStateException thrown synchronously (A:DatabaseException.java); an exception inside the run loop crashes the app ... | NSException raised (I:Utilities/FValidation.m) | partly: assert and log errors (Cd:persistence/level_db_persistence_storage_engine.cc:310). | built: ArgumentError or StateError at the call | — |
| Feature | JS | Android | iOS | C++ | Dart | Notes |
|---|---|---|---|---|---|---|
model (thread.model) | Single threaded: everything runs on the JS event loop; writes raise listener callbacks synchronously in the caller's stack (J:core/Repo.ts:564-593); server messages run ... | single-thread ScheduledThreadPoolExecutor (threadsInPool = 1) A:core/utilities/DefaultRunLoop.java:66; all repo state is touched only there (repo.scheduleNow) | shared serial dispatch queue [FIRDatabaseQuery sharedQueue] I:Core/FRepo.m:102 | One process-wide scheduler thread (Repo::s_scheduler_, Cd:core/repo.cc:56-58) runs the repo, the connection state machine and listener callbacks; the WebSocket has its ... | built, no test of its own: Design property; no test of its own. | Listener callbacks run on a worker thread, not the caller's: user code needs its own locking, and a listener being removed may still be running (comment in Cd:core/event_registration.cc:23-35). Android and iOS: A single-threaded core means no locks in the sync tree. |
callback safety (thread.callbackSafety) | User callback exceptions are caught and rethrown asynchronously, with the stack logged (exceptionGuard, J:core/util/util.ts:538-552), so one bad listener does not ... | partly: unhandled run-loop exceptions are rethrown on the main thread and the executor is shut down, which crashes the app (A:android/AndroidPlatform.java:79-107); a transaction ... | an exception in a user block propagates; no @try/@catch in I:Core/FRepo.m (searched) | partly: (inferred) an exception escaping a listener would unwind the scheduler thread. | built: a throwing listener reaches the zone's error handler and never corrupts state | — |
futures (thread.futures) | Promises; Deferred.wrapCallback bridges node-style callbacks (@firebase/util). | Google Play Task<T> for setValue, get, updateChildren, removeValue | completion blocks only | firebase::Future<T> with LastResult accessors (SetValueLastResult, RunTransactionLastResult, ...). | built: Future and Stream | — |
reentrancy (thread.reentrancy) | EventQueue.recursionDepth_ guards raising events while raising (J:core/view/EventQueue.ts:120-140); a listener may write inside its callback and events queue behind. | callbacks run through EventTarget: main-looper Handler on Android A:android/AndroidEventTarget.java:20-45; ThreadPoolEventTarget otherwise ... | callbackQueue, default main, settable before use IH:FIRDatabase.h:171; I:Api/FIRDatabaseConfig.m:44 | Not read. | built: no listener runs inside the call that caused it; pausing one subscription buffers its events and drops nothing | Callbacks see consistent state, and a write made inside a callback queues behind it. |
callback target (thread.callbackTarget) | — none: callbacks run on the event loop | same as thread.reentrancy | same as thread.reentrancy | — none: callbacks run on the repo's scheduler thread (Cd:core/repo.cc:554-562) | won't do: delivery is on the event loop; there is nothing to set | Android has an EventTarget and iOS a callbackQueue, both settable before first use. |
| Feature | JS | Android | iOS | C++ | Dart | Notes |
|---|---|---|---|---|---|---|
wire (plat.wire) | Protocol version '5' (J:realtime/Constants.ts:18); WebSocket URL wss://<host>/.ws?v=5[&ls=<lastSessionId>][&ac=<appcheck>][&p=<appId>][&ns=<ns>] ... | own websocket tubesock/ (8 files) A:tubesock/; SSL session cache and SSLCertificateSocketFactory A:tubesock/WebSocket.java:303-316; hostname verifier at :309 | SocketRocket fork FSRWebSocket I:third_party/SocketRocket/ | Same version (kWireProtocolVersion), URL wss://host/.ws?ns=..&v=5[&ls=..] (Cd:connection/host_info.cc:73-80), kMaxFrameSize = 16384 (connection.cc:36), also receives rm ... | built: protocol 5 over WebSocket | Session continuity: the ls parameter lets the server resume the session id (Connection.ts:120-127). Android and iOS: Messages larger than 16384 characters are split into frames; the first frame is a frame count when more than one (A:connection/WebsocketConnection.java:39, 235, 279-292; I:Constants/FConstants.m:107) |
handshake (plat.handshake) | Server hello {ts, v, h, s}: timestamp (becomes serverTimeOffset), version (mismatch only warns), host (redirect), session id (J:realtime/Connection.ts:383-405). Control ... | Connection.onHandshake reads ts, h (host), s (session id) A:connection/Connection.java:60-65, 205-230 | kFWPAsyncServerHello* I:Constants/FConstants.m:60-64 | Same in Cd:connection/connection.cc. | built: as JS | — |
transports (plat.transports) | WebSocket, plus long polling in browsers only (BrowserPollConnection.ts, 747 lines; TransportManager picks, with upgrade and a "previous websocket failure" flag in ... | same as plat.wire | same as plat.wire | WebSocket only, over libcurl (CURLOPT_CONNECT_ONLY = 2, Cd:connection/web_socket_client_impl.cc:324-327), inbound message cap kMaxMessagePayloadBytes = 256 MiB (:53), a ... | won't do: no long polling; WebSocket only; the proxy is read from the environment | The Dart client has no long polling, like C++. (inferred) corporate proxies that block WebSockets are the case long polling served. |
node socket (plat.nodeSocket) | Node: ws package with headers User-Agent: Firebase/5/<version>/<platform>/Node, X-Firebase-GMPID: <appId>, Authorization: Bearer, X-Firebase-AppCheck, and proxy from ... | partly: own WebSocket (tubesock); proxy handling not read | partly: proxy handling not read | partly: libcurl handles proxies through its own environment variables (inferred). | built: proxy read from the environment (HTTPS_PROXY, NO_PROXY), no option in the API; headers on the VM | The Dart client passes a proxy setting to HttpClient (findProxy) and WebSocket.connect. |
healthy timeout (plat.healthyTimeout) | A WebSocket must be "healthy" (2 responses) within 30 s or the client closes it, unless 100 KiB were received or 10 KiB sent ... | partly: connect timeout 30 s (A:connection/WebsocketConnection.java:38) | partly: kWebsocketConnectTimeout = 30 (I:Constants/FConstants.m:108-109) | — none (inferred). | built: close a connection that is not healthy in 30 s | — |
push id algorithm (plat.pushIdAlgorithm) | See write.push. Also successor(key) / predecessor(key) in the same file, used to turn startAfter/endBefore into inclusive bounds (J:core/util/NextPushId.ts:100-178, max ... | push() A:DatabaseReference.java:117; PushIdGenerator.generatePushChildName(serverTime) A:core/utilities/PushIdGenerator.java:40-66 | -childByAutoId IH:FIRDatabaseReference.h:65; I:Utilities/FNextPushId.m | PushChildNameGenerator Cd:push_child_name_generator.cc (mutex-protected, per database). | built: server time, byte-identical ids | — |
spec vectors (plat.specVectors) | JT:test/helpers/syncPointSpec.json (8,446 lines, 112 specs of the form {name, steps}) drives JT:test/syncpoint.test.ts:19-28; no emulator needed. | src/test/resources/syncPointSpec.json, 8,203 lines, 108 specs | Tests/Resources/syncPointSpec.json, the same 108 specs | CT:core/sync_point_spec.json (8,205 lines, 108 test_cases) driven by sync_point_spec_test.cc (856 lines). | built: the sync-point specs run as unit tests | All four are portable, emulator-free conformance suites for the optimistic layer (listen, write, ack, merge, tag, event order). Not identical (112 vs 108) (inferred) different revisions of one origin. |
compat (plat.compat) | @firebase/database-compat (the namespaced firebase.database() API) is a thin layer: Reference.on/off/once/set/update/push/transaction/onDisconnect, ... | — | — | — n/a | won't do: the namespaced API with callbacks and context arguments; Dart has streams and futures | JCT: holds the behavioural tests (321 it cases: query 166, transaction 49, database 35, order 19, order_by 15, promise 14, datasnapshot 13, info 5, servervalues 5). Reuse them as a checklist; all need a database. |
types (plat.types) | database-types package: v8 .d.ts only (index.d.ts, 176 lines). | — | — | — n/a | n/a: TypeScript declarations only | No behaviour. |
typed converters (plat.typedConverters) | — none | POJO mapper CustomClassMapper A:core/utilities/encoding/CustomClassMapper.java:60+; annotations @Exclude, @PropertyName, @IgnoreExtraProperties, @ThrowOnExtraProperties; ... | none (Swift Codable only) | — Variant, no mapper | won't do: Plan: later. Now recorded as left out for 0.1. | Android has a POJO mapper and annotations; iOS has Codable. |
language sugar (plat.languageSugar) | — | DataSnapshot.getValue<T>(), MutableData.getValue<T>(), Query.snapshots, Query.childEvents, Query.values<T>(), sealed ChildEvent A:Database.kt:51-131, ChildEvent.kt:23-62 | yes | — | n/a: Dart streams and futures are the native form | Android ships Kotlin Flow wrappers and typed getValue<T>(). |
force transport (plat.forceTransport) | forceWebSockets() and forceLongPolling() (J:api/Database.ts:298-312) | — | — | — | n/a: there is one transport, WebSocket | Android and iOS have one transport, WebSocket. |
| Feature | JS | Android | iOS | C++ | Dart | Notes |
|---|---|---|---|---|---|---|
Query.onChildEvents (dart.onChildEvents) | — not in the JS SDK | — not in the Android SDK | — not in the iOS SDK | — not in the C++ SDK | built: one stream of all child events in order (decisions 25 row 8) | one stream of all child events in order (decisions 25 row 8) |
cacheServerData: false (pending writes only on disk) (dart.cacheServerData) | — not in the JS SDK | — not in the Android SDK | — not in the iOS SDK | — not in the C++ SDK | built: the first tier of persistence as an option | the first tier of persistence as an option |
mockUserTokenFor (dart.mockUserTokenFor) | — not in the JS SDK | — not in the Android SDK | — not in the iOS SDK | — not in the C++ SDK | built: builds an emulator user token | builds an emulator user token |
fake server for tests (dart.fakeServer) | — not in the JS SDK | — not in the Android SDK | — not in the iOS SDK | — not in the C++ SDK | built: FakeDatabaseServer, databaseWithFakeServer, fakePersistence in package:firebase_database_dart/testing.dart; the fake answers writes in send order and throws on an answer out of order unless the test passes outOfOrder: true | FakeDatabaseServer, databaseWithFakeServer, fakePersistence in package:firebase_database_dart/testing.dart |
estimatedServerTime (dart.estimatedServerTime) | — not in the JS SDK | — not in the Android SDK | — not in the iOS SDK | — not in the C++ SDK | built: device time corrected by serverTimeOffset | device time corrected by serverTimeOffset |
persistenceEnabled (dart.persistenceEnabled) | — not in the JS SDK | — not in the Android SDK | — not in the iOS SDK | — not in the C++ SDK | built: false when persistence was not asked for, the store could not be opened, another owner holds the cache file, or the store later failed; a degraded store does not resend writes already answered | whether writes survive a restart; false when memory-only |
databaseUrl getter (dart.databaseUrl) | — not in the JS SDK | — not in the Android SDK | — not in the iOS SDK | — not in the C++ SDK | built: normalised URL used as the cache key: https://<host>[?ns=], or http://<emulatorHost>?ns=<namespace> for the emulator, whatever host the databaseUrl argument names | the resolved URL of the instance |
Transaction.success / Transaction.abort (dart.transactionAbortResult) | — not in the JS SDK | — not in the Android SDK | — not in the iOS SDK | — not in the C++ SDK | built: typed handler result so null is a valid value (decisions 25 row 16) | typed handler result so null is a valid value (decisions 25 row 16) |
clock and random constructor arguments (dart.clockRandom) | — not in the JS SDK | — not in the Android SDK | — not in the iOS SDK | — not in the C++ SDK | built: inject time and randomness (visibleForTesting) | inject time and randomness (visibleForTesting) |
storage_engine.dart (dart.storageEngine) | — not in the JS SDK | — not in the Android SDK | — not in the iOS SDK | — not in the C++ SDK | built: public interface for disk engines; SQLite is one implementation | public interface for disk engines; SQLite is one implementation |
FlutterFire adapter package (dart.platformAdapter) | — not in the JS SDK | — not in the Android SDK | — not in the iOS SDK | — not in the C++ SDK | built: keeps package:firebase_database API (setPersistenceEnabled, useDatabaseEmulator, setLoggingEnabled ...) over this client; a kept instance is never replaced, and use after the app was recreated with other options throws a StateError | keeps package:firebase_database API (setPersistenceEnabled, useDatabaseEmulator, setLoggingEnabled ...) over this client |
sqlitePersistence(directory, {cacheSizeBytes, cacheServerData}) (dart.sqlitePersistence) | — not in the JS SDK | — not in the Android SDK | — not in the iOS SDK | — not in the C++ SDK | built: SQLite disk cache with a lease-owned single writer; a second or degraded store runs memory only and does not resend writes already answered; clearSqlitePersistence accepts any spelling of the database URL | SQLite disk cache with a lease-owned single writer |
17 rows. These are decided and are not counted as gaps.
| Feature | Reason | Where it is recorded |
|---|---|---|
single repo (inst.singleRepo) | not in the client (two instances are two connections); the adapter keeps one instance per app and database, never replaces it, and throws a StateError when the app is recreated under the same name with other options | No instance cache in firebase_database/firebase_database_dart/lib/src/api/firebase_database.dart; the adapter keeps one instance per app name and database: firebase_database/firebase_database_dart_platform/lib/src/firebase_database.dart:167-192 (forApp) |
options auth override (inst.options.authOverride) | an admin-only authentication path, not in 0.1 (decisions section 26); mockUserToken is the emulator-only equivalent | decisions section 26 (admin-only authentication paths) |
node admin (inst.nodeAdmin) | Node admin path; a service-account client is a different product | decisions section 26 (admin-only authentication paths) |
freeze setters (inst.freezeSetters) | configuration is constructor arguments (no setters) | decisions section 25 row 10: configuration is constructor only |
remove all (listen.removeAll) | cancel each subscription; there is no registry of handles to clear | no handle registry; decisions section 8 |
rest params (query.restParams) | left out with the REST client | docs/database_decisions.md section 20 |
idle close (net.idleClose) | idle_close_emulator_test.dart only measures the emulator's own 120 s idle close. | decisions section 26 (idle disconnect not in 0.1) |
lifecycle (net.lifecycle) | going offline when the app is backgrounded is the app's job: one goOffline() call (decisions section 26) | decisions section 26 (no hook that goes offline when backgrounded) |
any http is emulator (emu.anyHttpIsEmulator) | the emulator is chosen explicitly | docs/database_decisions.md section 25 row 11; firebase_database/firebase_database_dart/lib/src/realtime/realtime_target.dart:34 (plain text refused); firebase_database/firebase_database_dart/lib/src/realtime/database_url.dart:60 (http/ws refused without emulatorHost) |
readonly client (rest.readonlyClient) | left out on purpose for this version | docs/database_decisions.md section 20 (REST is not in this version); lib/src/realtime/rest_client.dart does not exist |
query params (rest.queryParams) | left out with the REST client | docs/database_decisions.md section 20 |
writes (rest.writes) | left out with the REST client | docs/database_decisions.md section 20 (REST is not in this version) |
streaming (rest.streaming) | server-sent events are not part of any official client | decisions section 20 (no streaming) |
callback target (thread.callbackTarget) | delivery is on the event loop; there is nothing to set | decisions section 8 |
transports (plat.transports) | no long polling; WebSocket only; the proxy is read from the environment | decisions section 21 (no long polling); section 25 row 21 |
compat (plat.compat) | the namespaced API with callbacks and context arguments; Dart has streams and futures | decisions section 26 (compat API) |
typed converters (plat.typedConverters) | Plan: later. Now recorded as left out for 0.1. | decisions section 26 (typed converters; Dart 3 patterns on the typed value) |
6 rows that belong to another language or runtime.
| Feature | Reason | Where it is recorded |
|---|---|---|
in flight limit (write.inFlightLimit) | Not a protocol limit. | a C++ API restriction |
diagnostics (log.diagnostics) | Not planned in the plan either. | JS counters for debugging that SDK |
telemetry (log.telemetry) | Nothing is sent; there is nothing to build or test. | no telemetry code in lib/ (rg found none) |
types (plat.types) | TypeScript declarations only | TypeScript declarations only |
language sugar (plat.languageSugar) | Dart streams and futures are the native form | Dart streams and futures are the native form |
force transport (plat.forceTransport) | there is one transport, WebSocket | one transport |
1 rows.
| Feature | What is built | Code |
|---|---|---|
model (thread.model) | Design property; no test of its own. | single isolate by construction; decisions section 8 |
This document compares the public API and the behaviour of the Remote Config clients of four official SDKs with firebase_remote_config_dart (firebase_remote_config/firebase_remote_config_dart), feature by feature:
Read from docs/remote_config_parity.md on origin/main at 9122437c.
packages/remote-config of firebase-js-sdk at a086865. It is the reference for the protocol.firebase-config of firebase-android-sdk at 2cfdd03. It is the reference for throttling, activation, value conversion and realtime.FirebaseRemoteConfig of firebase-ios-sdk at cef246f.remote_config of firebase-cpp-sdk at 09d2e7a. Its desktop code (CD:) speaks REST itself; the mobile wrappers delegate to the native SDKs.firebase_remote_config_dart 0.1.0 and the FirebaseRemoteConfig it describes. The Dart column states the behaviour of the package; it was checked against the code. To read a row quickly, start with the Dart and Notes columns.The four SDKs were read as source clones on 2026-11-27, from GitHub only; their code was read, not run. Line numbers will drift. The Installations client that Remote Config depends on has its own document: installations_parity.md. The reasons for each departure from upstream, the alternative that was rejected and the test that pins it are in remote_config_decisions.md; the notes below name them as D1 to D14.
The Status column compares the Dart behaviour with the SDK named in the cell, or with all of them when it names none:
Path shorthand:
J: is JS packages/remote-config/src, and JU: is packages/util/src.A: is Android firebase-config/src/main/java/com/google/firebase/remoteconfig, and AI: is A:internal.I: is iOS FirebaseRemoteConfig/Sources, and IH: is its public FIRRemoteConfig.h.C: is C++ remote_config/src, CH: is its public header and CD: is C:desktop.Same: Dart has it as the official SDKs do. Different: Dart has it, in another shape or with other behaviour. Missing: a gap Dart could close. Won't do: will not be done, is not needed, makes no sense in Dart or does not apply to it; none of it is a gap. The Status column keeps the doc's wording, including the SDK named in brackets, for example “same (Android)”.
97 feature rows in 11 groups.
| Status | Rows |
|---|---|
| same | 51 |
| different | 38 |
| missing | 0 |
| won't do | 8 |
The C++ SDK's desktop Remote Config sends a new random installation id and a random token with every fetch (CD:rest.cc:77-105) and has no realtime updates. FlutterFire's firebase_remote_config says that realtime updates "are not yet supported on Windows and other desktop platforms". The JS SDK runs only in a browser. firebase_remote_config_dart is a Remote Config client for the Dart VM (macOS, Windows, Linux) and the web (dart2js, dart2wasm), with a real, persisted installation from [firebase_installations_dart](installations_parity.md), realtime updates and no Flutter dependency.
| Feature | JS | Android | iOS | C++ | Dart | Status | Notes |
|---|---|---|---|---|---|---|---|
| Get an instance | getRemoteConfig(app) J:api.ts:50-88 | getInstance(app) A:FirebaseRemoteConfig.java:80-88 | remoteConfigWithApp: IH:228 | GetInstance(App*) CH:548 | FirebaseRemoteConfig(app, installations:, ...) | different | No instance cache, no global state; two instances are two clients. The FirebaseInstallations is passed in. |
| Namespace | templateId, default firebase (deprecated) J:register.ts:84 | fixed firebase | private API for other namespaces | fixed firebase CD:remote_config_desktop.cc:44 | fixed firebase | won't do | JS deprecated its option; FlutterFire has none. |
| Required options | projectId, apiKey, appId J:register.ts:72-81 | apiKey, appId; project number from the app id AI:ConfigFetchHttpClient.java:136-142 | projectID, googleAppID, APIKey, GCMSenderID I:RCNConfigFetch.m:670 | project_id, app_id, api_key CD:rest.cc:52-55 | projectId, apiKey and appId of the FirebaseApp; a missing one throws invalid-app-config at construction. Realtime needs the project number: the second field of the app id when it is all digits, else messagingSenderId | same (JS) | A subscriber to onConfigUpdated gets stream-error naming the missing option. |
| Settings | mutable rc.settings J:remote_config.ts:53-56 | builder and setConfigSettingsAsync A:FirebaseRemoteConfigSettings.java:57-126 | configSettings I:FIRRemoteConfig.m:702-737 | SetConfigSettings CH:375-380 | minimumFetchInterval and fetchTimeout constructor arguments, immutable; each fetch can override both | different | A constructor makes the order of setting and reading irrelevant. The FlutterFire adapter provides the setters. |
| Fetch timeout | 60 s, one deadline including retries J:api.ts:152-169 | 60 s as connect and read timeouts | 60 s I:RCNConfigFetch.m:694-695 | 30 s in code, 60 s in the doc CH:150, CH:192 | 60 s, one deadline for the whole call, Installations included; fetch-timeout | same (JS) | |
| Minimum fetch interval | 12 h J:remote_config.ts:33 | 12 h, per-call fetch(long) A:FirebaseRemoteConfig.java:328-334 | 12 h, per-call fetchWithExpirationDuration: IH:291 | 12 h, Fetch(seconds) CH:298 | 12 h; fetch({minimumFetchInterval}) per call | same (Android) | Duration.zero always sends a request but never bypasses the throttle. |
| Interval check at equality | inclusive J:client/caching_client.ts:51-93 | exclusive AI:ConfigFetchHandler.java:297-309 | strict > I:RCNConfigSettings.m:515-521 | < CD:remote_config_desktop.cc:713-726 | a cached answer only while now - lastSuccessfulFetchTime < interval | same (Android) | The upstream cells differ at equality (inclusive, exclusive, strict); Dart takes Android's reading. |
| A cached answer | no | no on a cache hit (an early return); the time moves on any request that reached the server AI:ConfigFetchHandler.java:238-241,284-290 | no I:RCNConfigSettings.m:264-266 | stamps on NO_CHANGE CD:rest.cc:182 | the time moves only on a fetch that reached the server | same (JS, iOS) | |
| Settings persisted | no | yes (SharedPreferences) | no | no | no | same (JS, iOS, C++) | Settings are code configuration. |
ensureInitialized | memoized storage load J:api.ts:137-145 | loads the caches and warms Installations A:FirebaseRemoteConfig.java:207-222 | waits for the database, 30 s I:FIRRemoteConfig.m:215-233 | completes at once CD:remote_config_desktop.cc:113-120 | Future<void> ensureInitialized(), started by the constructor; fails only with a store configuration failure; isInitialized; FirebaseRemoteConfig.create(...) returns the instance once it has completed | same (JS) | Reads before it completes answer from defaults and static values, as JS does; create avoids that window. |
| State before the first fetch | no-fetch-yet, time -1 | NO_FETCH_YET, -1 | NoFetchYet, time 1970 I:FIRRemoteConfig.m:583-590 | Success, time 0 CD:metadata.cc:32-33 | RemoteConfigFetchStatus.noFetchYet, lastSuccessfulFetchTime == null | different | No sentinel value is copied. |
close() | none | none | none | the destructor joins the save thread | close(): idempotent (a second call returns the same future), ends onConfigUpdated, aborts the stream and any request; async calls in flight fail with remote-config-closed, later async calls throw a StateError, reads keep answering from memory; isClosed reports it, also for a deleted app before its onDeleteApp event; does not close the FirebaseInstallations; runs by itself when the app is deleted | different | Required by the house rule that every client has a close(). |
reset() | none | clears the activated, fetched and default caches and the SharedPreferences A:FirebaseRemoteConfig.java:549-561 | none | none | Future<void> reset() (Unreleased): clears the fetched and active records, meta (so info) and the throttle, in memory and in the store; waits for a fetch in flight, and fetches and activates called meanwhile wait for it; storage-error on a store failure, memory unchanged | different (Android) | Defaults are constructor arguments and stay; custom signals and the realtime backoff stay too, so a reset loop cannot skip the server's waits. An open realtime stream stays open; its next connect sends version 0. onActivated does not emit; onRolloutsStateChanged emits an empty set if rollouts were active. |
isSupported, initialFetchResponse | browser and SSR only J:api2.ts:57-68 | none | none | none | none | won't do | Browser and SSR concepts. On the web a failing IndexedDB is a storage-error. |
| Developer mode, device-context bypass | none | none | bypass on app, OS or locale change I:RCNDevice.m:223-244 | dead setting CD:rest.h:58 | none | won't do | A desktop program has no stable app version; Duration.zero does the job. |
| Feature | JS | Android | iOS | C++ | Dart | Status | Notes |
|---|---|---|---|---|---|---|---|
fetch | J:api.ts:152-193 | A:FirebaseRemoteConfig.java:300-334 | IH:259 | Fetch() CD:remote_config_desktop.cc:702-755 | Future<FetchResult> fetch(...): updated, unchanged or cached | different | The 12 h cache answers silently in every SDK; the result names it (D1). Fetched values stay inactive until activate. |
Order inside fetch | — | — | — | — | closed check, wait for initialization, cache check, throttle check, getIdAndToken(), request | same (Android) | A throttled call sends nothing, Installations included. |
ETag and If-None-Match | the etag or * J:client/rest_client.ts:92 | the last etag AI:ConfigFetchHttpClient.java:246 | only with a fetched config I:RCNConfigFetch.m:725-728 | constants unused CD:rest.h:63-64 | sent only when an ETag is stored, the stale generation is 0 and meta.fid equals the FID of the request (the generation is read after the installation id is known); the value is fetched.etag ?? active.etag, chosen per field | same (Android) | The server sends an ETag only on gzip-compressed answers; IOClient and browsers ask for gzip, and the client never sets Accept-Encoding. An ETag is kept only without control characters and at most 1024 bytes. |
| Stale generation | none | none | none | none | staleGeneration counter: raised by setCustomSignals and by an installation id change from a stored FID to a different one (the first FID does not count; a meta record with no fid but a successful fetch counts as different); the next fetch skips the cache and sends no If-None-Match | different | Without it a fetch right after setCustomSignals would return the old template from the cache (D5). |
| No-change handling | 304 or state: NO_CHANGE; NO_TEMPLATE and EMPTY_CONFIG give an empty config J:client/rest_client.ts:169-189 | only 200; NO_CHANGE means no update AI:ConfigFetchHttpClient.java:402-410 | UPDATE, NO_CHANGE, EMPTY_CONFIG, NO_TEMPLATE I:RCNConfigContent.m:259-298 | the same states CD:rest.cc:163-180 | UPDATE or no state stores the record; NO_TEMPLATE and EMPTY_CONFIG store an empty record, keeping the template version and ETag when the server sends them, and are activated; NO_CHANGE, INSTANCE_STATE_UNSPECIFIED and HTTP 304 refresh the fetch time and give unchanged | same (Android, iOS) | JS never activates an empty template (J:api.ts:104-110). |
activate | false unless the stored response has config, etag and version and a different etag J:api.ts:98-128 | compares fetch times; clears the fetched store A:FirebaseRemoteConfig.java:252-277 | etag update time against apply time I:FIRRemoteConfig.m:428-438 | fetched.timestamp > active.timestamp CD:remote_config_desktop.cc:662-672 | Future<bool> activate(): one atomic update of the active record, which refuses the fetched record only when both records have a version and the fetched one is lower, or when the active one has the same fetch time; a NO_TEMPLATE or EMPTY_CONFIG record without a version always replaces; the pick between memory and store is by version, then fetch time; true only if it wrote the fetched record; the active record is kept only if its fetch time is not in the future and it was fetched at most 24 h before the fetched record, so a tampered version blocks activate for at most 24 h | different | As-built A14, A21, A35. The fetched write keeps a record another instance stored during the request only if it is newer, so a tampered huge version cannot block later fetches. The fetched record is not removed (a repeated activate returns false), because another instance's newer fetch could otherwise be deleted. |
fetchAndActivate | fetch, then activate J:api2.ts:39-45 | the same A:FirebaseRemoteConfig.java:239-241 | activates even on a cache hit I:FIRRemoteConfig.m:371-404 | skips activation on a cache hit CD:remote_config_desktop.cc:140-199 | Future<bool>: the result of activate() after any successful fetch, cached and unchanged included | same (JS, Android) | |
| Concurrent fetches | not serialized | not serialized | returns the last status I:RCNConfigFetch.m:159-174 | reports success without fetching CD:remote_config_desktop.cc:724-753 | one shared in-flight request; a call made while another is in flight gets its result, unless the stale generation changed since the request was built | different | One request per client is enough; a second caller should neither repeat it nor get a false success. |
X-Firebase-RC-Fetch-Type | a TODO, for CORS J:client/rest_client.ts:93-94 | BASE/1, REALTIME/n AI:ConfigFetchHandler.java:86-89 | the same I:RCNConfigFetch.m:57-60 | none | BASE/1 or REALTIME/<attempt>, on every platform | different (JS) | The measured CORS preflight allows it (D2). |
| Activate notification | none | none | FIRRemoteConfigActivateNotification I:FIRRemoteConfig.m:482-493 | none | Stream<void> onActivated (Unreleased): broadcast, one event after each activate() that returned true; ends at close() | same (iOS) | A stream instead of NSNotificationCenter; the event carries nothing, as the instance is known to the listener. |
| Feature | JS | Android | iOS | C++ | Dart | Status | Notes |
|---|---|---|---|---|---|---|---|
| Lookup order | active, default, static J:api.ts:273-292 | the same AI:ConfigGetParameterHandler.java:264-278 | the same I:FIRRemoteConfig.m:527-543 | the same CD:remote_config_desktop.cc:427-451 | getValue(key): active, default, static; synchronous | same | An empty remote string still counts as remote. |
getAll | active and defaults J:api.ts:322-324 | the same | none (Swift decoded()) | map<string, Variant> with a guessed type CD:remote_config_desktop.cc:629-660 | Map<String, RemoteConfigValue> getAll(): the union of active and default keys | same (JS, Android) | |
| Typed getters | getString, getBoolean, getNumber | getString, getBoolean, getLong, getDouble | stringValue, boolValue, numberValue | GetString, GetBoolean, GetLong, GetDouble | getString, getBool, getInt, getDouble; a getter falls back from the active value to the default to false, 0, 0.0 or '' | same (Android) | |
| Value object | Value with _source | FirebaseRemoteConfigValue | RemoteConfigValue | Variant | RemoteConfigValue(text, source) with asString, asBool, asInt, asDouble | same (Android) | asBool, asInt and asDouble return null when the text does not convert. |
| Source enum | static, default, remote | ints 0, 1, 2 | Static, Default, Remote | three-value enum | ValueSource { none, defaults, remote } | same | |
| Bool conversion | lower-cased, not trimmed, unknown is false J:value.ts:24-41 | trimmed, any case; asBoolean throws on unknown AI:FirebaseRemoteConfigValueImpl.java:90-103 | NSString.boolValue I:FIRConfigValue.m:58-61 | a lower-case word list CD:remote_config_desktop.cc:453-514 | trimmed, case-insensitive: 1, true, t, yes, y, on give true; 0, false, f, no, n, off and the empty string give false; anything else is null | same (Android) | The four upstream rules differ. Android's is the only one that reports "not a boolean" separately, so a malformed remote value falls back to its default. |
| Number conversion | Number(): hex, "" is 0, Infinity J:value.ts:43-52 | trimmed; asLong throws, getters fall back | prefix parse | strict with a flag CD:remote_config_desktop.cc:465-486 | asInt: trimmed ^[+-]?\d+$ within 64 bits on the VM and ±(2^53 − 1) on the web; asDouble: finite double.tryParse of the trimmed text | same (Android) | Web means dart.library.js_interop, so dart2wasm counts. A whole-valued JSON number (1.0, 1e3) from the server parses as an integer, because dart2js cannot tell it from 1. A web integer outside ±(2^53 − 1) is null on dart2js and dart2wasm; the VM accepts the full 64 bits, so a value between 2^53 and 2^63 reads differently on the two. |
| Static values | "", false, 0 | the same | the same | the same | '', false, 0; they convert to null | same | |
| Bytes | none | getByteArray (UTF-8) | dataValue | GetData | Uint8List RemoteConfigValue.asBytes() (Unreleased): the UTF-8 bytes of the text | same (Android) | |
| JSON value | none | none | jsonValue I:FIRConfigValue.m:64-75 | none | Object? RemoteConfigValue.asJson() (Unreleased): the decoded value, or null when the text is not JSON, nests deeper than 32 levels, is over 16 MiB or the source is static; never throws | same (iOS) | The bounds are the package's record limits. A text of null also gives null. |
| Keys with a prefix | none | active and defaults, sorted AI:ConfigGetParameterHandler.java:288-321 | active only I:FIRRemoteConfig.m:622-640 | active and defaults CD:remote_config_desktop.cc:616-626 | List<String> getKeysByPrefix(String prefix) (Unreleased): active and default keys, deduplicated, sorted by UTF-16 code units; an empty prefix gives every key | same (Android, C++) | |
| Source-specific lookup | none | none | configValueForKey:source: I:FIRRemoteConfig.m:546-565 | none | RemoteConfigValue getValueFrom(String key, ValueSource source) (Unreleased): remote reads the active record only, default the defaults only, static the static value | different (iOS) | A key the source lacks gives the static value, where iOS returns nil. getValue(key) is unchanged. |
Codable, property wrappers, Kotlin rc[key] | none | Kotlin | Swift | C++ idiom | none | won't do | Language idioms. |
| Feature | JS | Android | iOS | C++ | Dart | Status | Notes |
|---|---|---|---|---|---|---|---|
| Set from a map | assign defaultConfig, stringified at read J:api.ts:284-286 | setDefaultsAsync, replaces, persisted A:FirebaseRemoteConfig.java:515-528 | setDefaults:, replaces, persisted I:RCNConfigContent.m:200-247 | replaces, persisted CD:remote_config_desktop.cc:401-408 | the defaults constructor argument, an unmodifiable map of RemoteConfigValue with source defaults; in memory | different | Constructor-only, like every setting. The FlutterFire adapter provides setDefaults. |
| Accepted types | string, number, boolean | toString; bytes use the platform charset | string, number, data, date, array, dictionary; others skipped | bool, int, double, string, blob; others dropped | String, bool, int and finite double; an empty key or another type throws ArgumentError | different | Dropping unknown types silently is a trap. |
| Defaults from a file | none | Android XML AI:DefaultsXmlParser.java:65-131 | plist setDefaultsFromPlistFileName: IH:403 | Android resource id only | none | won't do | Plist and XML belong to their platforms. A JSON helper is not planned. |
| Feature | JS | Android | iOS | C++ | Dart | Status | Notes |
|---|---|---|---|---|---|---|---|
| Last fetch status | no-fetch-yet, success, failure, throttle J:public_types.ts:50 | SUCCESS, NO_FETCH_YET, FAILURE, THROTTLED | NoFetchYet, Success, Failure, Throttled IH:52-61 | Success, Failure, Pending CH:48-56 | RemoteConfigFetchStatus { noFetchYet, success, failure, throttled } | same (iOS) | |
| Last fetch time | ms, -1 | ms, -1 | an NSDate, success only I:RCNConfigSettings.m:264-266 | set on success and on failure CD:rest.cc:186-200 | DateTime? lastSuccessfulFetchTime | same (iOS) | A stored time later than now is dropped when loading. |
| Info object | instance properties | FirebaseRemoteConfigInfo A:FirebaseRemoteConfigInfo.java:20-47 | none | ConfigInfo CH:533 | RemoteConfigInfo: lastFetchStatus, lastSuccessfulFetchTime, throttledUntil, activeTemplateVersion, fetchedTemplateVersion | same (Android) | |
| Throttle end time | in the fetch-throttle error | FirebaseRemoteConfigFetchThrottledException | an error userInfo key IH:30 | throttled_end_time, set to now on any failure | throttledUntil on the exception and in info | same (Android) | |
| Template version | stored on activate J:api.ts:122-124 | stored on every fetch, not public | private | none | public and read-only, for the fetched and the active record | different | Realtime compares against it; no SDK exposes it. |
| Feature | JS | Android | iOS | C++ | Dart | Status | Notes |
|---|---|---|---|---|---|---|---|
| API | onConfigUpdate(rc, observer) J:api.ts:390-399 | addOnConfigUpdateListener, Kotlin configUpdates A:RemoteConfig.kt:62-77 | addOnConfigUpdateListener: IH:440 | wrappers; desktop is a no-op CD:remote_config_desktop.cc:679-686 | Stream<RemoteConfigUpdate> onConfigUpdated: the first listener opens the stream, the last cancel aborts it at once | different | A stream replaces the observer; RemoteConfigUpdate.updatedKeys is the set of changed keys. |
| When it is open | — | — | — | — | while a listener exists, the instance is open, realtime is not disabled and the app is in the foreground: app.onBackgroundChanged is false and, on the web, the page is not hidden | different | The VM has no lifecycle: apps feed onBackgroundChanged and onNetworkConnected, which never change by default. Only a change of onNetworkConnected from false to true acts: it clears both failure backoffs and allows a connect, but keeps the 1 s floor and the wait the server set with retryIntervalSeconds (A11, A20). |
| Last cancel | stays until the next message | the connection stays until the next message AI:ConfigAutoFetch.java:196-205 | closes the stream I:RCNConfigRealtime.m:806-818 | none | aborts at once (D4) | same (iOS) | |
| Endpoint | .../v1/projects/{projectId}/namespaces/{ns}:streamFetchInvalidations?key= J:client/realtime_handler.ts:230-237 | the same path with the project number AI:ConfigRealtimeHttpClient.java:79-80 | project number I:RCNConfigRealtime.m:28-33 | none | POST /v1/projects/{projectNumber}/namespaces/firebase:streamFetchInvalidations on firebaseremoteconfigrealtime.googleapis.com; the API key goes in X-Goog-Api-Key, never in the URL | same (Android) | |
| Headers | API key, FIS auth, If-None-Match, Content-Encoding: gzip on a plain body | adds X-Google-GFE-Can-Retry, X-Accept-Response-Streaming, package and certificate headers | gzipped body, bundle id header | none | Content-Type, Accept, X-Goog-Api-Key, X-Goog-Firebase-Installations-Auth and the Installations headers; no If-None-Match, no X-Accept-Response-Streaming | different | The preflight of X-Accept-Response-Streaming is refused by the server, so a browser could not send it. |
| Body | {project, namespace, lastKnownVersionNumber, appId, sdkVersion, appInstanceId} | the same, version as a string | the same keys, single-quoted, not JSON I:RCNConfigRealtime.m:334-343 | none | the same keys as strict JSON with string values; lastKnownVersionNumber is the fetched version, else the active one, else "0" | same (JS, Android) | |
| Message framing | the first { to the first } J:client/realtime_handler.ts:565-587 | the first { to the last } AI:ConfigAutoFetch.java:162-182 | buffers, drops text before { and handles every complete message, as Dart does; finds a 403 by searching the text I:RCNConfigRealtime.m:598-671 | none | an incremental framer: text before { is dropped, a message runs from { to the next }, every complete message in a chunk is handled, 16 KiB cap per message, three invalid messages end the connection | different | The JS and Android rules fail on real input: Android needs a newline after each message, and JS drops all but the first message of a chunk (D11). |
| Fields of a message | — | — | — | — | featureDisabled, then latestTemplateVersionNumber, then retryIntervalSeconds; unknown fields ignored; a message over 16 KiB (counted in UTF-16 code units) without its closing brace ends the connection | same (Android) | JS handles the same three fields. |
featureDisabled | closes the stream; the flag is never set J:client/realtime_handler.ts:74,779 | disabled for the life of the instance AI:ConfigRealtimeHttpClient.java:289-291 | stops, error 8004 | none | listeners get realtime-unavailable and their streams end; a later listener gets it at once | same (Android) | |
| Auto-fetch after an invalidation | 0 to 3 s jitter, 3 attempts | the same AI:ConfigAutoFetch.java:241-326 | the same, bypasses the interval I:RCNConfigFetch.m:203-241 | none | up to 3 attempts, each after a random 0 to 3 s, through the normal fetch path with interval zero and the shared throttle, X-Firebase-RC-Fetch-Type: REALTIME/<attempt> | same (Android) | Invalidations during a chain raise its target. One chain runs at a time. After a chain that did not end up to date (attempts used up, or a failed attempt, a throttle included) no new chain starts for 60 s on the injected clock, then one deferred chain runs if the target is still ahead; after an up-to-date chain the next higher announcement starts a chain at once (A12, A19). A chain is up to date only when the known template version is at least the target: an unchanged answer below it counts as stale and the next attempt runs (A25). |
| Auto-fetch at version 0 | skipped while the active version is 0 J:client/realtime_handler.ts:617-620 | fetches | fetches | none | fetches | same (Android) | The web differs from JS (D3). |
| A failed auto-fetch | reported J:client/realtime_handler.ts:527-533 | dropped AI:ConfigAutoFetch.java:257,278-282 | dropped | none | onRealtimeWarning gets one update-not-fetched with the cause | same (JS) | D10. |
updatedKeys | value diff plus experiment and rollout changes, against active J:client/realtime_handler.ts:330-431 | also personalization AI:ConfigContainer.java:256-344 | also personalization I:RCNConfigContent.m:591-684 | documented only | active against the newly fetched record over the union of keys: value, personalization entry, rollout assignment, and the experiment fields that affect the key; structural comparison | same (Android, iOS) | The experiment prefix _exp_rollout is skipped, as in JS. |
| Reconnect backoff | 8 attempts, 60 s × 2^n ±50%, capped at 4 h | 8 attempts; table 2 to 256 min ±50% AI:ConfigRealtimeHttpClient.java:73,257-287 | 7 retries, persisted; 2 min doubling to 4 h | none | server failures (408, 429, 502, 503, 504): Android's table; transport failures: 1, 2, 4, 8, 16, 32, 60, 120, 300 s ±50%; a floor of 1 s between connects; a connection that stays open 60 s resets the counts; a network change from false to true clears both backoffs (A11, A20) | different | D6, D9: on Android's table an hour offline means waits of over an hour after the network returns. |
| After 8 failures | stops | stops until a new listener or a foreground event AI:ConfigRealtimeHttpClient.java:361-401 | stops | none | one stream-error on onRealtimeWarning (the data stream is untouched), then keeps reconnecting on the same tables | different | D7: a desktop process gets neither a new listener nor a foreground event. |
| Read watchdog | none | no read timeout AI:ConfigRealtimeHttpClient.java:346 | the stream lives at most 330 s I:RCNConfigRealtime.m:64 | none | 330 s without a byte, counted from sending the request (headers count as bytes) and also while reading a non-200 body, ends the connection as a clean end | different | D8, A10 (a watchdog end before any header is a clean end; during a non-200 body the 330 s count from the headers, L1): a half-open socket is otherwise never detected. |
retryIntervalSeconds | stored unchecked | stored unchecked AI:ConfigAutoFetch.java:87-95 | clamped to 86400 I:RCNConfigRealtime.m:69-71 | none | ignored if malformed or not positive; a value above the range is capped at 86400 s | same (iOS) | D12, A28. |
| Non-retryable status | stream-error | the 403 body as the message AI:ConfigRealtimeHttpClient.java:596-611 | error 8001 | none | one stream-error as the last event, the stream ends, and a new listener starts it again; a 403 carries the server's text | same (Android) | |
| Persisted backoff | realtime_backoff_metadata: failed streams and the backoff end J:storage/storage.ts:59-64,200-210 | SharedPreferences AI:ConfigSharedPrefsClient.java:376-407 | UserDefaults | none | the realtime record (Unreleased): server and transport failure counts (0 to 1000) and the ends of the server, transport and retryIntervalSeconds waits, each bounded to now + 24 h when read; restored at start, and the first connect waits for the load | different (JS) | Cleared when a connection stays open 60 s (the package's success rule), where JS clears on an HTTP 200; the retryIntervalSeconds wait stays until it passes (A20). The fetch throttle was already persisted. A bad record is ignored and logged once. |
| Installation id change | — | — | — | none | an open stream reconnects, because its body names the id | different | The realtime request body carries the installation id, so a stream opened for the old id is stale. |
| Feature | JS | Android | iOS | C++ | Dart | Status | Notes |
|---|---|---|---|---|---|---|---|
| API | setCustomSignals(rc, map) J:api.ts:336-372 | setCustomSignals(CustomSignals) A:CustomSignals.java:26-86 | setCustomSignals: IH:463 | desktop-native CD:remote_config_desktop.cc:235-314 | Future<void> setCustomSignals(Map<String, Object?>); String, int and finite double; null removes a key; customSignals reads them back | same | The only targeting input that needs no Analytics. |
| Limits | key 250, string 500, 100 signals J:constants.ts:19-21 | the same | the same, UTF-16 units I:FIRRemoteConfig.m:54-58 | key 256 bytes CD:remote_config_desktop.cc:231-233 | key 1 to 250 characters, string at most 500, at most 100 after the merge | same (JS, Android, iOS) | |
| Invalid input | logs, stores nothing | warns, stores nothing | error 8102 or 8103 | a future error | ArgumentError naming the limit and the position of the entry, never its text; nothing is stored | same (iOS) | |
| Persisted | IndexedDB | SharedPreferences | UserDefaults | a data file | yes, in the store | same | |
| Wire format | custom_signals; (1.0).toString() is "1" | customSignals; "1.0" | custom_signals | customSignals; six significant digits | custom_signals, string values; an integer renders with toString, and a double without a fraction as its integer (1.0 is "1"), the same on the VM and the web | same (JS) | Values are never logged. |
| Effect on the cache | — | — | — | — | a change raises staleGeneration | different | D5. |
| Feature | JS | Android | iOS | C++ | Dart | Status | Notes |
|---|---|---|---|---|---|---|---|
| Rollout metadata | parsed, internal J:client/rest_client.ts:166 | parsed AI:ConfigContainer.java:198-225 | parsed I:RCNConfigContent.m:309-421 | ignored | stored with the fetched and active records; feeds updatedKeys | same | Fields of the wrong shape are dropped one by one and logged, as Android does. |
| Experiment descriptions | parsed J:public_types.ts:67-87 | stored | stored, validated I:RCNConfigFetch.m:765-779 | none | stored; feed updatedKeys | same | |
| Personalization metadata | none | stored | stored | none | stored; feeds updatedKeys | same (Android, iOS) | |
| Rollouts state stream | none | Crashlytics interop AI:rollouts/RolloutsStateSubscriptionsHandler.java:53-95 | RemoteConfigInterop | none | Stream<Set<RolloutAssignment>> onRolloutsStateChanged (Unreleased): one assignment per rollout of the active record (rollout id, variant id, first affected key, its value as getString reads it, template version or 0), as AI:rollouts/RolloutsStateFactory.java builds it | different (Android) | A new listener gets the current set once the records are loaded, an empty set when nothing is active (Android sends nothing then); later sets only after an activate() or reset() that changes them (Android publishes after every activate). |
| A/B testing hand-off on activate | sets Analytics user properties J:abt/experiment.ts:36-101 | firebase-abt | FIRExperimentController | none | analytics: constructor argument, a RemoteConfigAnalytics (setUserProperties(Map<String, String?>), logEvent(String)) (Unreleased): after each activate() that returns true, one setUserProperties with firebase<experimentId> = variant id, null for an id handed over before that is gone, then logEvent('set_firebase_experiment_state'); nothing for an empty map; the ids are kept in an experiments record; reset() clears them | different (JS) | A42. The app passes the connector (JS looks up Analytics at run time). A connector failure is logged once per error type and activate() still returns true (JS throws analytics-unavailable); the stored set becomes the union of the current and previous ids, so the next activate re-sends the variants and the clears. JS has no reset. |
| Personalization events on read | none | personalization_assignment A:Personalization.java:26-107 | the same, as a side effect of a read I:RCNPersonalization.m:33-84 | none | none | won't do | Android and iOS only; the JS SDK does not do it either. |
analyticsUserProperties, firstOpenTime in the body | none | from Analytics AI:ConfigFetchHandler.java:577-604 | from Analytics I:RCNConfigSettings.m:388-416 | schema only | none | won't do | Android and iOS only; the JS SDK does not do it either. |
| Feature | JS | Android | iOS | C++ | Dart | Status | Notes |
|---|---|---|---|---|---|---|---|
| Store | IndexedDB firebase_remote_config, in-memory fallback J:storage/storage.ts:44-47 | three JSON files and SharedPreferences | SQLite and UserDefaults I:RCNConfigDBManager.m:37-71 | one flexbuffers file, not atomic CD:file_manager.cc:37-84 | the KeyValueStore of the Installations package, which Remote Config reads from installations.store: MemoryKeyValueStore, FileKeyValueStore (VM, atomic rename) or IndexedDbKeyValueStore (web); records fetched, active, meta, throttle, signals, realtime and experiments per app | different | The store has no upstream; it follows Auth's file storage in this repository. No dart:io in the main library. |
| Corrupt or failed storage | typed storage-* errors | swallowed as "no cache" | the database is rebuilt | skipped if verification fails | loading never throws for a bad record: it is absent and logged once; loaded fields pass the validators used for server input (every stored time through parseBoundedInt with an absolute value of at most 8.64e15 ms, a negative time is accepted within that range, activate clamps a future fetch time to one now and the fetched update replaces a record with a future fetch time (A21, A27), and an out-of-range template version makes the record absent; limits on meta.fid (256 characters), the throttle count (1000) and the project number (32 digits), A29); a failed write after a successful start is logged, activate and setCustomSignals throw storage-error and leave memory unchanged, fetch continues from memory | different | The app should keep running on a broken store; a write that must persist (activate, signals) says so. |
| Cross-process sharing | IndexedDB | none | none | a mutex, one process | one process owns a VM store directory (an OS lock), a second process gets storage-error; tabs share one IndexedDB store, each with its own realtime stream | different | Upstream shares nothing between processes; a desktop program needs the lock so two processes do not overwrite one another's records. |
| No encryption at rest | — | — | keychain for tokens | — | the installation record holds the refresh token in clear text; the directory is private to the user (mode 700 on Linux and macOS) | different | Stated in the README. |
| Feature | JS | Android | iOS | C++ | Dart | Status | Notes |
|---|---|---|---|---|---|---|---|
| Fetch backoff | waits inside the call on 429, 500, 503, 504; 1 s × 2^n ±50% until the timeout J:client/retrying_client.ts:68-143 | fails fast on 429, 502, 503, 504; 2 to 256 min ±50%, persisted AI:ConfigFetchHandler.java:487-547 | fails fast on 429, 500, 503, 504; 2 min doubling to 4 h, in memory I:RCNConfigSettings.m:178-202 | none | fails fast on 429, 502, 503, 504 with Android's table and jitter, persisted and shared with realtime auto-fetches; a 429 throws fetch-throttle, the other statuses fetch-status, both with throttledUntil; a valid 200 resets the count | same (Android) | A server or a Flutter start-up cannot tell a long wait inside fetch from a hang. |
| Error type | FirebaseError remoteconfig/<code>, 21 codes J:errors.ts:19-41 | exception classes and 5 codes | domain codes 8001 to 8003, 8101 to 8103 | RemoteConfigError | a sealed FirebaseRemoteConfigException extends FirebaseException (subtypes RemoteConfigClientException, RemoteConfigThrottledException with throttledUntil, RemoteConfigServerException with httpStatus, serverStatus, serverMessage), plugin firebase_remote_config, with cause on all; codes invalid-app-config, installations-error, fetch-client-network, fetch-timeout, fetch-throttle, fetch-client-parse, fetch-status, storage-error, stream-error, realtime-unavailable, update-message-invalid, update-not-fetched, remote-config-closed; errorCode gives them as the enum RemoteConfigErrorCode, with unknown for a code this version does not know | different | Browser and registration codes of JS are dropped. |
| Server text in errors | one generic message | per-status hints AI:ConfigFetchHandler.java:424-460 | "Status code: N" | none | serverMessage from the body, control characters removed, at most 1 KiB | different | Never a token, the API key, a request body or custom-signal text. |
| A 200 that is not the expected shape | — | — | an error body is an error I:RCNConfigFetch.m:574-606 | parsed, unused | fetch-client-parse: not JSON, wrong types, over 8 MiB, nesting over 32; nothing is stored | different | Server input is untrusted (D14); a bad body must never replace the stored template. |
| Installations failure | propagates raw | wrapped AI:ConfigFetchHandler.java | error 8003 | n/a | installations-error with the Installations exception as cause | same (Android) | |
| Limits, redirects, TLS | platform defaults | platform defaults | platform defaults | curl | response caps (8 MiB, error bodies 16 KiB), no redirects, origins fixed at construction (https, or http to loopback), every server number bounded | different | D14. |
| Feature | JS | Android | iOS | C++ | Dart | Status | Notes |
|---|---|---|---|---|---|---|---|
| URL | .../v1/projects/{projectId}/namespaces/{ns}:fetch?key= J:client/rest_client.ts:81-85 | the project number; X-Goog-Api-Key header | the project id, ?key= I:RCNConfigFetch.m:666-689 | the project id, ?key= CD:rest.cc:107-117 | POST https://firebaseremoteconfig.googleapis.com/v1/projects/{projectId}/namespaces/firebase:fetch, key in X-Goog-Api-Key | different | The key stays out of URLs and logs; iOS logs the URL including the key. |
| Body | JSON, snake_case | JSON, camelCase | not JSON, snake_case, gzipped I:RCNConfigSettings.m:361-437 | JSON, camelCase | JSON, snake_case: sdk_version, app_instance_id, app_instance_id_token, app_id, language_code, custom_signals only when not empty | same (JS) | Measured against the production server. |
| Compression | Content-Encoding: gzip on an uncompressed body J:client/rest_client.ts:89,111 | none (the response is gzip) | gzip | none | no Content-Encoding; Accept-Encoding is left to IOClient and the browser | different | Android also sends no Content-Encoding (only its response is gzip). A client that does not request gzip gets no ETag, so the server cannot answer NO_CHANGE. |
| Identity | FID and token in the body | token in a header | the same | fake ids | the FID and the auth token in the body, and the token in X-Goog-Firebase-Installations-Auth | same (JS, Android) | |
| Platform-restriction headers | none | X-Android-Package, X-Android-Cert | X-Ios-Bundle-Identifier | none | the androidPackage, androidCert and iosBundleId of the FirebaseInstallations, sent as those three headers with every request | different | A key restricted to an Android or iOS app needs them; a desktop program has none of the facts, so the README advises an unrestricted key or these headers. |
| App Check header | none | none | none | none | none | won't do | No SDK sends one to this API. |
| Language | language_code from the page | the locale | the locale | the locale | languageCode, else Platform.localeName (VM) or navigator.language (web), reduced to a BCP 47 tag; en when empty or blank | same | A28. |
| Logging | setLogLevel J:api.ts:302-317 | system log | Firebase logger | LogDebug | a RemoteConfigLogger constructor argument with RemoteConfigLogLevel; silent when absent, no global switch; never a token, the API key, a body or custom-signal text | different | JS logs custom-signal values at debug level; iOS logs the FID and the key-bearing URL. |
This document compares the public API and the behaviour of the Firebase Installations clients of four official SDKs with firebase_installations_dart (firebase_installations/firebase_installations_dart), feature by feature:
Read from docs/installations_parity.md on origin/main at 9122437c.
packages/installations of firebase-js-sdk at a086865. It is the reference for the protocol.firebase-installations of firebase-android-sdk at 2cfdd03.FirebaseInstallations of firebase-ios-sdk at cef246f. It is the reference for token recovery and the client backoff.installations of firebase-cpp-sdk at 09d2e7a. Off Android and iOS it compiles a stub that returns "FakeId" and "FakeToken" (FC:stub/installations_stub.cc:35-58).firebase_installations_dart 0.1.0 and the FirebaseInstallations it describes. The Dart column states the behaviour the package is built to have; it was written from the design, before the package was integrated. Audit it against the code before trusting a row. To read a row quickly, start with the Dart and Notes columns.The four SDKs were read as source clones on 2026-11-27, from GitHub only; their code was read, not run. Line numbers will drift. Remote Config, the first user of this package, has its own document: remote_config_parity.md. The reasons for the departures from upstream are in remote_config_decisions.md; the notes below name them as D13 and D14.
The Status column compares the Dart behaviour with the SDK named in the cell, or with all of them when it names none:
Path shorthand:
FJ: is JS packages/installations/src.FA: is Android firebase-installations/src/main/java/com/google/firebase/installations.FI: is iOS FirebaseInstallations/Source/Library.FC: is C++ installations/src.Same: Dart has it as the official SDKs do. Different: Dart has it, in another shape or with other behaviour. Missing: a gap Dart could close. Won't do: will not be done, is not needed, makes no sense in Dart or does not apply to it; none of it is a gap. The Status column keeps the doc's wording, including the SDK named in brackets.
38 feature rows in 4 groups.
| Status | Rows |
|---|---|
| same | 15 |
| different | 21 |
| missing | 0 |
| won't do | 2 |
| Feature | JS | Android | iOS | C++ | Dart | Status | Notes |
|---|---|---|---|---|---|---|---|
| Get an instance | getInstallations(app) FJ:api/get-installations.ts:28 | getInstance(app) FA:FirebaseInstallations.java:205-209 | installationsWithApp: FI:FIRInstallations.m:190-194 | GetInstance; a stub on desktop | FirebaseInstallations(app, store:, androidPackage:, androidCert:, iosBundleId:, httpClient:, logger:) | different | No instance cache. The constructor reads and sends nothing. |
getId | returns the local FID and registers in the background FJ:api/get-id.ts:30-44 | waits for local state only | returns the FID; the token refreshes in the background | returns "FakeId" | Future<String> getId(): returns the stored FID, creating one when there is none, and starts the registration in the background | same (JS) | A registration failure goes to the logger and surfaces at getToken. |
getToken(forceRefresh) | a string FJ:api/get-token.ts:31-42 | InstallationTokenResult with an expiry | a token result with an expiration date | a string | Future<String> getToken({forceRefresh}), and getIdAndToken({forceRefresh}) returning a matching (id, token) pair | different | The pair is read from one record after the token is obtained, so a recovery inside the call replaces both. Remote Config needs it. |
delete | local only if never registered; throws if a registration is pending FJ:api/delete-installations.ts:31-57 | DELETE, then a new FID next time | DELETE ignoring 404, then a change notification | stub | Future<void> delete(): waits for a registration in flight, sends DELETE when registered (200, 401 and 404 count as done), removes the record | same (Android) | |
| Id-change events | onIdChange on any stored FID change, with a BroadcastChannel FJ:helpers/fid-changed.ts:24-110 | registerFidListener, for a registered FID that changed FA:FirebaseInstallations.java:434-457 | a notification on create, server change and delete FI:InstallationsIDController/FIRInstallationsIDController.m:498-503 | none | Stream<String> onIdChange: emits the new FID when a different one is stored (a new id, a different id from the server, a recovery); tokens never travel in a BroadcastChannel message | different | Every SDK uses its own rule. Remote Config reacts by marking its cache stale and reconnecting its stream. |
| Close | none | none | none | destructor | close(): idempotent (a second call returns the same future), ends onIdChange, closes the HTTP client if the instance created it; calls in flight fail with installations-closed, later calls throw a StateError; isClosed reports it, also for a deleted app before its onDeleteApp event; runs by itself when the app is deleted | different | Upstream SDKs have no close; a Dart client that owns an HTTP client and a stream must be able to release them. |
| Interface for other products | installations-internal | an interop API | an instance provider | an internal class | the public FirebaseInstallations instance, passed to the product | different | The alternatives (a provider on FirebaseApp, a static cache) are in the decisions document. |
| Feature | JS | Android | iOS | C++ | Dart | Status | Notes |
|---|---|---|---|---|---|---|---|
| FID format | 22 characters, /^[cdef][\w-]{21}$/ FJ:helpers/generate-fid.ts:20 | 22 characters | 22 characters | none (Remote Config fakes 8 bytes) | the same pattern; a FID from the server or the store that fails it is rejected | same (JS) | |
| FID generation | 17 secure random bytes, the high nibble 0111 FJ:helpers/generate-fid.ts:27-55 | built from a UUID | built from a UUID | none | randomBytes(17) from Random.secure(), byte 0 masked as in JS, base64url, first 22 characters | same (JS) | |
| The server returns another FID | overwrite | overwrite | overwrite FI:InstallationsIDController/FIRInstallationsIDController.m:283-288 | none | stored, and emitted on onIdChange | same | |
| Required options | projectId, apiKey, appId; missing-app-config-values at creation | checked on every call | an exception at init | none | invalid-app-config at construction when one is missing, when the API key does not match ^A[A-Za-z0-9_-]{38}$, when the app id has no :, or when the project id does not match ^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$ | different | Stricter than JS: the format checks are those Android and iOS make (FA:Utils.java:33-34). The project id check keeps a hostile value out of the URL. |
| Registration state | NOT_STARTED, IN_PROGRESS, COMPLETED | five persisted ordinals | Unknown, Unregistered, Registered | none | unregistered, registering, registered, persisted; registering carries a time stamp | different | The stamp is a marker that matters when tabs share an IndexedDB store (below). |
| Persistence | IndexedDB firebase-installations-database FJ:helpers/idb-manager.ts:24-53 | a JSON file in the no-backup directory, temp file and rename FA:local/PersistedInstallation.java:85-193 | keychain and a UserDefaults flag | none | a KeyValueStore the app creates and passes in (required): MemoryKeyValueStore, FileKeyValueStore (VM, a private directory, atomic rename) or IndexedDbKeyValueStore (web); record key installations/<app.persistenceKey> | different | There is no default store: a memory default would create a new installation at every start without saying so. The web database is this package's own, not JS's. No encryption at rest: the record holds the refresh token. |
| Corrupt record | — | — | — | — | a record that fails validation counts as absent and a new FID is created; a record over 64 KiB (counted in characters, not bytes) is absent; a token must be 1 to 4096 printable ASCII characters, times must lie between 0 and the year 9999, tokenExpiresIn must be at least 1000 ms, and the owner fields must match ^[A-Za-z0-9._-]{1,64}$; the file store refuses a write over 16 MiB and reads a non-regular file as absent (A34) | different | A damaged store should not stop the app; a new FID is the safe recovery. |
| Store write failure | — | — | — | — | the instance keeps the new record in memory, logs once, and retries the write before every later operation as a guarded merge inside update (memory applies only if nothing is stored, or the stored record has the same FID and is not further along, and never after another writer's delete); the FID stays the same for the life of the process; a store configuration failure (an owned directory, the directory mode) is thrown as storage-error | different | A failed write must not change the FID between calls; a wrong configuration is the app's to fix, so it fails. |
| Concurrency | an IDB transaction, 100 ms polling, 10 s pending timeout | synchronized and a FileLock | per-operation promise caches FI:InstallationsIDController/FIRInstallationsSingleOperationPromiseCache.m:46-67 | none | one in-flight future per operation, shared by concurrent callers; one process owns a VM store directory (an OS lock); IndexedDB markers: a start time and the owner's nonce, fresh when at most 15 s old, re-stamped by the owner only, before every HTTP attempt of at most 10 s; the directory check of a VM store runs before any await | different | D13: JS's marker and request both allow 10 s, so another tab repeats a slow request. |
MemoryKeyValueStore | — | — | — | — | logs one warning (no values) when an installation is first registered in it, and only if a logger was passed | different | A memory store loses the installation at exit; the warning says so, without values. |
| Feature | JS | Android | iOS | C++ | Dart | Status | Notes |
|---|---|---|---|---|---|---|---|
| Base | https://firebaseinstallations.googleapis.com/v1 FJ:util/constants.ts:9-10 | the same | the same | none | the same; an origin can be changed only through a @visibleForTesting constructor argument, and only to https or loopback | same | No emulator exists in any SDK. |
| Create | POST projects/{p}/installations; {fid, authVersion: "FIS_v2", appId, sdkVersion: "w:..."} | the same, a: | the same, a trailing slash, i: | none | POST /projects/{projectId}/installations, no trailing slash; sdkVersion is d:<packageVersion> | same (JS) | A d: prefix is accepted by the server. |
| Generate a token | POST .../{fid}/authTokens:generate; {installation: {sdkVersion, appId}} | {installation: {sdkVersion}} | the same as Android | none | {installation: {sdkVersion}}, without appId | same (Android) | The server accepts both. |
| Delete | DELETE .../{fid} | 200, 401, 404 are success FA:remote/FirebaseInstallationServiceClient.java:326-342 | a body {}; 404 ignored | none | DELETE .../{fid}; 200, 401 and 404 count as done | same (Android) | |
| Headers | x-goog-api-key; Authorization: FIS_v2 <refreshToken> on token and delete | adds gzip, package and certificate headers | adds the bundle id header | none | Content-Type (not on DELETE), Accept, x-goog-api-key, Authorization: FIS_v2 <refreshToken> on token and delete, and the androidPackage, androidCert and iosBundleId arguments; no Content-Encoding, no Accept-Encoding | different | androidPackage, androidCert and iosBundleId are sent as X-Android-Package, X-Android-Cert and X-Ios-Bundle-Identifier (no other header can be set), for an API key restricted to those apps. All three pass the CORS preflight, so they are sent on every platform. |
Heartbeat x-firebase-client | when a heartbeat service exists | every request | every request | no-op | none | won't do | Omitted when empty by all three clients; this SDK has no heartbeat service. |
| Timeout | the browser default | 10 s FA:remote/FirebaseInstallationServiceClient.java:100 | the URLSession default | none | 10 s per attempt, 60 s for a whole public call (unavailable) | same (Android) | |
expiresIn | "604800s" FJ:functions/common.ts:104-107 | [0-9]+s required | required | none | ^[0-9]{1,9}s$ with a value from 1 s to 400 days; a response that fails the checks is invalid-response and nothing is stored | different | Stricter than all three. |
| Response size and redirects | no limit | no limit | no limit | none | a success body is capped at 64 KiB, an error body at 16 KiB, redirects are refused (a 3xx is invalid-response and feeds the recoverable backoff); the response is read as text, then {"error": {code, status, message}} or {"error": "<string>"} | different | D14. A non-JSON error body keeps only the status. |
| Feature | JS | Android | iOS | C++ | Dart | Status | Notes |
|---|---|---|---|---|---|---|---|
| Expiry buffer | 1 h, and a refresh if the clock went back FJ:helpers/refresh-auth-token.ts:187-193 | 1 h | 1 h | none | a token is valid when tokenCreatedAt <= now and it has at least 1 h left | same (JS) | |
| Refresh scheduling | lazy | lazy | lazy | none | lazy, no timers | same | A VM process can exit. |
| 401 or 404 on a token request | remove the entry, throw | regenerate, throw | regenerate, retry once FI:...IDController.m:365-388 | none | remove the record, create a new FID, register it, send generate once more in the same call; a second 401 or 404 throws installation-not-found | same (iOS) | A 401 or 404 on create is not this recovery (next row). |
| 409 on create | remove the entry FJ:helpers/get-installation-entry.ts:144-147 | a generic error | a generic error | none | remove the record and feed the recoverable backoff (the n-th failure waits min(2^n + random(0, 1), 1800) s); the call restarts with a new FID, and its create is sent despite that window; a second 409 in the same call throws invalid-response (status 409); a call made inside the window that a 409 started throws too-many-requests, not the 409's bad-config; a getToken caller waiting on the registration restarts it | different | As-built A4, A31: JS has no backoff, and without a limit a server that keeps answering 409 would loop. |
| Create statuses | one error for every status | — | — | none | per endpoint: 400, 401, 403 and 404 on create are bad-config, and only 400 and 403 block create for 24 h; 401 and 404 on create are a recoverable failure (the wrong project or key; no installation exists yet); any other 4xx (408, 410, 418 and so on) is invalid-response with the status kept, and it feeds the backoff | different | As-built A4, A31. A 401 or 404 on generate keeps the recovery above. An unexpected 4xx is not bad-config, so a proxy's 408 does not make Remote Config stop its realtime stream. |
| Retry on a server error | any 5xx, once, at once | two attempts for 5xx and IO | status 500 only, once, after 1 s | none | once after 1 s on 5xx or a transport error | same (iOS) | |
| Client backoff | none | RequestLimiter, with a seconds-and-milliseconds mix-up (inferred) FA:remote/RequestLimiter.java:28-100 | min(2^n + jitter, 30 min); 24 h for 400 and 403 FI:InstallationsIDController/FIRInstallationsBackoffController.m:19-130 | none | the iOS model, in memory per instance: after 400 or 403 no create or generate for 24 h (calls rethrow bad-config with retryAfter); after 429, a 5xx, a 3xx, another 4xx, or a 409 or a 401 or 404 on create, the n-th consecutive failure waits min(2^n + random(0, 1), 1800) seconds; success, and 401 or 404 on generate, reset it; a transport error and an unusable 2xx body change nothing | same (iOS) | As-built A31. Behind a captive portal each 3xx adds to the backoff, up to 30 minutes, and nothing clears it when the network returns (L1). |
| Error type | FirebaseError, 6 codes; request-failed carries the server's code and message FJ:util/errors.ts:21-40 | BAD_CONFIG, UNAVAILABLE, TOO_MANY_REQUESTS | 4 codes | 4 codes, mostly unused | a sealed FirebaseInstallationsException extends FirebaseException (subtypes InstallationsClientException, InstallationsBadConfigException and InstallationsThrottledException under InstallationsBackoffException (retryAfter), InstallationsServiceException), plugin firebase_installations: invalid-app-config, bad-config, installation-not-found, too-many-requests, unavailable, network-error, invalid-response, storage-error, installations-closed, which errorCode gives as the enum InstallationsErrorCode, with unknown for a code this version does not know; httpStatus, serverStatus, serverMessage on the server subtypes, retryAfter on bad-config and too-many-requests, cause on all | different | JS maps most of these to request-failed; separate codes let Remote Config classify a failure for realtime. |
| Offline | app-offline from navigator.onLine | a network error | ServerUnreachable | none | network-error for a transport failure or the 10 s request deadline | different | No navigator.onLine check. |
| Messages | — | — | logs FIS bodies FI:InstallationsAPI/FIRInstallationsAPIService.m:296-311 | — | no log line, exception message or toString (code, message and HTTP status only) holds a refresh token, an auth token, the API key, a request URL with a query or a body; records and tokens print <redacted> | different | D14. |
| Logging | a global log level | the system log | the Firebase logger | none | an InstallationsLogger constructor argument with InstallationsLogLevel; silent when absent | different | There is no global log level in Dart; a constructor argument keeps loggers per instance. |
| IID migration | none | from the GMS file | from the keychain | none | none | won't do | No instance id ever existed on desktop or the web. |
This document compares the public API of the official Analytics SDKs with the planned Dart packages:
Read from docs/analytics_parity.md on origin/main at 9122437c.
firebase_analytics/firebase_analytics_dart, specified in analytics_spec.md and in development (not released). Each row says what the first release does.firebase_analytics/firebase_analytics_dart_platform, in development too. The last section maps every method of FlutterFire's FirebaseAnalytics.Unlike the other parity documents, this one cannot compare behaviour. The Android and iOS SDKs are closed binaries, the JS SDK forwards to gtag.js, and the Windows part of the C++ SDK is a closed DLL. What can be compared is the public API, and the wire facts in analytics_protocol.md.
Analytics compares public APIs of packages that are still in development, so the doc has no Same or Different tags; it ranks each row. First release: in the first published version of the client or the adapter (shown in the Same colour). Later: possible over the Measurement Protocol, not planned for the first release (shown in the Different colour). n/a: cannot be done by a Measurement Protocol client, or has no meaning outside its platform (shown in the Won't do colour).
Read on 2026-11-28.
| Short name | Source | Version |
|---|---|---|
J: | firebase-js-sdk, packages/analytics/src (api.ts, public-types.ts, factory.ts) | main at 6e8b0eb (2026-11-24) |
| Android | [FirebaseAnalytics reference](https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics) | page last updated 2026-07-08 |
| iOS | firebase-ios-sdk, FirebaseAnalytics/Tests/SwiftUnit/AnalyticsAPITests.swift (the API surface test of the closed binary) and FirebaseAnalytics/Sources/Analytics+SwiftUI.swift | main at f267458 (2026-11-26) |
C: | firebase-cpp-sdk, analytics/src/include/firebase/analytics.h and analytics/src/analytics_desktop.cc | main at 0c31588 (2026-11-26) |
FF: | flutterfire, packages/firebase_analytics (firebase_analytics 13.1.0 and its platform interface) | main at bbdc38e (2026-11-27) |
References to the JS SDK carry line numbers of api.ts at 6e8b0eb.
The C++ SDK has a desktop implementation that matters for the question of who this package is for (spec section 1):
Initialize verifies a closed google_analytics.dll against a list of known hashes and loads it, passing the Firebase app id and package name (C:analytics_desktop.cc, Initialize). Event logging, user properties, user id, the collection switch and reset go to that DLL. SetConsent, SetDefaultEventParameters, SetSessionTimeoutDuration, the on-device conversion calls and GetAnalyticsInstanceId are not supported there: they log a warning, and the instance id is the fixed string FakeAnalyticsInstanceId0. Vector parameters are skipped; a map parameter becomes items. Four functions exist for the desktop only: SetLogCallback, NotifyAppLifecycleChange(kTermination) (blocks until pending data is uploaded), IsDesktopInitialized and SetDesktopDebugMode.firebase_analytics. It has generated Windows message files but no Windows plugin (FF:firebase_analytics/pubspec.yaml).So on Windows a native path exists for C++ programs, through a closed DLL with no consent and no instance id. On Linux, from Dart, and from a Flutter app on Windows there is still none. The spec's statement that FlutterFire has no implementation on Windows and Linux holds. The Windows DLL is a reason to keep this package's claims modest, not a reason to stop: it is not reachable from Dart without FFI against a closed binary, and it reports to an app stream through a channel this package cannot use.
| Feature | JS | Android | iOS | C++ | Dart client | Rank | Notes |
|---|---|---|---|---|---|---|---|
| Get an instance | getAnalytics(app) J:73 | getInstance(context) | class methods on Analytics | Initialize(app) | FirebaseAnalytics(app, measurementId:, transport:, …) | first release | One object per constructor call, no global cache (design rule 4). |
| Options at start | initializeAnalytics(app, {config}) J:95 | none | none | none | constructor arguments | first release | config is gtag configuration (send_page_view, cookie settings); the parts with a meaning here (page_title, page_location) are parameters of logScreenView. |
| Global script names | settings({gtagName, dataLayerName}) J:58 | none | none | none | none | n/a | Names of the page's gtag globals. |
| Is supported | isSupported() J:127: not a browser extension, cookies enabled, IndexedDB present | none | none | none | none in the client; the adapter answers true | first release (adapter) | The client works wherever package:http works. |
| Measurement target | Firebase config's measurementId | google-services.json | GoogleService-Info.plist | app options | measurementId: (a web stream, G-…) | first release | Web streams only (protocol §5). |
| API secret | none | none | none | none | AnalyticsTransport.direct(apiSecret:) or a relay; none with the experimental AnalyticsTransport.gtag(measurementId:) | first release | A Measurement Protocol requirement with no SDK counterpart (spec section 2). The gtag transport speaks gtag.js's undocumented protocol instead (analytics_gtag.md). |
| EU collection | gtag setting | none | none | none | AnalyticsTransport.direct(region: AnalyticsRegion.eu), also on AnalyticsTransport.gtag | first release | region1.google-analytics.com (protocol §1). |
| Shut down | deleteApp | none | none | Terminate(); NotifyAppLifecycleChange(kTermination) on Windows | close(), which flushes; it also runs when the app is deleted | first release | close() is the counterpart of the Windows termination call. |
| Upload now | none | none | none | Windows termination only | flush() | first release | |
| Log callback | none | none | none | SetLogCallback (Windows) | package:logging logger | first release | The same logger as the other packages. |
| Debug mode | debug_mode parameter | adb property | launch argument | SetDesktopDebugMode (Windows) | debug_mode parameter on events, documented | first release | Puts events in DebugView (protocol §2). No separate switch. |
| Is initialized | none | none | none | IsDesktopInitialized() | none | n/a | A constructed client is ready. |
| Feature | JS | Android | iOS | C++ | Dart client | Rank | Notes |
|---|---|---|---|---|---|---|---|
| Log an event | logEvent(analytics, name, params, options) J:275–736, typed overloads per event | logEvent(name, Bundle) | logEvent(_:parameters:) | LogEvent with 0, 1 or many Parameters | logEvent(name:, parameters:) | first release | One untyped method. The typed helpers live in the adapter (spec section 4). |
| Invalid event | logged by gtag | dropped and logged | dropped and logged | dropped and logged | throws FirebaseAnalyticsException | first release | Deliberate difference (protocol §9). |
| Reserved event names | not checked by the JS SDK | checked | checked | checked | checked against the protocol list, plus ad_impression, in_app_purchase, screen_view | first release | Protocol §4. |
firebase_, google_, ga_ event prefixes | not checked | reserved | reserved | reserved | refused | first release | The protocol pages reserve them for parameters and user properties only; the Android SDK for event names too. |
| Parameter types | string, number, items arrays | string, long, double, Bundle[] items | string, number, item arrays | int64, double, string, map (items) | String, int, double, bool (as 0/1), items as List<Map<String, Object>> | first release | Numbers checked with isFinite (design rule 9). |
| Recommended event and parameter names | EventNameString union, EventParams, Item | Event and Param constants | AnalyticsEvent…, AnalyticsParameter… constants | kEvent…, kParameter… constants | constants for the names the protocol accepts on a web stream | first release | Constants only; the adapter has the typed helpers. |
| Default parameters | setDefaultEventParameters(params) J:257 | setDefaultEventParameters(Bundle?) | setDefaultEventParameters(_:) | SetDefaultEventParameters (no-op on Windows) | setDefaultEventParameters(Map?), persisted | first release | Merged into each event when it is logged; the event's own value wins. |
| Screen view | setCurrentScreen J:157, deprecated; logEvent('screen_view') | logEvent(SCREEN_VIEW); setCurrentScreen deprecated | logEvent(AnalyticsEventScreenView); SwiftUI .analyticsScreen(name:class:) | LogEvent(kEventScreenView) | logScreenView(screenName:, screenClass:) sends page_view | first release | Deliberate difference: screen_view is for app streams only (protocol §8). |
Automatic events (first_open, session_start, user_engagement, app_update, os_update, …) | by gtag (web events) | yes | yes | Windows: by the DLL | none | n/a | Reserved in the protocol. Sessions come from session_id (below). |
| Enhanced measurement (scroll, outbound clicks, file downloads) | by gtag | none | none | none | none | n/a | Page events. |
Call options {global: true} | AnalyticsCallOptions | none | none | none | none | n/a | Applies a call to every gtag property of the page. |
| Store transactions | none | automatic in_app_purchase | logTransaction(_:) (StoreKit 2) | LogAppleTransaction | none | n/a | Needs the store's receipt and an app stream. |
| Feature | JS | Android | iOS | C++ | Dart client | Rank | Notes |
|---|---|---|---|---|---|---|---|
| User id | setUserId(id | null) J:197 | setUserId(String?) | setUserID(_:) | SetUserId | setUserId(String?), persisted | first release | Up to 256 characters (protocol §4). |
| User property | setUserProperties(props) J:216, several at once | setUserProperty(name, value?) | setUserProperty(_:forName:) | SetUserProperty | setUserProperty(name:, value:), persisted; null removes | first release | Up to 25, names up to 24 characters, values up to 36. |
| Instance id | getGoogleAnalyticsClientId() J:179 (gtag's client_id) | getAppInstanceId(), null if ANALYTICS_STORAGE is denied | appInstanceID() | GetAnalyticsInstanceId() (fake on Windows) | appInstanceId, the persisted client_id; null while analytics storage is denied | first release | Closest to the JS getGoogleAnalyticsClientId; the FlutterFire name is kept. |
| Session id | none | getSessionId() | sessionID() | GetSessionId() | sessionId | first release | Start time of the session in seconds (protocol §6). |
| Session timeout | none | setSessionTimeoutDuration(ms) | setSessionTimeoutInterval(_:) | SetSessionTimeoutDuration (no-op on Windows) | AnalyticsOptions(sessionTimeout:) | first release | Configuration, not a setter (design rule 4). The adapter's setter is allowed before the first event and throws after it (adapter table). |
| Engagement time | by gtag | automatic | automatic | Windows: by the DLL | engagement_time_msec from setAppActive | first release | Spec section 6. |
| Reset | none | resetAnalyticsData() | resetAnalyticsData() | ResetAnalyticsData() | resetAnalyticsData(): new client id, clears user id, properties, session and the queue; default parameters, consent and the collection switch stay | first release | Default parameters are app configuration (an app version), not user data. |
| Device and geography | from the browser | automatic | automatic | Windows: by the DLL | device from the platform; user_location only if supplied | first release | Protocol §7. No IP address. |
| Feature | JS | Android | iOS | C++ | Dart client | Rank | Notes |
|---|---|---|---|---|---|---|---|
| Collection switch | setAnalyticsCollectionEnabled(analytics, enabled) J:239 | setAnalyticsCollectionEnabled | setAnalyticsCollectionEnabled(_:) | SetAnalyticsCollectionEnabled | setAnalyticsCollectionEnabled(bool), persisted; disabling drops the queue | first release | |
| Collection off by default | none (the switch sets window['ga-disable-<id>'], J:232) | manifest flag | plist flag | at first launch (Windows) | AnalyticsOptions(collectionEnabledByDefault:) | first release | |
ad_user_data, ad_personalization | setConsent J:768 | setConsent(Map) | setConsent(_:) | SetConsent (no-op on Windows) | setConsent(adUserData:, adPersonalization:) with ConsentStatus values, sent as consent; getConsent() reads it back | first release | Sent only after a call (protocol §6). |
analytics_storage | setConsent | setConsent | setConsent | SetConsent | setConsent(analyticsStorage: ConsentStatus.denied): while denied, nothing is queued or sent and appInstanceId is null | first release | The protocol has no field for it, and a client that cannot send cookieless pings must not send at all. Deliberate difference from gtag, which still sends cookieless pings. |
ad_storage | setConsent | setConsent | setConsent | SetConsent | accepted and stored, no effect | first release | The client collects no advertising identifiers. |
functionality_storage, personalization_storage, security_storage | setConsent | none | none | none | accepted by the adapter, no effect | first release (adapter) | Web consent types with no meaning here. |
| On-device conversion (email, phone, hashed) | none | none | initiateOnDeviceConversionMeasurement(…) | four InitiateOnDeviceConversionMeasurementWith… (no-op on Windows) | none | n/a | iOS ads attribution. The protocol's user_data is a different feature (later). |
User-provided data (user_data) | gtag user_data | none | none | none | none | later | Hashed email and phone for ads; needs a clear privacy story first. |
| Feature | JS | Android | iOS | C++ | Dart client | Rank | Notes |
|---|---|---|---|---|---|---|---|
| App active or in background | page visibility | automatic | automatic | none | setAppActive(bool); the adapter hooks AppLifecycleListener | first release | |
| Deep links and attribution | gtag campaign parameters | automatic | handleOpen(_:), handleUserActivity(_:) | none | none | n/a | Install attribution needs the native SDK. |
| Background URL sessions | none | none | handleEvents(forBackgroundURLSession:) | none | none | n/a | iOS only. |
| Audiences for Remote Config, AdMob linking | none | yes | yes | none | none | n/a | Spec section 2. |
Every public method of FlutterFire's FirebaseAnalytics (FF:firebase_analytics/lib/src/firebase_analytics.dart) and what firebase_analytics_dart_platform does with it. The adapter reports every error of the client as firebase_core's FirebaseException with plugin firebase_analytics and the client's code, like the other adapters of the repository. All of it is rank first release (adapter) unless the row says otherwise.
| FlutterFire method | Adapter |
|---|---|
FirebaseAnalytics.instance, instanceFor(app:) | The client built from FirebaseAnalyticsDart.configure(...) for that app. |
isSupported() | true. |
appInstanceId / getAppInstanceId() | appInstanceId. |
getSessionId() | sessionId. |
logEvent(name:, parameters:, callOptions:) | logEvent; callOptions ignored. |
setUserId, setUserProperty | Mapped; callOptions ignored. |
setAnalyticsCollectionEnabled, resetAnalyticsData, setDefaultEventParameters | Mapped. |
setConsent(...), seven flags | adUserData, adPersonalizationSignals, analyticsStorage and adStorage mapped as in the consent table; the three web storage flags accepted and ignored. |
setSessionTimeoutDuration(Duration) | Allowed before the first event of the process (it reconfigures the client); throws StateError with a clear message after it. |
logScreenView(screenName:, screenClass:, parameters:) | logScreenView (sends page_view). |
Typed helpers: logAddPaymentInfo, logAddShippingInfo, logAddToCart, logAddToWishlist, logBeginCheckout, logPurchase, logRefund, logRemoveFromCart, logSelectItem, logSelectPromotion, logViewCart, logViewItem, logViewItemList, logViewPromotion, logEarnVirtualCurrency, logSpendVirtualCurrency, logGenerateLead, logJoinGroup, logLevelStart, logLevelEnd, logLevelUp, logPostScore, logUnlockAchievement, logLogin, logSignUp, logSearch, logViewSearchResults, logSelectContent, logShare, logTutorialBegin, logTutorialComplete, logAppOpen, logCampaignDetails | Nothing to do: FlutterFire's FirebaseAnalytics builds the recommended name and parameters itself and calls the platform's logEvent. |
logAdImpression | Reaches the adapter as logEvent('ad_impression'), which the client refuses: a FirebaseException with plugin firebase_analytics and code reserved-name, since the event is for app streams only (protocol §4). |
logInAppPurchase | FlutterFire calls the platform only on iOS and throws UnimplementedError itself on Windows and Linux. Where the adapter is chosen on iOS, it reaches the adapter as logEvent('in_app_purchase') and gets reserved-name, as above. |
logTransaction(transactionId) (platform logTransaction) | FlutterFire calls the platform only on iOS and macOS. The adapter throws UnimplementedError: StoreKit only. |
initiateOnDeviceConversionMeasurementWithEmailAddress, …PhoneNumber, …HashedEmailAddress, …HashedPhoneNumber (platform initiateOnDeviceConversionMeasurement) | FlutterFire calls the platform only on iOS. The adapter throws UnimplementedError. |
logScreenView sends page_view; screen_view, ad_impression and in_app_purchase are refused (protocol §4, §8).first_open, session_start and the rest are reserved. Sessions are carried by session_id and engagement_time_msec on every event.analytics_storage is denied, nothing is sent; gtag would send cookieless pings.firebase_, google_ and ga_ prefixes are refused for event names too, as the Android SDK documents, although the protocol pages list them for parameters and user properties only.This document compares the public API and the behaviour of the callable-function clients of the official SDKs and of FlutterFire's cloud_functions with cloud_functions_dart (cloud_functions/cloud_functions_dart), feature by feature:
Read from docs/functions_parity.md on origin/main at 9122437c.
packages/functions of firebase-js-sdk at a086865. It is the reference for the protocol, the error mapping and the URL rules.firebase-functions of firebase-android-sdk at 2cfdd03. It is the reference for the stream result shape and for sending the App Check placeholder.FirebaseFunctions of firebase-ios-sdk at cef246f. It is the reference for the rule that tokens do not travel over clear text and for the separate custom-domain parameter.functions of firebase-cpp-sdk at 09d2e7a. Its desktop code speaks the same HTTPS protocol itself; it has no streaming, no custom domain and no timeout.cloud_functions 7.1.0 and cloud_functions_platform_interface 6.2.0 at bbdc38e.cloud_functions_dart 0.1.0 and the FirebaseFunctions it describes. The Dart column states the behaviour of the package as built, and every cell was checked against the code and cites it as DL:path:line; the package has not been run against a deployed project (see the Gaps list). The FlutterFire adapter is not built yet; the FlutterFire column records what it would have to map.The five SDKs were read as source clones on 2026-11-28; their code was read, not run. The behaviour of a Node and a Python callable server was measured on the emulator the same day (firebase-tools 15.18.0, firebase-functions 7.4.0 and 0.6.0). Line numbers will drift. The reasons for each departure from upstream, the alternative that was rejected and the test that pins it are in functions_decisions.md; the Departure column and the notes name the departures as D1 to D28 and the decisions as "decision n".
The Status column compares the Dart behaviour with the SDK named in the cell, or with all of them when it names none:
Columns after Status:
- when the row matches upstream, "not in decisions doc" when the doc has no entry for it.DT:file:line) that asserts the behaviour. no test when none exists; open nit names a check that the test review asked for and that no test makes.- when there is none.Path shorthand:
J: is JS packages/functions/src.A: is Android firebase-functions/src/main/java/com/google/firebase/functions.I: is iOS FirebaseFunctions/Sources.C: is C++ functions/src, CH: is its public headers C:include/firebase and CD: is C:desktop.DL: is cloud_functions/cloud_functions_dart/lib/src of this repository and DT: is cloud_functions/cloud_functions_dart/test.S: is firebase_core/_firebase_transport_dart, the shared package whose token, status-table and SSE rules Functions relies on.Same: Dart has it as the official SDKs do. Different: Dart has it, in another shape or with other behaviour. Missing: a gap Dart could close. Won't do: will not be done, is not needed, makes no sense in Dart or does not apply to it; none of it is a gap. The Status column keeps the doc's wording, including the SDK named in brackets.
97 feature rows in 10 groups.
| Status | Rows |
|---|---|
| same | 53 |
| different | 34 |
| missing | 2 |
| won't do | 8 |
No row has a pending fix; 12 rows have no test (absences or things not built); 1 row keeps an open nit (a review check that no test makes).
FlutterFire's cloud_functions has implementations for Android, iOS, macOS and the web only: on Windows and Linux a call throws MissingPluginException. The C++ SDK's desktop path has no streaming, no custom domain and no timeout. The JS SDK runs in a browser or Node, and the Admin SDKs have no callable client. cloud_functions_dart is a callable-function client for the Dart VM (macOS, Windows, Linux) and the web (dart2js, dart2wasm), with the user's ID token and an App Check token attached, streaming calls, and one way of reporting failures.
What the other SDKs have that this package does not, in 0.1.0:
Firebase-Instance-ID-Token): there is no Messaging package; a function sees request.instanceIdToken as null.withTimeout**: Android's copy of a callable with another timeout; options are immutable here.cloud_functions_dart_platform: planned for a second pull request.| Feature | JS | Android | iOS | C++ | FlutterFire | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Get an instance | getFunctions(app, regionOrCustomDomain), cached per string J:api.ts:46-63, J:config.ts:59-65 | getInstance(app, regionOrCustomDomain), cached per string A:FirebaseFunctions.kt:405-439, A:FunctionsMultiResourceComponent.kt:34-42 | functions(app:region:) and five overloads, cached per app, region and domain I:Functions.swift:84-141, 313-340 | GetInstance(app, region), cached per app and region CH:functions.h:65-83, C:common/functions.cc:58-98 | instanceFor({app, region}) | FirebaseFunctions(app, {region, customDomain, timeout, httpClient, onWarning}), with no test seam (the tests use @visibleForTesting FirebaseFunctions.test); the emulator is FirebaseFunctions.emulator (see Emulator); no cache DL:firebase_functions.dart:50-68 | different | not in decisions doc | no test | - | No instance cache and no global state; two instances are two clients. The FlutterFire adapter (cloud_functions_dart_platform) is not in this tree; it is to cache one per app and region. |
| Default region | us-central1 J:service.ts:35 | us-central1 A:FirebaseFunctions.kt:97, 421 | us-central1 I:Functions.swift:38 | us-central1, also for an empty region C:common/functions.cc:55, 76-80 | us-central1 | region = 'us-central1' DL:firebase_functions.dart:52 | same | - | DT:urls_test.dart:111 | - | |
| Region or custom domain | one string; a parsable URL is the domain, the region stays us-central1 J:service.ts:129-138 | one string; URL() decides A:FirebaseFunctions.kt:85-99 | separate region: and customDomain: overloads I:Functions.swift:104-141 | region only | region may be a URL | separate region (must pass isHostLabel; a : or / gets "use customDomain") and customDomain; ArgumentError when invalid DL:urls.dart:95-106, 147-159, DL:firebase_functions.dart:59-62 | same (iOS) | D21; decision 19 | D21: DT:urls_test.dart:365 (region table), 390 (use customDomain), 449-500 (customDomain) | - | D21: in JS and Android a typo in the region silently becomes a host. The adapter is to do the sniffing FlutterFire needs (not built here). |
| Custom domain URL | origin + pathname, a lone / dropped, so https://x/api/ calls https://x/api//name J:service.ts:131-134, 157-159 | the string as given A:FirebaseFunctions.kt:140-142 | the string as given I:Functions.swift:390-392 | - | as the platform | https, or http to a loopback host; no user info, query or fragment; trailing / and empty path segments removed; the port is kept DL:urls.dart:95-106, 126-140 | different | D22; D20 | D22: DT:urls_test.dart:125, 135, 143, 154, 164; D20 scheme rule: DT:urls_test.dart:427-455, DT:security/hosts_test.dart:190-218 | - | D22. The scheme rule keeps tokens off clear text (D20). |
| Read the configuration back | app, region, customDomain J:public-types.ts:104-121 | private A:FirebaseFunctions.kt:74, 77 | internal region, customDomain I:Functions.swift:59, 62 | app() CH:functions.h:88 | app, region | app, region, customDomain (without trailing slashes), timeout, isClosed; no emulator readback (httpsCallable(name).url shows where calls go) DL:firebase_functions.dart:192-212 | same (JS) | - | DT:urls_test.dart:111, 135, 187; DT:timeout_test.dart:69; DT:api_shape_test.dart:199 | - | |
| Project id | app.options.projectId, unchecked J:service.ts:151 | required at construction A:FirebaseFunctions.kt:71 | fatalError when nil I:Functions.swift:370-372 | project_id() CD:functions_desktop.cc:58 | app.options.projectId: missing or empty is a StateError at the first httpsCallable that needs it (production URL or emulator, not a custom domain); an id that is not one DNS label with the region is an ArgumentError, and . or .. is refused for the emulator DL:urls.dart:28-57, 74-81 | same (Android, iOS) | - | DT:urls_test.dart:225, 247, 307, 323, 350 | - | Fails at the first call that needs it, not at construction, as the shared rule for app options says. JS builds undefined into the URL. | |
| HTTP client | fetchImpl constructor argument (internal) J:service.ts:114 | fixed OkHttpClient() A:FirebaseFunctions.kt:62 | fetcherService, internal initializer I:Functions.swift:342-357 | curl CD:callable_reference_desktop.cc:41 | httpClient:; one is created and owned when absent DL:call_engine.dart:24-25, 66-69 | same (JS) | - | DT:close_test.dart:444, 466, 499 | - | A passed client is not closed by close(). | |
| Delete or close | _delete(): unary calls in flight fail cancelled "Firebase Functions instance was deleted."; streams keep running J:service.ts:122-143, 416-422 | none | none | destructor and DeleteInternal() C:common/functions.cc:118-149 | none | close(): aborts calls and streams in flight (cancelled, "This FirebaseFunctions was closed."), waits for them, closes the owned client; idempotent (the same future); httpsCallable*, call and stream then throw StateError; a stream made before and listened to after it emits the StateError DL:firebase_functions.dart:266-273, DL:call_engine.dart:45-70, DL:streaming.dart:58-70 | different | D8 | D8: DT:close_test.dart:79 (close aborts a stream), 131, 161, 189, 202, 223, 245, 277, 311, 443-522 | - | D8: JS's delete leaves streams running. Every client of this repository has a close(). |
| App deleted mid-call | _delete() on app deletion fails unary calls cancelled "Firebase Functions instance was deleted."; streams keep running J:service.ts:122-143, 416-422 | none | none | destructor and DeleteInternal() C:common/functions.cc:118-149 | app.onDeleteApp runs close(); a call or stream in its token wait or in flight ends cancelled "This FirebaseFunctions was closed.", and the deleted-app StateError of the token wait gets the same mapping; an app deleted in the last microtask before the send, before close() has run, is caught by abortedBeforeSend, which runs in the same synchronous step as the send, so nothing is sent DL:firebase_functions.dart:132, DL:call_engine.dart:57-69, 273-277, DL:streaming.dart:92-97, DL:exception.dart:138-149 | different | D8 | DT:close_test.dart:339, 360, 393, 420; DT:security/leakage_test.dart:568; deleted-app sweep: DT:timeout_test.dart:794 (the app is deleted at every hop from the token's answer to the hop before the send, call and stream); DT:tokens_test.dart:1149 | - | The deletion reaches close() one microtask after FirebaseApp.delete, so the check at the send is the only one that can see an app deleted on the last hop. | |
| Server-side app App Check token | FirebaseServerApp.settings.appCheckToken sent as the App Check token J:context.ts:58-60, 131-133 | - | - | - | none DL:firebase_functions.dart:50-68 | won't do | - | no test | - | A JS server-side-rendering concept. In Dart an AppCheckTokenProvider that returns a fixed token does the same. | |
| Version registration | registerVersion J:config.ts:67-69 | LibraryVersionComponent A:FunctionsRegistrar.kt:65 | - | DEFINE_FIREBASE_VERSION_STRING C:common/functions.cc:53 | none; packageVersion is an internal constant DL:version.dart:3 | won't do | decision 21 | DT:version_test.dart:10 pins the constant to the pubspec; nothing pins the absence of a registration | - | No Functions SDK sends the version on the wire (decision 21); the package registers nothing. | |
| TLS provider update | - | ProviderInstaller.installIfNeededAsync before every call A:FirebaseFunctions.kt:354-396 | - | - | none | won't do | - | no test | - | Google Play services only. | |
| Language idioms | - | Kotlin Firebase.functions, builder lambdas A:Functions.kt:27-66 | Objective-C names, completion handlers I:HTTPSCallable.swift:20-147 | Future, is_valid(), functions() back-pointer CH:functions/callable_reference.h:52-120 | none | won't do | - | no test | - | Language idioms; this package has Future, Stream and Object? values. |
| Feature | JS | Android | iOS | C++ | FlutterFire | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Callable by name | httpsCallable(functions, name, options) J:api.ts:91-105 | getHttpsCallable(name[, options]) A:FirebaseFunctions.kt:104-116 | httpsCallable(_ name:[, options:]); a debug assert for an empty name I:Functions.swift:146-160, 382 | GetHttpsCallable(name[, options]) CH:functions.h:91-96 | httpsCallable(name, {options}) | httpsCallable(name, {options}): 1 to 63 characters, not . or .., none of / ? # % :, whitespace or control characters, else ArgumentError; built as a path segment DL:urls.dart:165-179, 21-57, DL:firebase_functions.dart:214-242 | different | decision 25 | DT:urls_test.dart:219 (encoded segment), 405-447 (name table) | - | Upstream appends the name to the URL unescaped and checks nothing, so a name can change the path. |
| Callable by URL | httpsCallableFromURL(functions, url, options) J:api.ts:112-126 | getHttpsCallableFromUrl(URL[, options]) A:FirebaseFunctions.kt:109-124 | httpsCallable(_ url:[, options:]) I:Functions.swift:165-179 | GetHttpsCallableFromURL(url[, options]) CH:functions.h:99-104 | httpsCallableFromUrl | httpsCallableFromUrl(Uri, {options}): absolute; https, or http to loopback or the configured emulator; no user info, query or fragment; used as given DL:urls.dart:116-140, DL:firebase_functions.dart:244-264 | different | D20; D23 | D23: DT:urls_test.dart:538 (FromUrl refuses query), 554; D20: DT:urls_test.dart:569, 584, 598; DT:security/hosts_test.dart:196-251 | - | D23: a secret in a query would reach logs; D20: an http URL would carry tokens in clear text. |
| Unary call | callable(data) returns {data} J:service.ts:380-465 | call(data), call() return a Task A:HttpsCallableReference.kt:97-125 | call(_:) async, completion forms I:HTTPSCallable.swift:88-166 | Call(), Call(Variant) CH:functions/callable_reference.h:105-111 | call<T>([parameters]) | Future<HttpsCallableResult<T>> call<T>([Object? data]), positional as in FlutterFire, so callable(data) works too; the value is encoded synchronously, so a bad value throws at once DL:https_callable.dart:79-80 | same | - | DT:unary_test.dart:102, 148; DT:serializer_test.dart:167 (synchronous throw); DT:api_shape_test.dart:96 | - | |
| Result object | {data} J:public-types.ts:23-28 | HttpsCallableResult.data A:HttpsCallableResult.kt:17-38 | HTTPSCallableResult.data, NSNull for null I:HTTPSCallable.swift:20-32 | data() CH:functions/callable_result.h:78 | generic T | HttpsCallableResult<T>.data, a T; a response that is not a T fails the call with internal. Without T the type is dynamic; the decoded JSON types are Map<String, Object?>, List<Object?>, int, double DL:https_callable.dart | same | - | DT:serializer_test.dart:774; DT:unary_test.dart:148 | - | |
| Typed request and response layer | generics only, no conversion J:public-types.ts:47-57 | - | Callable<Request, Response> with Codable converters I:Callable+Codable.swift:23-164, I:Functions.swift:192-291 | - | none | none; Object? in and out DL:https_callable.dart:79-80, 209-214 | won't do | decision 23 | no test | - | Decision 23: only iOS has one; a generic cast fails at runtime for narrower types, and converters are user code. |
| Request body | {"data": encode(data)}, undefined as null J:service.ts:386-388 | the same A:FirebaseFunctions.kt:227-232 | the same, nil as NSNull I:Functions.swift:637-641 | the same CD:callable_reference_desktop.cc:322-325 | {"data": <encoded value>}, an absent value as null DL:serializer.dart:60-65 | same | - | DT:unary_test.dart:102; DT:serializer_test.dart:151 | - | ||
| Method and content type | POST, Content-Type: application/json J:service.ts:279-285 | the same A:FirebaseFunctions.kt:231-233 | the same I:Functions.swift:644 | the same CD:callable_reference_desktop.cc:311-312 | POST, Content-Type: application/json with no charset; redirects not followed DL:request.dart:117-134 | same | - | DT:unary_test.dart:102 | - | ||
| Success field | data, then result J:service.ts:445-450 | data, then result A:FirebaseFunctions.kt:301-305 | data, then result I:Functions.swift:731 | result, then data CD:callable_reference_desktop.cc:288-299 | data when the key is present, then result; neither is internal "Response is missing data field." DL:response.dart:156-169 | same (JS, Android, iOS) | decision 22 | DT:unary_test.dart:148, 190, 194 | - | Decision 22. The server sends only result. | |
| Retry | none J:service.ts:380-465 | none | none | none | none | none; a call is never resent, a failed 401 included DL:call_engine.dart:270-319 | same | - | DT:tokens_test.dart:713 (the failed call is not resent); DT:unary_test.dart:629 | - | A callable may not be idempotent. |
| Copy a callable with a new timeout | - | withTimeout(), which shares the options of the original A:HttpsCallableReference.kt:200-204 | - | - | none | none | won't do | - | no test | - | Options are immutable; Android's copy changes the original's timeout too. |
| Feature | JS | Android | iOS | C++ | FlutterFire | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Options type | {timeout, limitedUseAppCheckTokens, signal} J:public-types.ts:63-80 | HttpsCallableOptions.Builder, limited use only A:HttpsCallableOptions.kt:21-57 | HTTPSCallableOptions(requireLimitedUseAppCheckTokens:) I:HTTPSCallableOptions.swift:18-28 | HttpsCallableOptions{limited_use_app_check_token} CH:functions/callable_reference.h:40-46 | immutable HttpsCallableOptions({timeout, limitedUseAppCheckTokens}) DL:https_callable.dart:11-31 | different | decision 14 | DT:options_test.dart:141-196; DT:tokens_test.dart:594 | - | The cancel signal is an argument of call and stream instead (decision 14). | |
| Set the timeout | options.timeout in ms J:public-types.ts:68 | setTimeout, withTimeout A:HttpsCallableReference.kt:182-204 | mutable timeoutInterval I:HTTPSCallable.swift:46-58 | none | HttpsCallableOptions.timeout | the instance's timeout and the option's timeout; HttpsCallable.timeout reads the effective one DL:firebase_functions.dart:275-278, DL:https_callable.dart:53-56 | different | not in decisions doc | DT:options_test.dart:142, 153, 175; DT:timeout_test.dart:97 | - | No setter: configuration is immutable. |
| Default timeout | 70 s J:service.ts:393-394 | 70 s A:HttpsCallOptions.kt:70-71 | 70 s I:HTTPSCallable.swift:46 | none | 60 s | 70 s DL:firebase_functions.dart:54 | same (JS, Android, iOS) | decision 12 | DT:timeout_test.dart:69; DT:options_test.dart:142 | - | Decision 12. The FlutterFire adapter is to pass FlutterFire's 60 s; it is not built here. |
| Timeout bounds | 0 becomes 70 s J:service.ts:394 | any value A:HttpsCallOptions.kt:45-48 | any value I:HTTPSCallable.swift:51-58 | - | zero or negative is an ArgumentError (constructor and options); above 2147483647 ms is clamped DL:request.dart:6-18 | different | D11 | D11: DT:options_test.dart:36 (timeout bounds), 37, 52, 75, 98, 117 | - | D11: JS turns 0 into 70 s silently, and a longer dart2js timer fires at once. | |
| How the timeout acts | Promise.race, the request is not aborted, the timer starts after the tokens J:service.ts:73-90, 391-414 | OkHttp callTimeout and readTimeout A:HttpsCallOptions.kt:60-66 | URLSession idle timeout I:Functions.swift:630-634 | none | passed down | one total deadline from the start of the call, token wait included; aborts the request; deadline-exceeded "The call did not finish within <t>." DL:request.dart:70, DL:call_engine.dart:127-188, 270-319 | different | D9; D10 | D9: DT:timeout_test.dart:141 (deadline aborts the request), 170, 197; D10: DT:timeout_test.dart:218 (slow auth provider counts), 285 | - | D9, D10 and decision 11: JS holds the connection after the timeout, and a slow token provider extends the call past it. |
| Cancel a unary call | options.signal; cancelled "Request was cancelled." J:service.ts:282-299 | none | Swift task cancellation I:Internal/FunctionsContext.swift:47-65 | none | webAbortSignal (web only) | callAbortable<T>(data, {required Future<void> abortTrigger}), a sibling of call: the trigger aborts, cancelled "The call was cancelled."; nothing is sent if it fires during the token wait; a trigger that completes with an error cancels the same way; after the call ended it has no effect; a trigger completed before the call sends nothing DL:request.dart:84-95, DL:https_callable.dart:87-94 | same (JS) | decision 14 | DT:timeout_test.dart:425, 458, 493, 524, 559; DT:api_shape_test.dart:118 | - | Decision 14: the name and type of package:http's AbortableRequest. |
| Cancel or close as the tokens arrive | signal is passed to fetch, so a cancel before the fetch sends nothing J:service.ts:282-299 | - | Swift task cancellation I:Internal/FunctionsContext.swift:47-65 | - | a cancel, a close or an app deletion that lands as the tokens arrive sends nothing, for calls and streams: the abort check (abortedBeforeSend) runs in the same synchronous step as the send; a late token result or provider failure after an abort is dropped DL:call_engine.dart:57-69, 91-141, 273-277, DL:streaming.dart:92-97 | same (JS) | - | sweeps over every hop after the token's answer: DT:timeout_test.dart:702 (close, call), 900 (close, stream), 979 (subscription cancel), 951 (app deletion); the last two hops before the send: DT:tokens_test.dart:1082 (the trigger of a call, a subscription cancel of a stream), 1115 (close), DT:timeout_test.dart:597 (the same); late results dropped: DT:timeout_test.dart:353, 390 | - | The sweeps land the cancel, the close or the deletion at every hop between the token's answer and the send (TokenArrival.sendHop in DT:support/fakes.dart); the single-hop tests pin the last two hops before the send. | |
| Limited-use App Check token | limitedUseAppCheckTokens J:context.ts:128-137 | limitedUseAppCheckTokens A:FirebaseContextProvider.kt:85-88 | requireLimitedUseAppCheckTokens; no header when the provider lacks the method I:Internal/FunctionsContext.swift:78-96 | limited_use_app_check_token CD:callable_reference_desktop.cc:340-344 | limitedUseAppCheckToken | limitedUseAppCheckTokens; a provider that does not implement LimitedUseAppCheckTokenProvider gives no header and one warning DL:https_callable.dart:11-31, DL:call_engine.dart:131,150 | same | decision 16 | DT:tokens_test.dart:594, 614, 629 | - | Decision 16: never falls back to the session token, which the backend would consume. |
| Custom request headers | none | none | none | none | none; only Content-Type, Authorization, X-Firebase-AppCheck and, for a stream, Accept DL:request.dart:117-134 | same | - | DT:unary_test.dart:102 | - |
| Feature | JS | Android | iOS | C++ | FlutterFire | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Accepted request values | any; objects mapped key by key J:serializer.ts:41-70 | null, Number, String, Boolean, JSON types, Map with String keys, List; else IllegalArgumentException A:Serializer.kt:35-111 | NSNull, NSNumber, NSString, NSDictionary, NSArray; else unsupportedType I:Internal/FunctionsSerializer.swift:34-54 | any Variant CD:serialization.cc:25-47 | null, bool, finite num, String, List, Map with String keys; else ArgumentError naming the path and type, never the value DL:serializer.dart:83-103, 139-162 | same (Android, iOS) | - | DT:serializer_test.dart:151, 202, 219, 235, 248, 406 | - | ||
DateTime | Date sent as toISOString() J:serializer.ts:59-61 | refused A:Serializer.kt:110 | refused I:Internal/FunctionsSerializer.swift:51-53 | no date type | ArgumentError naming the path DL:serializer.dart:97-101 | different | D12 | D12: DT:serializer_test.dart:358 | - | D12 and decision 7: never decoded back, Dart's ISO format differs from JS's, and Node turns a Date into {}. | |
| Non-finite numbers | Error J:serializer.ts:48-52, 69 | passed to JSONObject A:Serializer.kt:51-53 | passed to JSONSerialization I:Internal/FunctionsSerializer.swift:102-104 | passed through CD:serialization.cc:46 | ArgumentError, checked before the whole-number branch DL:serializer.dart:106-109 | same (JS) | - | DT:serializer_test.dart:167, 333 | - | Checked before is int, because an infinity passes it on dart2js. | |
| 64-bit integers in requests | never wrapped J:serializer.ts:48-52 | Long as an Int64Value wrapper A:Serializer.kt:39-50 | q as Int64Value, Q as UInt64Value I:Internal/FunctionsSerializer.swift:94-106 | int64 as Int64Value CD:serialization.cc:26-30 | raw digits, never wrapped; an int past 2^53 goes out exact on the VM and dart2wasm DL:serializer.dart:106-118 | same (JS) | decision 4 | DT:serializer_test.dart:297, 310 | - | Decision 4: Node rounds a raw number and a wrapper alike, Python keeps a raw integer exact and hands a wrapper over as a map. The README says to send ids to a Node function as strings. | |
| Whole doubles in requests | JSON.stringify writes 1 J:service.ts:285 | JSONObject A:FirebaseFunctions.kt:230-232 | JSONSerialization I:Functions.swift:640 | VariantToJson CD:callable_reference_desktop.cc:324 | integer digits for a whole double below 1e21 and for -0.0, the same on every compiler DL:serializer.dart:112-116 | same (JS) | decision 30 | DT:serializer_test.dart:181, 278 | - | Decision 30: a typed server cannot read 2.0 into an integer. | |
| Request nesting | no limit | no limit | no limit | no limit | more than 512 levels is an ArgumentError, cycles included DL:serializer.dart:120-126 | different | not in decisions doc | DT:serializer_test.dart:270, 448, 523 | - | Also stops cycles; fails closed. | |
| Wrappers in responses | Number, rounded past 2^53; NaN throws J:serializer.ts:84-95 | Long for both types; out of range is internal "Response contains an invalid value." A:Serializer.kt:126-145, A:FirebaseFunctions.kt:316-331 | Int and UInt; a parse failure throws I:Internal/FunctionsSerializer.swift:108-127 | Int64Value only, strtoull unchecked CD:serialization.cc:49-63 | decoded to int: value must be a string of at most 20 digits within range (UInt64Value at most 2^63 - 1, at most 2^53 - 1 on dart2js), else internal "Response contains an invalid value." DL:serializer.dart:233-246 | same (Android) | decision 5; D14 | DT:serializer_test.dart:539, 603, 627 (dart2js only); DT:browser/functions_browser_test.dart:143; DT:integration/emulator_test.dart:202, 207 | - | Decision 5; D14 from JS: silent rounding of an id is the failure this avoids. No measured server sends wrappers. | |
Unknown @type in responses | throws J:serializer.ts:96-98 | kept as a map A:Serializer.kt:146-155 | kept as a map I:Internal/FunctionsSerializer.swift:65-74 | kept as a map CD:serialization.cc:52-71 | kept as a map DL:serializer.dart:204-209 | same (Android, iOS, C++) | D13 | D13: DT:serializer_test.dart:649; DT:browser/functions_browser_test.dart:171; DT:integration/emulator_test.dart:215 | - | D13 from JS: with JS such user data can never be returned. | |
| Response nesting | no limit | no limit | no limit | no limit | a value more than 512 levels deep is internal "Response is nested more than 512 levels deep."; the value counts, the envelope around it does not; one depth scan per body DL:serializer.dart:11-16, 197-202, DL:response.dart:36-48 | different | not in decisions doc | DT:serializer_test.dart:465, 511 | - | Bounds memory and stack against a hostile server. A too-deep 401 body is not a bare 401 (see Forced token refresh). | |
| NaN and infinities in responses | response.json() throws, so a callable answer with NaN is not valid JSON J:service.ts:435-443 | the same A:FirebaseFunctions.kt:287-300 | a parse failure I:Functions.swift:722-728 | not read CD:callable_reference_desktop.cc:241-246 | a bare NaN or Infinity is not JSON: on 2xx internal "Response is not valid JSON. A non-finite number such as NaN, which a Python function can send, is one cause."; on non-2xx the status table decides DL:response.dart:20-22, 103-109 | different | decision 32 | DT:serializer_test.dart:758, 764 | - | The codes match JS; the message names the likely cause. Node answers 500 for the same value. |
| Feature | JS | Android | iOS | C++ | FlutterFire | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Error type | FunctionsError, code functions/<code>, details, customData.url, cause J:error.ts:58-92 | FirebaseFunctionsException: code, details, cause A:FirebaseFunctionsException.kt:24-184 | NSError in com.firebase.functions, userInfo details, region, url I:FunctionsError.swift:18-21, 157-236 | Error code and message; details decoded but dropped CD:callable_reference_desktop.cc:267-270, 302-304 | FirebaseFunctionsException | FirebaseFunctionsException extends FirebaseException, plugin firebase_functions: code, errorCode, message, details, httpStatus; no cause; the constructor takes a stackTrace that the package never sets DL:exception.dart | different | D16 | D16: DT:errors_test.dart:154 (message and httpStatus); equality: DT:errors_test.dart:198 | - | D16: httpStatus replaces JS's [<status>] suffix. No URL is kept, and no exception of the transport package or package:http reaches a caller, since their text prints the URL. Equality is FirebaseException's and symmetric (commit 909a38db). |
| Codes | 17 codes, ok included J:public-types.ts:128-145 | the same 17 A:FirebaseFunctionsException.kt:30-106 | the same 17 I:FunctionsError.swift:28-102 | the same 17 CH:functions/common.h:26-182 | 16 kebab-case codes (ok is never thrown); FirebaseFunctionsException.errorCode gives them as the enum FunctionsErrorCode, with unknown for a code this version does not know DL:exception.dart:69-137 | same | - | DT:errors_test.dart:231 | - | ||
| Envelope on any status | the body is checked on every response J:service.ts:424-433 | the same A:FirebaseFunctions.kt:282-286 | the same I:Functions.swift:707-717 | the same CD:callable_reference_desktop.cc:248-284 | the envelope decides on 2xx and non-2xx alike; the HTTP status only when there is none; the list form [{"error": ...}] counts DL:response.dart:103-145 | same | - | DT:unary_test.dart:304, 387, 412; DT:stream_test.dart:1010 | - | The server sends 409 for both ALREADY_EXISTS and ABORTED. | |
| Success statuses | any 2xx J:error.ts:103-106 | 200 only | 200 only | 200 only | any 2xx DL:response.dart:78 | same (JS) | - | DT:unary_test.dart:241, 253 (204) | - | ||
| Code from the status name | exact map; an unknown name is internal "Unknown backend error status" J:error.ts:30-49, 156-170 | Code.valueOf; unknown is INTERNAL A:FirebaseFunctionsException.kt:207-229 | unknown is internal, message and details dropped I:FunctionsError.swift:130-151, 196-203 | unknown is Internal, details cleared CD:callable_reference_desktop.cc:151-222, 272-281 | exact and case-sensitive; an unknown string is internal "Unknown backend error status."; an absent or non-string status uses the HTTP table DL:response.dart:199-214 | same (JS) | - | DT:unary_test.dart:468, 505 | - | ||
| Code from the HTTP status | any 2xx ok; 409 aborted; other unknown J:error.ts:102-136 | 200 only; 409 ABORTED; other UNKNOWN A:FirebaseFunctionsException.kt:136-153 | 200 only; 409 alreadyExists; other internal I:FunctionsError.swift:112-128 | 200 only; 409 Aborted; other Unknown CD:callable_reference_desktop.cc:119-147 | JS's table plus 416 out-of-range; any 2xx is success DL:response.dart:138-144, S:lib/src/rpc_status.dart:98-111 | same (JS) | decision 8 | DT:unary_test.dart:594, 695 | - | Decision 8. The 416 row is the shared table's; no callable server sends 416. | |
| Body that is not callable JSON | internal "Response is not valid JSON object." J:service.ts:435-443 | the same A:FirebaseFunctions.kt:287-300 | internal "Response was not a dictionary." I:Functions.swift:722-728 | Internal "INTERNAL" CD:callable_reference_desktop.cc:241-246 | on 2xx internal, "Response is not valid JSON. ..." or "Response is not a JSON object."; on non-2xx the HTTP table with the message "The server answered HTTP <n> without a callable error body.", so the body parser's 400 page is invalid-argument and the router's 404 page not-found DL:response.dart:103-145 | same (JS) | decision 26 | DT:unary_test.dart:213, 241, 253, 541, 554, 571 | - | Decision 26: the status is the only information in such a body. JS reaches the same codes through its status table. | |
| Message | message, else "Backend error status: X", with [<http>] appended J:error.ts:174-204 | message if not empty, else the code name A:FirebaseFunctionsException.kt:216-218 | message, else the code text I:FunctionsError.swift:206-210, 238-258 | message, else a fixed text CD:callable_reference_desktop.cc:260-265 | the server's message with control characters removed and at most 1 KiB, else "Backend error status: <STATUS>." (the status text, or the code when the status is not a string); no suffix DL:response.dart:218-225 | different | D16; D17 | D16: DT:errors_test.dart:154; D17: DT:errors_test.dart:114; DT:unary_test.dart:505 | - | D16 and D17: JS passes control characters through and mixes server text with transport data. | |
| Details | decoded J:error.ts:182-185 | decoded A:FirebaseFunctionsException.kt:219-222 | decoded, or raw when decoding fails; dropped with the message for INTERNAL I:FunctionsError.swift:196-218 | decoded, not exposed CD:callable_reference_desktop.cc:267-270 | decoded and kept for every code, INTERNAL included; a decode failure is internal DL:response.dart:215-217 | same (JS, Android) | - | DT:errors_test.dart:154; DT:serializer_test.dart:668; DT:unary_test.dart:387 | - | iOS drops them for INTERNAL. | |
Server text in toString | [firebase_functions/<code>] <message> (HTTP <status>); never details DL:exception.dart | different | not in decisions doc | DT:errors_test.dart:154 (the details marker is absent from toString) | - | ||||||
Envelope with status OK | no error, then the data field is required J:error.ts:191-196, J:service.ts:451-459 | no error A:FirebaseFunctionsException.kt:230-234 | no error I:FunctionsError.swift:221-226 | kErrorNone, the data not read CD:callable_reference_desktop.cc:248-255, 272-286 | no error, then internal "Response is missing data field." when there is no result; with a result it is a success, on any HTTP status DL:response.dart:113-120, 129-135 | same (JS) | decision 9 | DT:unary_test.dart:260 | - | Decision 9: HttpsError("ok") sends no result. | |
| Network failure | status 0, internal, with cause J:service.ts:300-308, J:error.ts:108-110 | IOException is INTERNAL A:FirebaseFunctions.kt:258-267 | the raw NSError I:Functions.swift:681-697 | from the curl response status CD:callable_reference_desktop.cc:230 | unavailable, "The request did not reach the server, or the connection broke.", plus a CORS sentence on the web; no cause DL:exception.dart:145, 153-162 | different | D15; decision 10 | D15: DT:errors_test.dart:255; DT:errors_test.dart:533 (VM, no suffix); DT:browser/functions_browser_test.dart:79 (web suffix) | - | D15: internal is the code for function bugs. On the web a response without CORS headers looks the same. | |
| Timeout error | deadline-exceeded, message deadline-exceeded J:service.ts:81 | InterruptedIOException is DEADLINE_EXCEEDED A:FirebaseFunctions.kt:249-257 | NSURLErrorTimedOut is deadlineExceeded I:Functions.swift:692-693 | none | deadline-exceeded, "The call did not finish within <t>." DL:exception.dart:104-121, DL:call_engine.dart:230-232 | same | - | DT:timeout_test.dart:69, 141; DT:errors_test.dart:512 | - | ||
| Programmer errors | Error J:serializer.ts:69 | IllegalArgumentException A:Serializer.kt:110 | unsupportedType I:Internal/FunctionsSerializer.swift:52 | none | ArgumentError and StateError, thrown synchronously DL:https_callable.dart:120-130, DL:call_engine.dart:48-52 | different | decision 25 | DT:serializer_test.dart:235, 248, 358; DT:urls_test.dart:448; DT:close_test.dart:245, 277 | - | Decision 25: programmer errors are not server errors. The adapter (not built here) is to map them to invalid-argument and internal. | |
| Response size caps | none: response.json() J:service.ts:313 | none: body.string() A:FirebaseFunctions.kt:275 | none | none | 2xx body 32 MiB, non-2xx body 1 MiB; over the cap is internal "Response is larger than 32 MiB." (an error body is cut and mapped by its HTTP status) DL:response.dart:14-17, DL:exception.dart:149 | different | D25 | D25: DT:security/limits_test.dart:98 (endless 2xx body), 116, 129, 162, 192, 212; DT:unary_test.dart:668 | - | D25: a hostile or broken server could exhaust memory. A 2xx cap stops a unary call without an httpStatus; the stream cases carry the status (DL:streaming.dart:157). |
| Feature | JS | Android | iOS | C++ | FlutterFire | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|---|---|
| API | callable.stream(data, options) returns {stream, data} J:service.ts:205-210, J:public-types.ts:34-57 | stream(data) returns Publisher<StreamResponse> A:HttpsCallableReference.kt:167-174 | Callable.stream(_:) returns AsyncThrowingStream; the raw HTTPSCallable.stream is internal I:Callable+Codable.swift:221-328, I:HTTPSCallable.swift:168-171 | none | Stream<StreamResponse{Chunk,Result}> | Stream<CallableStreamEvent> stream([Object? data]), single-subscription, sent when listened to; no trigger: cancel the subscription DL:https_callable.dart:107-108, DL:streaming.dart:32-70 | same (Android) | decision 2 | DT:stream_test.dart:383, 1262, 1275; DT:api_shape_test.dart:96 | - | Decision 2: in 0.1.0, as its own phase. |
| Final result | a separate data promise; not in the stream J:service.ts:639-642 | StreamResponse.Result as the last item A:PublisherStream.kt:253-259, A:StreamResponse.kt:26-57 | .result only when the response type is StreamResponse I:Callable+Codable.swift:176-218, 296-306 | none | Stream<StreamResponse{Chunk,Result}> | CallableMessage per chunk, CallableResult as the last event DL:https_callable.dart:168-186, DL:streaming.dart:230-253 | same (Android) | decision 3 | DT:stream_test.dart:383, 459 | - | Decision 3: one subscription owns one request; the FlutterFire adapter (not built here) is to map it directly. |
| Request | Accept: text/event-stream J:service.ts:500-502 | the same A:PublisherStream.kt:139-152 | the same I:Functions.swift:590-593 | none | the unary headers plus Accept: text/event-stream, exact value DL:request.dart:129-131 | same | - | DT:stream_test.dart:1288 | - | The server streams only for that exact value. | |
| HTTP status check | none: a non-2xx body has no data: line and data never settles J:service.ts:504-603 | a 404 HTML page is NOT_FOUND, else INTERNAL A:PublisherStream.kt:307-344 | non-200 takes its code from the status, body not read I:Functions.swift:468-479 | none | a non-2xx answer is read (1 MiB) and mapped as a unary response DL:streaming.dart:142-153 | different | D1 | D1: DT:stream_test.dart:1065 (non-2xx HTML becomes not-found), 1012 | - | D1: a router or front end answers outside the callable layer. | |
| JSON answer to a stream request | no data: line; data never settles J:service.ts:627-636 | non-data: lines ignored; never completes A:PublisherStream.kt:207-219 | a non-data: line is dataLoss I:Functions.swift:488-496 | none | a 2xx application/json answer (parameters and case ignored) gives one CallableResult or the error; a body without a content type is read as events DL:streaming.dart:154-161, 352-359 | different | D3 | D3: DT:stream_test.dart:1083 (JSON answer to a stream request), 1132; DT:security/limits_test.dart:142 | - | D3: Node answers JSON when Accept is not exact, Python always does. | |
| Line framing | ^data: with a space; other lines ignored J:service.ts:37, 627-636 | data: or result: lines joined until a blank line A:PublisherStream.kt:199-219 | data: lines; comments skipped; any other line is dataLoss I:Functions.swift:482-496 | none | the shared SseDecoder: strict UTF-8, LF, CR or CRLF; comments give nothing; other fields ignored DL:streaming.dart:187-213 | different | decision 6 | DT:stream_test.dart:306-311 (shared cases), 650, 688, 714, 739; open nit: only two of the shared cases carry callable events | - | Decision 6: follows the server as measured; the SDKs disagree on spacing, joining and strictness. | |
| Event keys | result, message, error J:service.ts:639-652 | message, error, result A:PublisherStream.kt:235-259 | error, then result, message; neither is dataLoss I:Functions.swift:532-557 | none | result, message, error; an object with none (data: {}) is ignored DL:streaming.dart:230-253 | same (JS) | decision 6 | DT:stream_test.dart:443, 451, 459 | - | Decision 6: sendChunk(undefined) sends data: {}. | |
| Error event | the status decides J:service.ts:647-651 | always INTERNAL A:PublisherStream.kt:242-251 | the status decides I:Functions.swift:532-534, 707-717 | none | as a unary envelope; a missing or non-string status is internal; an unknown status string is internal "Unknown backend error status."; status OK is internal "The server sent an error event with status OK." DL:streaming.dart:276-289, DL:response.dart:190-226 | different | D5 | D5: DT:stream_test.dart:611 (error frame with status OK), 507, 593 | - | D5: for OK JS rejects with null. | |
| Event that is not JSON | ignored J:service.ts:653-660 | INTERNAL "Invalid JSON" A:PublisherStream.kt:261-268 | dataLoss I:Functions.swift:536-541 | none | internal "The server sent an event that is not valid JSON." (a JSON value that is not an object, empty data and invalid UTF-8 included), and the stream closes DL:streaming.dart:215-226, 255-272 | same (Android, iOS) | D4 | D4: DT:stream_test.dart:628 (invalid event), 650 | - | D4 from JS: the server never sends one, so it means corruption. | |
| End without a result | the stream closes, data never settles J:service.ts:682-689 | never completes A:PublisherStream.kt:199-230 | finishes without a result I:Functions.swift:523 | none | internal "The stream ended before the function returned a result."; a frame cut at the end gives the same DL:streaming.dart:201-206, 220 | different | D2 | D2: DT:stream_test.dart:1139 (ends without result), 667 | - | Departure 2. | |
| After the result | keeps reading J:service.ts:639-642, 703-711 | completes A:PublisherStream.kt:253-258 | keeps reading I:Functions.swift:482-509 | none | stops reading and aborts the request DL:streaming.dart:316-344 | same (Android) | D7 | D7: DT:stream_test.dart:473 (nothing after result) | - | D7 from JS. | |
| Stream timeout | none J:public-types.ts:86-98 | the 70 s call timeout bounds the whole stream A:PublisherStream.kt:133, A:HttpsCallOptions.kt:60-66 | idle timeoutInterval I:Functions.swift:578-582 | none | the time left bounds the headers ("No response arrived within <t>."); an idle timeout of timeout ("The stream sent nothing for <t>."), restarted by every chunk (pings included) and paused with the subscription DL:streaming.dart:112-135, 187-213 | same (iOS) | D6; decision 13 | D6: DT:stream_test.dart:772 (idle timeout, heartbeat resets it), 982 (long stream with pings), 750, 800, 842, 867, 891, 925; DT:timeout_test.dart:282; DT:stream_test.dart:950 (the timer runs again after resume) | - | D6 and decision 13: long streams are legitimate, silence is not. | |
| Cancel a stream | signal; the iterator's return() J:service.ts:556-597, 669-702 | Subscription.cancel() delivers CANCELLED and cancels the call A:PublisherStream.kt:93-113, 188-197 | the task is cancelled on termination I:Functions.swift:525-527 | none | cancelling the subscription aborts without an error, also during the token wait (nothing is sent); stream has no abortTrigger; close() gives cancelled "closed" DL:streaming.dart:58-87 | same (iOS) | - | DT:stream_test.dart:1196, 1218, 1239; DT:close_test.dart:79; DT:timeout_test.dart:597, 822 | - | ||
| Backpressure | ReadableStream pull J:service.ts:664-725 | request(n) with an unbounded queue A:PublisherStream.kt:51-91, 272-283 | AsyncThrowingStream buffering I:Functions.swift:424 | none | pausing the subscription pauses reading the body and the idle timer DL:streaming.dart:37-43, 209-212 | same (JS) | - | DT:stream_test.dart:923; DT:close_test.dart:161 | - | ||
| Subscribers | one reader J:service.ts:586-600 | many; a late one gets CANCELLED A:PublisherStream.kt:57-70 | one consumer I:Functions.swift:424-528 | none | single-subscription; a second listen is a StateError DL:streaming.dart:37 | same (JS, iOS) | - | DT:stream_test.dart:1262 | - | ||
| Stream caps | none | none | none | none | 32 MiB per event ("Response is larger than 32 MiB.") and 1 GiB per stream ("The stream is larger than 1 GiB."), both internal DL:streaming.dart:19, 190, 222-223 | different | D25 | D25: DT:stream_test.dart:1150, 1171; DT:security/limits_test.dart:272, 297 | - | D25: guards against an endless body; the idle timeout bounds silence. | |
| Availability | all | all | macOS 12, watchOS 8 and later I:Functions.swift:418 | none | web | VM, dart2js and dart2wasm DL:platform.dart:7-12 | same (JS, Android) | - | DT:web_compile_test.dart:18, DT:web_imports_test.dart:17 (compile and import checks); DT:browser/functions_browser_test.dart:100, 123 (a browser and the emulator; not in the VM run) | - | package:http 1.6.0 streams fetch bodies on the web. |
| Feature | JS | Android | iOS | C++ | FlutterFire | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|---|---|
| API | connectFunctionsEmulator(functions, host, port) J:api.ts:74-84 | useEmulator(host, port); deprecated useFunctionsEmulator(origin) A:FirebaseFunctions.kt:150-166 | useEmulator(withHost:port:) I:Functions.swift:300-306 | UseFunctionsEmulator(origin) CH:functions.h:107 | useFunctionsEmulator(host, port) | FirebaseFunctions.emulator(app, {host = 'localhost', required port, region, timeout, httpClient, onWarning}) named constructor, no record or emulator value type; EmulatorHost refuses a host that is a scheme, a path, user info or a Google host, and port 0 or above 65535 DL:firebase_functions.dart:81-98 | different | decision 20 | DT:urls_test.dart:632-693; DT:api_shape_test.dart:139-197; DT:security/hosts_test.dart:280 | - | Configuration is immutable; one parser serves the URL builder and the token rule (decision 20). |
| URL | <origin>/<projectId>/<region>/<name> J:service.ts:152-155 | http://host:port/<projectId>/<region>/<name> A:FirebaseFunctions.kt:134-139 | the same I:Functions.swift:385-387 | the same CD:functions_desktop.cc:57-63 | http://host:port/<projectId>/<region>/<name>, each part an encoded path segment DL:urls.dart:28-39 | same | - | DT:urls_test.dart:187, 197 | - | ||
| Emulator and custom domain | the emulator wins J:service.ts:152-160 | the emulator wins A:FirebaseFunctions.kt:140-142 | the emulator wins I:Functions.swift:385-392 | - | the emulator wins DL:urls.dart:28-45 | same | - | DT:urls_test.dart:208 | - | ||
| Emulator and a callable by URL | not rewritten J:service.ts:220-242 | not rewritten A:HttpsCallableReference.kt:51-56 | not rewritten I:Functions.swift:165-167 | not rewritten CD:functions_desktop.cc:51-55 | not rewritten DL:firebase_functions.dart:244-264 | same | decision 20 | DT:urls_test.dart:509, 526, 584 | - | D20. | |
| From the environment | getFunctions connects from getDefaultEmulatorHostnameAndPort('functions') J:api.ts:58-61 | none | none | none | none | the static FirebaseFunctions.emulatorFromEnvironment(app, ...) reads FIREBASE_FUNCTIONS_EMULATOR_HOST and returns a FirebaseFunctions.emulator, or null when it is not set and on the web DL:firebase_functions.dart:168-189 | different | decision 20 | DT:urls_test.dart:673 (child VM processes with the variable set, padded, empty and unset) | - | Decision 20: never read implicitly. firebase-tools exports no variable for Functions. |
| Cloud Workstations emulator over https | https, a /backends ping, credentials: 'include' J:service.ts:179-186, 244-251 | - | - | - | none | none | won't do | - | no test | - | A JS-only convenience for one hosted IDE. |
| Feature | JS | Android | iOS | C++ | FlutterFire | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Auth header | Authorization: Bearer <token> J:service.ts:348-350 | the same A:FirebaseFunctions.kt:234-236 | the same I:Functions.swift:655-658 | the same CD:callable_reference_desktop.cc:315-319 | Authorization: Bearer <token> from app.authProvider, through the shared TokenSource DL:request.dart:132, DL:firebase_functions.dart:136-156 | same | - | DT:tokens_test.dart:204; DT:unary_test.dart:102 | - | ||
| Auth token failure | any error dropped; the call goes out signed out J:context.ts:94-106 | no user is fine, other errors fail the call A:FirebaseContextProvider.kt:67-83 | errors fail the call I:Internal/FunctionsContext.swift:43, 55-56 | an empty token sends no header CD:callable_reference_desktop.cc:93-99, 315-319 | no provider or no user: no header; a provider error is unauthenticated, a 10 s silence unavailable, a token over 8192 characters or with CR/LF fails the call DL:exception.dart:164-182, S:lib/src/tokens.dart:251 | same (Android, iOS) | D18 | D18: DT:tokens_test.dart:218 (provider error fails the call), 434 (slow provider is unavailable), 269, 285, 297; DT:errors_test.dart:376 | - | D18 and decision 15: a call that goes out anonymously hides the error. The timeout and length rules are the shared package's. | |
| Forced token refresh | never J:context.ts:100 | getAccessToken(false) A:FirebaseContextProvider.kt:69 | forcingRefresh: false I:Internal/FunctionsContext.swift:43 | none | after a transport 401 without a callable envelope to a request that carried an Auth token, the next call forces a refresh, at most once per 60 s; the failed call is not resent; a 401 whose body is too deep to decode is not bare, in the object and the list form alike DL:response.dart:84-100, DL:call_engine.dart:190-201, S:lib/src/tokens.dart:254 | different | D26; decision 17 | D26: DT:tokens_test.dart:713 (bare 401 forces an Auth refresh), 784, 811 (401 envelope does not), 897; DT:tokens_test.dart:862 (a too-deep 401, object and list form: no forced refresh, the failed call is not resent) | - | D26: defensive and unmeasured (kit check K12); never for an UNAUTHENTICATED envelope, which may be the application's own answer, nor for a body too deep to decode, which most likely came from the callable server. | |
| App Check header | X-Firebase-AppCheck J:service.ts:354-356 | the same A:FirebaseFunctions.kt:240-242 | the same I:Functions.swift:32, 664-676 | the same CD:callable_reference_desktop.cc:349-353 | X-Firebase-AppCheck from app.appCheckProvider DL:request.dart:132 | same | - | DT:tokens_test.dart:204; DT:security/hosts_test.dart:129 | - | ||
| App Check failure | header omitted when the result has an error J:context.ts:138-143 | the placeholder is sent, with a warning A:FirebaseContextProvider.kt:89-95 | the placeholder is sent I:Internal/FunctionsContext.swift:71-75, 91-94 | whatever string the future holds CD:callable_reference_desktop.cc:349-353 | the placeholder or an unexpired token is sent, with a warning; empty, a throw or a timeout sends no header (so does a CR/LF token); never fails the call S:lib/src/tokens.dart | same (Android, iOS) | D19 | D19: DT:tokens_test.dart:543 (placeholder sent), 569, 320, 166, 508 | - | D19 and decision 15: the placeholder lets the backend see that attestation failed. | |
| Token fetch | sequential J:context.ts:149-154 | in parallel A:FirebaseContextProvider.kt:57-65 | in parallel I:Internal/FunctionsContext.swift:43-45 | App Check asynchronous, Auth synchronous CD:callable_reference_desktop.cc:315, 340-346 | in parallel, once per call, inside the call's timeout DL:call_engine.dart:112-188, S:lib/src/tokens.dart:616 | same (Android, iOS) | - | S:test/tokens_test.dart:392 (providers asked in parallel); DT:tokens_test.dart:364 | - | ||
| Tokens over plain http | always attached J:service.ts:340-358 | always attached A:FirebaseFunctions.kt:233-242 | only to https or loopback, else unauthenticated; a debug-only allowInsecureTokenAttachment I:Functions.swift:73-79, 743-786 | always attached CD:callable_reference_desktop.cc:315-319 | allowInsecureTokenAttachment (Apple debug only) | an http URL only to loopback or the configured emulator, refused at creation with ArgumentError; a LAN emulator gets its tokens with one warning DL:urls.dart:95-124, DL:firebase_functions.dart:136-156 | different | D20; decision 18 | D20: DT:urls_test.dart:598 (http to another host refused); DT:security/hosts_test.dart:127-315; warning: DT:tokens_test.dart:979, 1003, 1021 | - | D20: JS and Android send tokens in clear text to any http URL; unlike iOS the call fails at the line that is wrong, and a configured emulator still works. |
| Token destination check at send | - | - | unauthenticated when the host is not https or loopback I:Functions.swift:743-786 | - | tokens are fetched only for an origin the instance declared (production host, custom domain) or the application chose by httpsCallableFromUrl; otherwise failed-precondition "Tokens may not be sent to this URL." and nothing is sent DL:call_engine.dart:127-155, DL:request.dart:132 | different | D20; decision 18 | DT:tokens_test.dart:918, 933, 957 | - | A second line behind the creation checks; the code is the shared one. | |
| FCM token header | Firebase-Instance-ID-Token with notification permission J:context.ts:108-126, J:service.ts:351-353 | from FirebaseInstanceIdInternal A:FirebaseContextProvider.kt:62, A:FirebaseFunctions.kt:237-239 | messaging?.fcmToken I:Internal/FunctionsContext.swift:57, I:Functions.swift:660-662 | none | none; the request never carries Firebase-Instance-ID-Token DL:request.dart:117-134 | missing | decision 24 | DT:unary_test.dart:135-146 (the header is absent) | - | Decision 24: this SDK has no Messaging package; listed as a gap, with no phase named. The server's request.instanceIdToken will be null. | |
| App Check auto-refresh listener | - | a no-op addAppCheckTokenListener so App Check keeps refreshing A:FirebaseContextProvider.kt:46-55 | - | - | none | won't do | - | no test | - | Refresh is the App Check provider's job in firebase_app_dart. |
| Feature | JS | Android | iOS | C++ | FlutterFire | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Transport | HTTPS fetch J:service.ts:283-289 | OkHttp A:FirebaseFunctions.kt:243-246 | GTMSessionFetcher; URLSession for streams I:Functions.swift:447, 635 | curl CD:callable_reference_desktop.cc:41-42 | package:http: IOClient on the VM, the fetch BrowserClient on the web DL:call_engine.dart:25 | same | decision 1 | no test of the client choice (DT:web_compile_test.dart:18 compiles the web build) | - | Decision 1: no gRPC service exists for callables. | |
| Client-identification headers | none | none | none | none | no X-Firebase-Client, X-Firebase-GMPID, x-goog-api-key, x-goog-api-client or User-Agent override DL:request.dart:117-134 | same | decision 21 | DT:unary_test.dart:135-146 | - | D21. | |
| Redirects | followed (fetch default) J:service.ts:283-289 | followed (OkHttp default) A:FirebaseFunctions.kt:243 | followed (URLSession default) I:Functions.swift:630-635 | curl default CD:callable_reference_desktop.cc:310-312 | refused: a 3xx is unavailable and the Location is never requested DL:request.dart:126 | different | D24 | D24: DT:security/hosts_test.dart:317 (3xx not followed), 368, 394; DT:unary_test.dart:629; DT:errors_test.dart:495 | - | D24: a redirect may carry the Authorization header to another host. | |
| Logging | none | a warning on an App Check error A:FirebaseContextProvider.kt:91 | a warning for refused tokens I:Functions.swift:759-764 | LogDebug of the URL, the request body and the response body CD:callable_reference_desktop.cc:240, 327-328 | only the TokenSource warnings through onWarning, default dart:developer log; no token, URL, body or server text DL:firebase_functions.dart:294-296 | different | not in decisions doc | DT:tokens_test.dart:978-1019 (warnings once, default sink is not print: 997); DT:security/leakage_test.dart:374, 612, 660, 710, 829 | - | C++ logs user data; Functions logs nothing of its own. |
| Feature | JS | Android | iOS | C++ | FlutterFire | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Windows and Linux | no | desktop REST, no streaming, no custom domain, no timeout | no implementation (MissingPluginException) | the Dart VM | different | not in decisions doc | no test (a platform fact) | - | The reason this package exists. | ||
| Servers and command-line tools | Node (the Admin SDK has no callable client) | the Dart VM | same | - | no test | - | |||||
| FlutterFire adapter | cloud_functions_platform_interface | cloud_functions_dart_platform, planned for the second pull request | missing | decision 28 | no test (not built) | - | Not part of 0.1.0. Decision 28: it is to register itself on Linux and Windows. |
The emulator fixture (tool/functions_emulator) and the production kit (tool/verify_production_functions, whose code is cloud_functions/cloud_functions_dart/tool/verify_production.dart) are test tools, not features; the kit has not been run against a real project.
This document compares the public API and the behaviour of the App Check clients of four official SDKs with firebase_app_check_dart (firebase_app_check/firebase_app_check_dart), feature by feature:
Read from docs/app_check_parity.md on origin/main at 9122437c.
packages/app-check of firebase-js-sdk at a086865. It is the reference for the protocol.appcheck of firebase-android-sdk at 2cfdd03 (the firebase-appcheck, -debug, -debug-testing, -interop, -playintegrity and -recaptcha modules). It is the reference for the gating scope.FirebaseAppCheck of firebase-ios-sdk at cef246f, and the core it wraps, AppCheckCore and AppCheckRecaptchaProvider of google/app-check at b5dc4a3. It is the reference for the expiry origin; Android and iOS together for token validity.app_check of firebase-cpp-sdk at 09d2e7a. Its desktop code (CD:) has only the debug provider and speaks REST itself; the mobile builds wrap the native SDKs.firebase_app_check_dart 0.1.0. The Dart column states the behaviour of the package; it was checked against the code. To read a row quickly, start with the Dart and Notes columns.The four SDKs were read as source clones on 2026-11-28; their code was read, not run. Line numbers will drift. The reasons for each departure from upstream and the alternatives that were rejected are in app_check_decisions.md. How to use the package is in the guide.
The Status column compares the Dart behaviour with the SDK named in the cell, or with all of them when it names none:
Columns after Status:
- when the row matches upstream, "not in decisions doc" when the doc has no entry for it.DT:file:line) that asserts the behaviour. no test when none exists; open nit names a check that the test review asked for and that no test makes.- when there is none.Path shorthand:
J: is JS packages/app-check/src, and JU: is packages/util/src.A: is Android appcheck/firebase-appcheck/src/main/java/com/google/firebase/appcheck, and AI: is A:internal. AD:, AP:, AR: and AX: are the same package path in the firebase-appcheck-debug (.../appcheck/debug), -playintegrity (.../appcheck/playintegrity), -recaptcha (.../appcheck/recaptcha) and -interop (.../appcheck) modules.I: is iOS FirebaseAppCheck/Sources, and IH: is I:Public/FirebaseAppCheck. G: is AppCheckCore/Sources and GR: is AppCheckRecaptchaProvider/Sources of google/app-check.C: is C++ app_check/src, CH: is C:include/firebase and CD: is C:desktop.DL: is firebase_app_check/firebase_app_check_dart/lib/src of this repository (the environment reader is lib/src/environment_io.dart), and DT: is firebase_app_check/firebase_app_check_dart/test.Same: Dart has it as the official SDKs do. Different: Dart has it, in another shape or with other behaviour. Missing: a gap Dart could close. Won't do: will not be done, is not needed, makes no sense in Dart or does not apply to it; none of it is a gap. The Status column keeps the doc's wording, including the SDK named in brackets.
96 feature rows in 12 groups.
| Status | Rows |
|---|---|
| same | 30 |
| different | 52 |
| missing | 2 |
| won't do | 12 |
No row has a pending fix; 16 rows have no test (absences or things not built); 1 row keeps an open nit (a review check that no test makes).
FlutterFire's firebase_app_check has no Linux implementation. On Windows it offers only the C++ debug provider, which keeps the token in memory, never refreshes it in the background (CD:app_check_desktop.cc:32-36,154-188) and has no custom provider. On a desktop or a server no attestation service exists, so the only providers that can work there are debug and custom. firebase_app_check_dart is an App Check client for the Dart VM (macOS, Windows, Linux) and the web (dart2js, dart2wasm) with those two providers, automatic refresh, rate control, optional persistence and installation on the app's token seam, which Firestore, Auth, Database, Storage and the later products read.
| Feature | JS | Android | iOS | C++ | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|---|
| Get an instance | initializeAppCheck(app, options) J:api.ts:66-120 | getInstance(app) A:FirebaseAppCheck.java:28-39; Kotlin Firebase.appCheck A:FirebaseAppCheck.kt:26-30 | appCheckWithApp: IH:FIRAppCheck.h:47-53 | GetInstance(App*) CH:app_check.h:130 | FirebaseAppCheck(app, provider: ...), a factory constructor of a final class (DL:firebase_app_check.dart:46,71-212) | different | Dep Manager/no request from the constructor | DT:manager_test.dart:354 (constructor sends nothing, no store call); DT:store_test.dart:113 | - | No instance cache and no static lookup; the constructor reads and sends nothing and does no I/O. FirebaseAppCheck is a final class. |
| Install the provider | options.provider, per app J:public-types.ts:59-68 | installAppCheckProviderFactory, per instance AI:DefaultFirebaseAppCheck.java:111-123 | setAppCheckProviderFactory:, one per process I:Core/FIRAppCheck.m:56,180-182 | SetAppCheckProviderFactory, global CD:app_check_desktop.cc:30,79-83 | the required provider: constructor argument; AppCheckProvider is sealed, with DebugAppCheckProvider and CustomAppCheckProvider (DL:firebase_app_check.dart:73, DL:provider.dart:19-21) | different | Dec Provider type | DT:idiomatic_test.dart:111 (an exhaustive switch); the required argument is compile-time | - | A closed set: a switch over it is exhaustive, and adding a subtype is a breaking change that ships only in a major release. Per instance, as JS and Android. |
| No provider installed | the provider is a required option J:public-types.ts:63; a call before activation throws use-before-activation J:util.ts:32-38 | "No AppCheckProvider installed." AI:DefaultFirebaseAppCheck.java:195-199,259-261 | a default factory: debug on the simulator, DeviceCheck on a device I:DefaultProviderFactory/FIRDefaultProviderFactory.m:25-43 | kAppCheckErrorInvalidConfiguration CD:app_check_desktop.cc:110-113 | the constructor requires a provider; nothing is installed by default (DL:firebase_app_check.dart:73) | same (JS) | - | no test (a compile error cannot be asserted) | - | A missing provider is a compile error. |
| Required options | projectId, appId, apiKey, unchecked J:client.ts:142-145 | projectId must not be null AI:NetworkClient.java:104-106 | APIKey, projectID, googleAppID non-empty I:Core/FIRAppCheckValidator.m:23-39 | project_id, app_id, api_key, unchecked CD:debug_token_request.h:42-51 | debug provider only: a missing, empty or malformed apiKey, appId or projectId is an ArgumentError at construction; the custom provider needs none (DL:exchange_client.dart:96-115,157-170,317-342, DL:firebase_app_check.dart:142-144) | different | not in decisions doc | DT:config_test.dart:76 (ArgumentError names the option, never the value), :182 (a missing or empty option is an ArgumentError at construction, nothing installed, no request), :235 (custom provider needs none); DT:idiomatic_test.dart (the same through the main constructor); DT:security/sentinel_test.dart | - | No error text contains the value. A configuration mistake fails when the instance is created, not at the first token. |
| Auto-refresh default | false in code, ANDed with automaticDataCollectionEnabled J:api.ts:133-135,152-163 | the data-collection flag AI:DefaultFirebaseAppCheck.java:111-114 | stored value, then Info.plist, then data collection I:Core/FIRAppCheckSettings.m:60-95 | true CD:app_check_desktop.cc:36 | autoRefresh constructor argument, true by default, not tied to data collection (DL:firebase_app_check.dart:75, DL:refresher.dart:57-71) | different | Dec Auto-refresh | Dec Auto-refresh; DT:refresher_test.dart:205 (default on: reschedules), :264 (off from the constructor never refreshes) | - | Upstream has four rules. A refresh sends no user data. |
| Auto-refresh switch | setTokenAutoRefreshEnabled J:api.ts:177-193 | setTokenAutoRefreshEnabled A:FirebaseAppCheck.java:72 | isTokenAutoRefreshEnabled I:Core/FIRAppCheck.m:184-190 | SetTokenAutoRefreshEnabled CH:app_check.h:152 | the property autoRefresh (getter and setter; the constructor takes the same name) (DL:firebase_app_check.dart, DL:refresher.dart) | different | - | DT:refresher_test.dart:235 (off and on, autoRefresh), :264 | - | false cancels the timer; true schedules from the current token, if there is one. Setting it after close() throws a StateError. The FlutterFire names setTokenAutoRefreshEnabled and isTokenAutoRefreshEnabled belong to the FlutterFire shim. |
| Auto-refresh setting persisted | - | - | in UserDefaults I:Core/FIRAppCheckSettings.m:97-103 | - | in memory only: the autoRefresh constructor argument and the setter (DL:firebase_app_check.dart:318-328, DL:refresher.dart:86) | same (JS, Android, C++) | - | no test | - | iOS keeps the setting in UserDefaults (I:Core/FIRAppCheckSettings.m:97-103); Dart does not save it. |
| Network at activation | a listener that fetches when auto-refresh is on J:api.ts:107-117 | none at install AI:DefaultFirebaseAppCheck.java:116-123 | the refresher runs at once at init G:Core/AppCheckCore.swift:52-62 | - | the constructor sends nothing; the refresher starts when the first token is cached, from a request or from the store (DL:firebase_app_check.dart:71-212, DL:refresher.dart:109-121) | different | Dec Auto-refresh; Dep Manager/no request from the constructor | Dec Auto-refresh; DT:manager_test.dart:354; DT:store_test.dart:113 | - | No constructor uses the network, and a tool that never needs a token spends no exchange. |
| Close | _delete() removes listeners J:factory.ts:38-44 | resetAppCheckState(), test only AI:DefaultFirebaseAppCheck.java:136-142 | - | the destructor removes the instance C:common/app_check.cc:127-143 | Future<void> close(): idempotent; cancels the refresh timer and a request in flight; answers every waiting call; runs when the app is deleted; isClosed tells whether it ran (DL:firebase_app_check.dart:253-255,330-365,229, DL:token_manager.dart:265-282,554-586, DL:refresher.dart:103, DL:app_check_seam.dart:103-111) | different | Dec close() and a request in flight; Dep Seam/the seam object survives close() | DT:close_test.dart:112 (a waiting call completes at close), :285 (the request is aborted), :347 (the owned client is closed once, after the abort: abortedAtClose is [true]), :388 (the abort trigger completes while the close count is still 0), :462 (close twice), :540,:571 (no provider run after close), :594 (adoption timers), :799,:811,:825 (a callback that calls close() synchronously: app-check-closed at once, no 7 s or 7.75 s timer left), :842,:864 (a close() between the end of an exchange and the call resuming); DT:idiomatic_test.dart:233 (app deletion closes); DT:refresher_test.dart:475 (no timer after close); DT:manager_test.dart:948 (no timer left after close() while the app is alive) | - | Every client in this repository has a close(). A custom callback that is running cannot be cancelled; its answer is dropped. A call that waits while the instance closes, or whose custom callback closed it, gets app-check-closed; a new getToken, getLimitedUseToken or autoRefresh assignment on a closed instance throws a StateError. |
| HTTP client ownership | - | - | - | - | a client created by the instance is closed by close() after the abort reaches its request; a client passed in is never closed (DL:firebase_app_check.dart:151-153,359-364) | different | Dec close() and a request in flight; no upstream equivalent | DT:close_test.dart:347 (a client created by the instance is closed once, after its request is aborted), :388 (the abort reaches the request while the close count is 0), :422 (a passed-in client is never closed), :437 (a custom provider sends nothing and closes none) | - | No upstream equivalent. |
| Several apps | state per app J:state.ts:52 | per app AI:StorageHelper.java:53-58 | per app I:Core/FIRAppCheck.m:266-273 | a map per app C:common/app_check.cc:65,105-110 | one instance and one stored record per app; nothing static (DL:token_record.dart:20, DL:firebase_app_check.dart:380-392) | same | - | DT:store_test.dart:493 (a change event for another app's key is ignored) | - | |
| Second instance for one app | already-initialized unless the options are equal J:api.ts:89-103 | one per app A:FirebaseAppCheck.java:37-39 | one per app I:Core/FIRAppCheck.m:148-151 | one per app C:common/app_check.cc:105-110 | install: true (the default) throws StateError while another instance is open on the app; install: false gives an independent instance that is not set on the app (DL:firebase_app_check.dart:76,145,192-195,380-392) | different | Dec How the client meets the seam | DT:seam_test.dart:841 (install: false next to an installed instance), :896 (a second open instance throws and leaves nothing behind), :955 (a foreign provider), :988 (re-bound after close) | - | An app that wants a private instance, such as the FlutterFire bridge, uses install: false. A closed instance does not block a new one. |
| Feature | JS | Android | iOS | C++ | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|---|
| Get a token | getToken(appCheck, forceRefresh) J:api.ts:206-221 | getAppCheckToken(forceRefresh) A:FirebaseAppCheck.java:86 | tokenForcingRefresh:completion: IH:FIRAppCheck.h:93-96 | GetAppCheckToken(force_refresh) CH:app_check.h:157 | Future<AppCheckToken> getToken({bool forceRefresh = false}); throws FirebaseAppCheckException (DL:firebase_app_check.dart:271-297) | same | - | DT:manager_test.dart:279,320 (a failed forced call throws; a plain call keeps the unexpired token), :133; DT:exchange_test.dart:68; DT:close_test.dart:842,864 (getToken throws app-check-closed when close() ran after the exchange ended, while the answer was stored or checked) | - | A forced call whose exchange failed throws, even while the cached token is usable. A call that is not forced gets the cached token when the request fails while it has not expired. A call whose exchange ended after close() ran throws app-check-closed. |
| Token fields | {token} only J:public-types.ts:86-91 | getToken, getExpireTimeMillis A:AppCheckToken.java:24-31 | token, expirationDate IH:FIRAppCheckToken.h:26-29 | token, expire_time_millis CH:app_check.h:52-58 | AppCheckToken(token:, expireTime:), a const class; the time is UTC (DL:app_check_token.dart:13-41) | same (Android, iOS, C++) | - | DT:exchange_test.dart:68 (token and expiry), :92 (expiry from the send time); DT:security/sentinel_test.dart:497,:504 (exact text of AppCheckToken, also with a local expireTime), :512 (SessionToken), :519 (TokenEvent), :562 (AppCheckTokenResult) | - | JS's getToken hides the expiry. |
| Limited-use token | getLimitedUseToken J:api.ts:238-242 | getLimitedUseAppCheckToken A:FirebaseAppCheck.java:99 | limitedUseTokenWithCompletion: IH:FIRAppCheck.h:106 | GetLimitedUseAppCheckToken CH:app_check.h:165 | Future<AppCheckToken> getLimitedUseToken(): one exchange with limited_use: true, never cached, stored or announced (DL:firebase_app_check.dart:299-311, DL:token_manager.dart:222-244) | same | - | DT:manager_test.dart:453 (not cached, not announced, not stored, two concurrent calls send two requests); DT:request_shape_test.dart:142; DT:exchange_test.dart:81 | - | Not shared between callers: a replay-protected backend consumes each token. |
| Validity margin | until expiry J:internal-api.ts:426-428 | 5 min AI:DefaultFirebaseAppCheck.java:47,326-329 | 5 min G:Core/AppCheckCore.swift:114,174-178 | until expiry CD:app_check_desktop.cc:56-62 | usable while more than min(5 min, ttl/2) remain (DL:app_check_token.dart:63-69) | same (Android, iOS) | Dec Usable margin; Dep Manager/usable margin min(5 min, ttl/2) | Dec Usable margin; DT:manager_test.dart:91 (55, 25 and 2 minutes, to the millisecond) | - | JS can hand out a token that expires on the way. The ttl/2 term only matters below a 10-minute lifetime. |
| Shared exchange | one exchangeTokenPromise J:internal-api.ts:161-173 | cachedTokenTask reused AI:DefaultFirebaseAppCheck.java:200-204 | non-forced calls only G:Core/AppCheckCore.swift:121-153 | none CD:app_check_desktop.cc:90-117 | one session exchange in flight; forced calls join it (DL:token_manager.dart:300-319) | same (JS, Android) | Dec Concurrent session calls | DT:manager_test.dart:133 (ten callers, one exchange), :222 (a forced call that joined an unforced exchange and got the same token exchanges once more), :614 (a forced answer is judged against the token cached when the call began, so the same string while another is cached is provider-error); open nit: a forced flight accepting a string that a second forced joiner rejected is a documented reading, no test | - | A forced call that joined an unforced exchange and got the token it was asked to replace runs its own forced exchange. |
| Forced-refresh floor | - | - | - | - | a forced call within 30 s of the token's issue, while the token is usable, gets the cached token (DL:token_manager.dart:20,287-292) | different | Dec Forced-refresh floor; Dep Manager/forced floor of 30 s | Dec Forced-refresh floor; DT:manager_test.dart:158 (29 s and 31 s), :189 (an unexpired token that is not usable is not the answer) | - | A backend that rejects every token costs one exchange per 30 s, not one per request. |
| Forced call that could not replace a usable token | - | - | - | - | a forced call whose exchange failed throws from getToken; a forced seam call gets the cached token with no error while it is usable, and with the error in its last minutes (DL:firebase_app_check.dart:290-292, DL:app_check_seam.dart:221-233, DL:token_manager.dart:322-329) | different | not in decisions doc (token-provider contract) | DT:manager_test.dart:279 (the seam gives the usable token with no error, the public forced call throws), :320 (last five minutes) | - | The seam owes the services a token that works; the public call tells the app its forced refresh failed. |
| Token string check | - | must not be empty AI:DefaultAppCheckToken.java:59-62 | must be a string G:Core/APIService/AppCheckCoreToken+APIResponse.swift:41-44 | - | 1 to 8192 characters in U+0021 to U+007E; the JWT is not parsed (DL:exchange_client.dart:306-310, DL:token_manager.dart:48-50, DL:token_record.dart:70, isTokenText of _firebase_transport_dart) | different | not in decisions doc | DT:exchange_test.dart:173 (the fetch-parse-error texts, with the debug token inside a longer token at :203,:233); DT:debug_token_echo_test.dart:53 (a 200 token that contains the debug token, in any case or position, is fetch-parse-error with a text that does not hold it); DT:exchange_test.dart:257 (a token equal to the debug token is not cached); DT:security/limits_test.dart:158 (8192 and 9000 characters, server and callback); DT:custom_provider_test.dart:151; DT:record_test.dart:113 | - | A token from the server or from a callback is untrusted input. A server token that fails it is fetch-parse-error, a callback's is provider-error. |
| Clocks | wall clock J:internal-api.ts:426-428 | wall clock AI:DefaultFirebaseAppCheck.java:326-329 | wall clock G:Core/AppCheckCore.swift:174-184 | std::time CD:app_check_desktop.cc:56-62 | waits (gate windows, deadlines, timers, the forced floor) read a monotonic source; a token's age is the larger of the wall and monotonic readings (DL:clocks.dart:9-26, DL:app_check_token.dart:68-83) | different | Dec Clocks; Dep Manager/waits on a monotonic source | Dec Clocks; DT:clock_test.dart:58,102,135,180,207 | - | A clock moved forward or back neither ends a wait nor stretches a cached token. |
| Feature | JS | Android | iOS | C++ | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|---|
| Listener API | onTokenChanged J:api.ts:261-330 | addAppCheckListener, removeAppCheckListener A:FirebaseAppCheck.java:106-117 | FIRAppCheckAppCheckTokenDidChangeNotification IH:FIRAppCheck.h:29-35 | AddAppCheckListener, RemoveAppCheckListener CH:app_check.h:175-178 | Stream<AppCheckToken> get onTokenChanged: broadcast, asynchronous, done after close() (DL:firebase_app_check.dart:313-316,367-374) | different | Dec Token stream; Dep Stream/no error events, no replay | DT:manager_test.dart:371 (no error events), :409 (no replay); DT:close_test.dart:179 (nothing announced after close); DT:seam_test.dart:707 (a repeated string is dropped on the public and the seam stream), :738 (the public stream ends at close(), the seam stream does not) | - | A stream replaces the observer. A token equal to the last one emitted is dropped, and a stored token that is already in its last minutes is not announced. |
| Event contents | {token} J:public-types.ts:97 | AppCheckToken A:FirebaseAppCheck.java:111-116 | token string and app name I:Core/FIRAppCheck.m:255-262 | AppCheckToken CH:app_check.h:71 | AppCheckToken, token and expiry (DL:firebase_app_check.dart:373, DL:app_check_seam.dart:255) | same (Android, C++) | - | DT:manager_test.dart:409 (token string only; the expiry is not asserted) | - | |
| Announcing stored tokens | - | - | - | - | a token from the store (at the load or adopted later) is announced on onTokenChanged only while it is usable (DL:token_manager.dart:258,624-630) | different | Lead ruling; Dec Token stream | DT:store_test.dart:175 (an unexpired but unusable record is not announced), :541 (an adopted record is announced only when usable) | - | A record in its last minutes is about to be replaced, so listeners skip it. |
| Replay to a new listener | the valid cached token J:internal-api.ts:270-282 | the valid cached token AI:DefaultFirebaseAppCheck.java:171-174 | - | the valid cached token CD:app_check_desktop.cc:215-224 | none (DL:firebase_app_check.dart:367-374) | same (iOS) | Dec Token stream; Dep Stream/no error events, no replay | DT:manager_test.dart:409 | - | Products that read the token seam get their stream from the seam, which does not replay either. |
| Errors to listeners | to the observer's error J:internal-api.ts:401-424 | successes only AI:DefaultFirebaseAppCheck.java:285-302 | successes only G:Core/AppCheckCore.swift:189-206 | successes only CD:app_check_desktop.cc:64-70 | never (DL:firebase_app_check.dart:313-316) | same (Android, iOS, C++) | Dec Token stream; Dep Stream/no error events, no replay | DT:manager_test.dart:371 | - | An error event is an unhandled error for a listener without onError. |
| Listeners drive refresh | the first listener starts the refresher, the last stops it J:internal-api.ts:298-334 | refresh only while listeners exist AI:TokenRefreshManager.java:112-133 | not tied to listeners G:Core/TokenRefresh/AppCheckCoreTokenRefresher.swift:63-79 | - | not tied to listeners (DL:refresher.dart:109-121) | same (iOS) | - | DT:refresher_test.dart:159 and :201 (the refresh runs with no listener attached) | - | Storage, Auth and the other products that read the token seam never listen. |
| Feature | JS | Android | iOS | C++ | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|---|
| Refresh moment | issued + ttl/2 + 5 min, at most expiry − 5 min J:internal-api.ts:374-395 | received + ttl/2 + 5 min; past expiry, expiry − 60 s AI:TokenRefreshManager.java:97-106 | the same time, but a non-forced call that keeps the token while 5 min remain G:Core/TokenRefresh/AppCheckCoreTokenRefresher.swift:142-161, G:Core/AppCheckCore.swift:84-96 | none CD:app_check_desktop.cc:154-188 | issue + min(ttl/2 + 5 min, ttl − min(5 min, ttl/2)), less the random lead below, and not earlier than 30 s after issue (DL:refresher.dart:30-42) | same (JS, Android) | Dec Refresh moment | Dec Refresh moment; DT:refresher_test.dart:68 (1 h, 30 min, 10 min, 2 min, 60 s), :90; DT:manager_test.dart:825 (a 30-day expiry is clamped to 7 days: the refresh is due at exactly 3 d 12 h 4 min) | - | 35 minutes for a one-hour token. The second term covers lifetimes of 20 minutes or less. iOS in effect refreshes about 5 minutes before expiry. |
| Random lead | - | - | - | - | the due time minus random × min(2 min, ttl/10) (DL:refresher.dart:10,37-38) | different | Dec Instances on one store at refresh time; Dep Refresher/a random lead on the due time | DT:refresher_test.dart:90 (random 0.5), :100 (two instances with different leads make one exchange) | - | Instances on one store would otherwise refresh at the same moment and each exchange; the first one's new token is adopted by the others. |
| Retry after a failed refresh | 30 s doubling to 16 min J:constants.ts:31-39 | 30 s doubling to 16 min AI:DefaultTokenRefresher.java:36-37,84-90 | 30 s doubling to 16 min, plus up to 1 s G:Core/TokenRefresh/AppCheckCoreTokenRefresher.swift:27-28,175-190 | - | when the session gate opens, and not sooner than 30 s (DL:refresher.dart:151-193) | different | Dec Refresher retry; Dep Refresher/no retry ladder of its own | DT:refresher_test.dart:159 (not sooner than 30 s, and when a longer window ends), :325 (a throwing logger never leaves it dead), :371 (a random source that throws: the 30 s retry), :415 (an injected clock or elapsed source that throws: the 30 s retry); DT:manager_test.dart:795 (the retry comes 2 ms after the gate opens, not sooner) | - | One backoff, the gate's, not a second one beside it. A run that throws (an injected clock or random source) still re-arms the 30 s retry. |
| Pause in the background | - | cancelled when the app is backgrounded AI:TokenRefreshManager.java:66-83 | - | - | none | won't do | non-goal (not in decisions doc) | no test | - | A late timer only delays the proactive refresh, and every call judges the token at its own time. |
| Stopping an idle refresher | - | - | - | - | none; the refresh timer keeps the process alive until close() (DL:refresher.dart:54-71) | won't do | Dec Stopping an idle refresher | Dec Stopping an idle refresher; DT:refresher_test.dart:282 (the refresher keeps going after expiry); no test that the timer holds the process open | - | The class documentation says so. Stopping after a period without getToken, or arming the timer only while the stream has a listener, would starve Database and the products that never listen. |
| Expiry counted from | the response J:client.ts:102-107 | the response AI:DefaultAppCheckToken.java:54-57 | before the request G:Core/APIService/AppCheckCoreAPIService.swift:171, G:Core/APIService/AppCheckCoreToken+APIResponse.swift:56-58 | the response's fetch time CD:debug_provider_desktop.cc:352-353 | both clocks are read before the request is sent (DL:exchange_client.dart:126-140) | same (iOS) | Dec Expiry counted from; Dep Manager/expiry counted from before the request | Dec Expiry counted from; DT:exchange_test.dart:92; DT:manager_test.dart:699 (issue times are whole milliseconds: a stored copy and a custom token get the same expiry; skipped on a platform without sub-millisecond DateTime) | - | The token is never believed to live longer than it does. |
ttl parsing | ^([\d.]+)(s)$, then Number() J:client.ts:92-100 | s removed, parseDouble; JWT claims on failure AI:DefaultAppCheckToken.java:72-84 | every s removed, must be > 0 G:Core/APIService/AppCheckCoreToken+APIResponse.swift:52-55 | strtol, fraction dropped CD:debug_provider_desktop.cc:352 | ^([0-9]{1,9})(\.[0-9]{1,9})?s$ in integer arithmetic; under 60 s is fetch-parse-error, over 7 days is clamped to 7 days (DL:ttl.dart:3-40) | different | Dec ttl bounds; Dep Parsing/strict ttl grammar, 60 s floor, 7-day clamp | DT:ttl_test.dart:5 (accepted), :38 (refused), :43 (not a string); DT:exchange_test.dart:114 (7-day clamp), :173 | - | JS accepts 1.2.3s; a 1 s lifetime would mean an exchange per request. |
| Feature | JS | Android | iOS | C++ | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|---|
| What is throttled | reCAPTCHA providers only J:providers.ts:66-112; not custom J:providers.ts:247-262 or debug J:internal-api.ts:119-154 | every provider, HTTP failures only AI:NetworkClient.java:130-132,196-197 | DeviceCheck, App Attest, reCAPTCHA G:DeviceCheckProvider/AppCheckCoreDeviceCheckProvider.swift:101; not debug G:DebugProvider/AppCheckCoreDebugProvider.swift:244-275 | - | every failed exchange of both providers, transport errors and callback failures included (DL:token_manager.dart:232-237,352-367, DL:gate.dart:86-100) | different | Dec What feeds a gate; Dep Gate/every failure counts, for both providers | DT:gate_test.dart:190 (each failure class, both providers), :235,:243,:255 (custom provider); DT:custom_provider_test.dart:567 | - | A fast transport error or a throwing callback would otherwise repeat at the app's request rate. |
| Day-long block | 403, 404 J:providers.ts:309-314 | 400, 404 AI:RetryManager.java:91-97 | 400, 404 G:Core/Backoff/AppCheckCoreBackoffWrapper.swift:175-177 | - | none (DL:gate.dart:7-10) | different | Dec Day-long block on some statuses; Dep Gate/no day-long block | Dec Day-long block; DT:gate_test.dart:264 (404 backs off) | - | Such a block ends only with a restart, and nothing shows those statuses never clear on the server. |
| Backoff formula | 1 s × 2^n ± 50 %, cap 4 h JU:exponential_backoff.ts:34-75 | 2^(n × jitter) s, jitter 1 to 1.5, cap 4 h AI:RetryManager.java:78-89 | 2^(n−1) s × (1 + r/2), cap 4 h G:Core/Backoff/AppCheckCoreBackoffWrapper.swift:152-159 | - | min(1 s × 2^(n−1) × (0.5 + r), cap); cap 4 h when the server refused (a status other than 200, or a body that breaks a rule), 5 min otherwise (DL:gate.dart:7-14,104-114) | different | Dec Backoff formula | Dec Backoff formula; DT:gate_test.dart:300 (waits of failures 1 to 16, random 0 and 0.5), :397 (the cap applies after the jitter); DT:manager_test.dart:911 (both classes: each window still holds 1 ms before its end and opens at its end, 16 refused failures to the 4 h cap and 11 unreachable ones to the 5 min cap) | - | JS's shape with the cap after the jitter. The 5-minute class (no answer, or a custom callback failing) is this package's own. |
| Separate limited-use throttle | one per provider J:providers.ts:55 | one per provider AD:internal/DebugAppCheckProvider.java:228-241 | one per provider G:DeviceCheckProvider/AppCheckCoreDeviceCheckProvider.swift:52 | - | two gates per instance, session and limited-use, each with a generation number (DL:token_manager.dart:131-132,222-244, DL:gate.dart:39-78) | different | Dec Gates; Dep Gate/a generation per gate; separate gates | DT:gate_test.dart:416 (fifteen concurrent failures count once), :466 (a late success does not clear a newer window), :541, :564 | - | A burst of limited-use failures counts once and does not stop session tokens. |
| Code of the failing call | initial-throttle J:errors.ts:30,58 | the server error AI:NetworkClient.java:196-205 | the server error G:Core/Backoff/AppCheckCoreBackoffWrapper.swift:96-99 | - | its own code, with retryAfter set; later calls get throttled (DL:token_manager.dart:405-422, DL:exception.dart:206-215,242-257) | different | Dep Gate/the failing call keeps its own code | DT:gate_test.dart:502 (first failure keeps its code, later calls get throttled) | - | throttled also carries the httpStatus of the failure that started the pause. |
| Throttle persisted | in memory J:providers.ts:55 | in memory AI:RetryManager.java:38-39 | in memory G:Core/Backoff/AppCheckCoreBackoffWrapper.swift:39-40 | - | in memory (DL:gate.dart:16-37) | same | Dec Gate persistence | Dec Gate persistence; no test | - | Every start begins open; a restart loop sends one refused exchange per start. The README states this. |
| Feature | JS | Android | iOS | C++ | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|---|
| Shape | a global FIREBASE_APPCHECK_DEBUG_TOKEN that bypasses the provider J:debug.ts:28,49-71, J:internal-api.ts:119-154 | DebugAppCheckProviderFactory.getInstance() AD:DebugAppCheckProviderFactory.java:40 | FIRAppCheckDebugProviderFactory IH:FIRAppCheckDebugProviderFactory.h:26 | DebugAppCheckProviderFactory::GetInstance() CH:app_check/debug_provider.h:47 | DebugAppCheckProvider(debugToken: ...) (DL:provider.dart:28-84) | same (Android, iOS, C++) | Dec Debug token sources; Dep Secrets/explicit sources only | DT:debug_provider_test.dart:19 (accepted tokens), :38 (refused, no value in the error); DT:request_shape_test.dart:129 | - | No page global switches a production page into debug mode. |
| Token sources | the global's string, else IndexedDB, else a new UUID J:debug.ts:67-71, J:storage.ts:66-122 | test provider, string resource, SharedPreferences, new UUID AD:internal/DebugAppCheckProvider.java:160-214 | AppCheckDebugToken, FIRAAppCheckDebugToken, the CLI configstore file on the simulator, a UserDefaults UUID G:DebugProvider/AppCheckCoreDebugProvider.swift:23-24,289-297,310-330, I:DebugProvider/FIRAppCheckDebugTokenConfigStore.m:28-39 | SetDebugToken, three environment variables, the CLI configstore file, a new UUID CD:debug_provider_desktop.cc:237-284 | the debugToken: constructor argument, or DebugAppCheckProvider.fromProcessEnvironment({name}), which reads FIREBASE_APPCHECK_DEBUG_TOKEN by default and throws a FormatException that names the variable, never its value (DL:provider.dart, DL:environment_io.dart) | different | Dec Debug token sources | DT:debug_provider_io_test.dart:32,48 (the process environment, the default name), :67 (unset), :83 (empty), :97 (malformed), :127 (valid), :116,:158 (another name) | - | Explicit sources only. The configstore file is not read. The constructor throws an UnsupportedError on the web, which has no process environment. |
| Token format check | - | - | not empty G:DebugProvider/AppCheckCoreDebugProviderAPIService.swift:53-56 | - | ArgumentError, without the value, unless the token is a version 4 UUID (case ignored) (DL:provider.dart:7-10,75-80,142) | different | not in decisions doc | DT:debug_provider_test.dart:19,38,76 (the error has no value) | - | The Firebase console issues and accepts UUID4 debug tokens. |
| Generate a token | crypto.randomUUID(), stored and printed J:storage.ts:80-118 | UUID.randomUUID(), stored AD:internal/DebugAppCheckProvider.java:206-209 | UUID(), stored in UserDefaults G:DebugProvider/AppCheckCoreDebugProvider.swift:289-297 | a new UUID each run CD:debug_provider_desktop.cc:283-284 | DebugAppCheckProvider.generateDebugToken(), a static method, returns a lowercase version 4 UUID from Random.secure(); never stored or printed (DL:provider.dart:60-73) | different | Dep Secrets/the debug token is never logged, printed or stored | DT:debug_provider_test.dart:101 (lowercase UUID 4), :109, :118 (new each time, every random digit value) | - | The caller registers the token in the Firebase console. Random.secure() also works outside a secure context on the web. |
| Token printed | console.log J:api.ts:80-86 | Log.d AD:internal/DebugAppCheckProvider.java:91-110 | a warning I:DebugProvider/FIRAppCheckDebugProvider.m:128-132 | a warning CD:debug_provider_desktop.cc:288-299 | never; with a logger, one warning that a debug provider is in use, without the token (DL:firebase_app_check.dart:183-189, DL:logger.dart:52-54) | won't do | Dep Secrets/the debug token is never logged, printed or stored | DT:logging_test.dart:79 (one line with a debug provider, no token), :111 (no logger, nothing printed); DT:security/sentinel_test.dart:340 (every scenario runs with print captured, which must stay empty), :446 (the leak check finds every 6-character window of every sentinel, in any case), :656 (every failure of 5.9 with a debug rig) | - | Whoever holds the debug token gets App Check tokens until it is deleted. |
| Failure hints | throttle warnings only J:internal-api.ts:141-150 | a 403 hint by source, with the token AD:internal/DebugAppCheckProvider.java:250-284 | a hint by source I:DebugProvider/FIRAppCheckDebugProvider.m:148-165 | a 403 hint CD:debug_provider_desktop.cc:356-361 | with a logger, a warning for a failed exchange with the code, the HTTP status and the serverStatus (DL:logger.dart:68-82) | different | not in decisions doc | DT:logging_test.dart:245 (the failure texts with and without status), :280 (the wait is rounded up to whole seconds) | - | No log line carries a token. |
| Release-build guard | - | the string resource is ignored in a non-debuggable build AD:internal/DebugAppCheckProvider.java:184-196 | the configstore file only on the simulator I:DebugProvider/FIRAppCheckDebugTokenConfigStore.m:28-34 | - | none in this package | different | Dec Debug token in release builds (owner) | Dec Debug token in release builds; no test (an absence) | - | Servers, CI jobs and tools use a debug token on purpose, and dart.vm.product cannot tell them from a shipped app. The FlutterFire bridge (a separate Flutter package that is planned and not built) is the place for a release-mode check. |
| Read the debug token back | getDebugToken, internal J:debug.ts:36-47 | - | localDebugToken, currentDebugToken IH:FIRAppCheckDebugProvider.h:76,89 | - | no getter (DL:provider.dart:28-84) | won't do | not in decisions doc | no test (an absent member cannot be asserted); DT:debug_provider_test.dart:92 for toString; DT:security/sentinel_test.dart:446 (every 6-character part of the debug token is a needle in every printable text), :202 (and in every store write) | - | No public member returns the secret. |
| Feature | JS | Android | iOS | C++ | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|---|
| Custom provider | new CustomProvider({getToken}) J:providers.ts:239-285 | implement AppCheckProvider A:AppCheckProvider.java:33-42 | implement FIRAppCheckProvider IH:FIRAppCheckProvider.h:26-45 | subclass AppCheckProvider CH:app_check.h:79-106 | CustomAppCheckProvider(getToken: ...), a callback that takes an AppCheckTokenRequest and returns an AppCheckToken (DL:provider.dart:129-138) | same (JS) | Dec Provider type | DT:custom_provider_test.dart:117 (rules group), :315 (no HTTP request) | - | A callback, not a subclass. It makes no HTTP request and needs no API key. |
| Told it is limited-use | not told J:providers.ts:247, J:internal-api.ts:250 | a second method that defaults to getToken A:AppCheckProvider.java:40-42 | an optional method that falls back I:Core/FIRInternalAppCheckProvider.m:47-53 | the default warns and falls back C:common/app_check.cc:73-81 | the limitedUse field of the callback's AppCheckTokenRequest; no fallback (DL:token_manager.dart:478-483) | different | Dec What the custom callback is told; Dep Custom/told limitedUse and forceRefresh | DT:custom_provider_test.dart:315 (no fallback between kinds), :493 (the arguments of every call) | - | A session token consumed by a replay-protected backend breaks later calls. |
| Told it is forced | - | - | - | - | the forceRefresh field of the callback's AppCheckTokenRequest; for a forced session request, returning the token it was asked to replace is provider-error (DL:token_manager.dart:57-59,469-471) | different | Dec What the custom callback is told; Dep Custom/told limitedUse and forceRefresh | DT:custom_provider_test.dart:493, :525 (the same token on a forced call is provider-error; the seam keeps the usable token); DT:manager_test.dart:222 | - | getToken(forceRefresh: true) then throws. A service that reads the token seam gets the cached token while it is usable. |
| Issue time | JWT iat, seconds compared with milliseconds J:providers.ts:252-262 | JWT iat, for a raw token AI:DefaultAppCheckToken.java:136-146 | receivedAtDate, default now I:Core/FIRAppCheckToken.m:35-36 | - | the moment the callback returns; no claim is read (DL:token_manager.dart:41-47) | different | Dec JWT iat of custom tokens; Dep Custom/JWT not parsed | DT:custom_provider_test.dart:269 (the moment the callback returns), :299 (claims change nothing); DT:manager_test.dart:699 (whole-millisecond issue time of a custom token) | - | A JWT claim nobody verified is not trusted. |
| Result checks | - | - | - | - | the token rule (1 to 8192 characters in U+0021 to U+007E); at least 60 s of life; an expiry over 7 days is clamped to 7 days (DL:token_manager.dart:36-66) | different | Dep Custom/expiry bounded | DT:custom_provider_test.dart:151 (token rule), :192 (60 s), :236 (7 days, also for caching); DT:security/limits_test.dart:202 | - | A callback's result is validated like server data. A failing result is provider-error. |
| Deadline and late answer | - | - | - | - | 7 s, then provider-timeout; a late session answer that passes the checks is cached and resets the session gate, a late limited-use answer is dropped (DL:token_manager.dart:461-547, DL:exchange_client.dart:51) | different | Dec Provider deadline; Dep Request/a 7 s deadline; Custom/a late answer to a session request is kept | DT:custom_provider_test.dart:334 (deadline), :358 (late session result kept), :409 (late limited-use dropped), :446 (late result that breaks a rule dropped); DT:manager_test.dart:755 (a late forced answer that repeats the rejected token is dropped: the cached expiry is unchanged) | - | A bridge to a native attestation may need more than 7 s. |
| Feature | JS | Android | iOS | C++ | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|---|
| reCAPTCHA v3 | ReCaptchaV3Provider(siteKey) J:providers.ts:48-137 | - | - | - | none | missing | Dec reCAPTCHA on the web | no test (not built) | - | Planned for the web through secure_flow; the README says "later". |
| reCAPTCHA Enterprise | ReCaptchaEnterpriseProvider(siteKey) J:providers.ts:145-233 | RecaptchaAppCheckProviderFactory.getInstance(siteKey) AR:RecaptchaAppCheckProviderFactory.java:40 | FIRRecaptchaProvider initWithApp:siteKey: IH:FIRRecaptchaProvider.h:41 | - | none | missing | Dec reCAPTCHA on the web | no test (not built) | - | Planned with reCAPTCHA v3. The action is fire_app_check (JS J:recaptcha.ts:128, Android AR:internal/RecaptchaAppCheckProvider.java:54), not iOS's app_check_ios GR:Public/AppCheckRecaptchaProvider.swift:34. |
| Play Integrity | - | PlayIntegrityAppCheckProviderFactory.getInstance() AP:PlayIntegrityAppCheckProviderFactory.java:35 | - | a stub on desktop C:stub/play_integrity_provider_stub.cc:22-23 | none | won't do | Dec Native attestation (owner) | no test (not built) | - | The attestation call is native. A CustomAppCheckProvider can bridge FlutterFire's native tokens. |
| DeviceCheck | - | - | FIRDeviceCheckProvider initWithApp: IH:FIRDeviceCheckProvider.h:42 | a stub on desktop C:stub/device_check_provider_stub.cc:22-23 | none | won't do | Dec Native attestation (owner) | no test (not built) | - | The attestation call is native. |
| App Attest | - | - | FIRAppAttestProvider initWithApp: IH:FIRAppAttestProvider.h:41; resets after a 403 G:AppAttestProvider/AppCheckCoreAppAttestProvider.swift:350-356 | a stub on desktop C:stub/app_attest_provider_stub.cc:22-23 | none | won't do | Dec Native attestation (owner) | no test (not built) | - | Three stateful endpoints and no plugin to use them. |
| Feature | JS | Android | iOS | C++ | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|---|
| Transport | REST, JSON, fetch J:client.ts:60-67 | REST, JSON, HttpURLConnection AI:NetworkClient.java:156-167 | REST, JSON, URLSession G:Core/APIService/AppCheckCoreAPIService.swift:145-147 | REST, JSON, libcurl CD:debug_provider_desktop.cc:341-345 | one JSON POST of the exchangeDebugToken method through the shared sendCapped of _firebase_transport_dart (DL:exchange_client.dart:173-210) | same | Dec Transport | DT:request_shape_test.dart:94 (POST); DT:conformance/js_exchange_test.dart:34 (the JS client's cases) | - | No published proto, and the web cannot speak gRPC. |
| Host | content-firebaseappcheck.googleapis.com J:constants.ts:17-18 | firebaseappcheck.googleapis.com AI:NetworkClient.java:55-62 | the same G:Core/APIService/AppCheckCoreAPIService.swift:19 | the same CD:debug_token_request.h:31-32 | firebaseappcheck.googleapis.com on every platform (DL:firebase_app_check.dart:232-234) | same (Android, iOS, C++) | Dec Host | DT:request_shape_test.dart:38 (default origin, path, no query) | - | Only JS uses the content- host. |
| API key | ?key= J:client.ts:145 | ?key= AI:NetworkClient.java:133 | X-Goog-Api-Key G:Core/APIService/AppCheckCoreAPIService.swift:17,149-151 | X-Goog-Api-Key CD:debug_token_request.h:34,51 | the X-Goog-Api-Key header (DL:exchange_client.dart:195) | same (iOS, C++) | Dec API key; Dep Request/API key in a header, one host | DT:request_shape_test.dart:107 (exactly two headers, the key in x-goog-api-key), :38 (no key in the URL) | - | Proxies, browser histories and HTTP library errors record URLs. |
| Debug body field | debug_token J:client.ts:146-149 | debugToken AD:internal/ExchangeDebugTokenRequest.java:27 | debug_token G:DebugProvider/AppCheckCoreDebugProviderAPIService.swift:27 | debug_token CD:debug_token_request.fbs:18 | {"debug_token": ...} (DL:exchange_client.dart:184-188) | same (JS, iOS, C++) | Dec Body casing | DT:request_shape_test.dart:129, :171 (sent as given) | - | |
limited_use | only when true J:internal-api.ts:242, J:providers.ts:89-91 | only when true AD:internal/ExchangeDebugTokenRequest.java:42-44 | always G:DebugProvider/AppCheckCoreDebugProviderAPIService.swift:58-61 | always CD:debug_provider_desktop.cc:393 | only when true (DL:exchange_client.dart:184-188) | same (JS, Android) | Dec Body casing | DT:request_shape_test.dart:129 (absent for a session), :142 (true for limited-use), :158 (a forced session request) | - | |
| Heartbeat header | X-Firebase-Client J:client.ts:50-59 | X-Firebase-Client AI:NetworkClient.java:168-171 | X-firebase-client I:Core/FIRHeartbeatLogger+AppCheck.m:20-24 | - | not sent (DL:version.dart:2) | won't do | non-goal (not in decisions doc) | DT:request_shape_test.dart:107 (exactly two headers); DT:version_test.dart:10 | - | C++ desktop does not send it either. The package keeps packageVersion in lib/src/version.dart, but nothing sends it. |
| Platform identity headers | - | X-Android-Package, X-Android-Cert AI:NetworkClient.java:173-175 | X-Ios-Bundle-Identifier G:Core/APIService/AppCheckCoreAPIService.swift:18,153-155 | - | none (DL:exchange_client.dart:193-196) | won't do | Dec Identity headers for restricted keys | Dec Identity headers; DT:request_shape_test.dart:107 | - | A value typed into a Dart program is a claim nobody checked. A key restricted to a platform may refuse the request; the README says so. |
| Accepted status | exactly 200 J:client.ts:74-78 | any 2xx AI:NetworkClient.java:265-267 | any 2xx G:Core/APIService/AppCheckCoreAPIService.swift:208 | HttpSuccess CD:debug_provider_desktop.cc:347 | exactly 200; any other is fetch-status-error (DL:exchange_client.dart:142-144) | same (JS) | Dec Accepted status | Dec Accepted status; DT:exchange_test.dart:143 (a 201 is fetch-status-error), :159 | - | A 204 has no token to read. |
| Error body | not read J:client.ts:74-78 | error.code and error.message into the message AI:HttpErrorResponse.java:32-40 | kept raw in the error G:Core/Errors/AppCheckCoreHTTPError.swift:23-37 | in the message CD:debug_provider_desktop.cc:363-370 | error.status (as serverStatus, only if it is 1 to 64 capital letters or underscores) and error.message (as serverMessage), with control and invisible characters removed, a verbatim echo of the debug token replaced by <redacted> and 1 KiB kept; in fields only, never in message (DL:exchange_client.dart:226-271) | different | Dep Errors/fixed messages; server text only in a field; Dep Secrets/redaction before the cut | DT:exchange_test.dart:300 (status and message), :337 (other shapes give nulls), :369 (serverStatus pattern), :388, :413, :432; DT:security/limits_test.dart:98,113,137; DT:debug_token_echo_test.dart:143 (an echo split by U+FE0F, U+034F, U+180B or a tag character U+E0020 is redacted); DT:security/sentinel_test.dart:1097 | - | Server text is not part of the exception's message or toString. |
| Deadline | none J:client.ts:67 | none AI:NetworkClient.java:260-263 | - | - | 7 s from the send to the end of the body, one attempt; fetch-timeout (DL:exchange_client.dart:51,199) | different | Dec Provider deadline; Dep Request/a 7 s deadline | DT:exchange_test.dart:452 (6.999 s, 7 s, the late answer changes nothing), :629 (a body that stalls after the headers, status 200 and 403: fetch-timeout 7 s from the send, the request aborted and the body no longer read) | - | Inside the 8 s response deadline of the token seam, so a caller gets an answer before it gives up. |
| Caps and redirects | no cap J:client.ts:80-88 | no cap AI:NetworkClient.java:187-194 | - | - | 16 KiB caps on the body; redirects refused (fetch-network-error); the origin is fixed at construction (DL:exchange_client.dart:45,197-198,212-224) | different | Dep Security/caps, refused redirects, constructor-only origin | DT:security/limits_test.dart:55 (16 KiB boundary), :98,:113; DT:request_shape_test.dart:186 (a 302), :215 (no redirects followed); DT:exchange_test.dart:579; DT:close_test.dart:661 (an abort that close() did not cause is fetch-network-error) | - | A body over the cap on a 200 is fetch-parse-error. |
| Base URL override | - | - | staging from _AppCheckUseStaging G:Core/APIService/AppCheckCoreAPIService.swift:22-23 | - | serverOrigin of FirebaseAppCheck.test, @visibleForTesting: https, or http to a loopback host (DL:firebase_app_check.dart:93-121,136) | different | Dep Security/constructor-only origin | DT:security/limits_test.dart:230 (refused origins), :287 (accepted origins); DT:request_shape_test.dart:60 | - | No environment variable or page global changes it. |
| Feature | JS | Android | iOS | C++ | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|---|
| Store | IndexedDB J:indexeddb.ts:21-24 | SharedPreferences AI:StorageHelper.java:39-58 | Keychain G:Core/Storage/AppCheckCoreStorage.swift:33,48-51 | memory CD:app_check_desktop.cc:32-36 | an optional store: (KeyValueStore, re-exported from firebase_installations_dart); none means memory (DL:firebase_app_check.dart:74) | different | Dec Persistence (owner, 2026-11-28); Dep Storage/opt-in | DT:store_test.dart:113,129,760 (no store, no writes); DT:no_store_io_test.dart:33 (on the VM no file, directory or link is created); DT:web_storage_test.dart:31 (browser: nothing written with no store) | - | The token is an optimization, so memory is a valid choice. The README lists FileKeyValueStore for the VM and IndexedDbKeyValueStore for the browser. The store is never closed here. |
| Record | {token, expireTimeMillis, issuedAtTimeMillis} under <appId>-<appName> J:client.ts:103-107, J:indexeddb.ts:149-151 | {token, receivedAt, expiresIn} AI:DefaultAppCheckToken.java:36-38,108-120 | token, expiry, received date under app_check_token.<service>.<resource> G:Core/AppCheckCore.swift:50-51 | - | {"v":1,"token","issuedAt","ttl"} (times in milliseconds) under app_check/<persistenceKey>/token; only the session token (DL:token_record.dart:25-30,20) | same (Android) | - | DT:record_test.dart:37 (round trip), :57 (exactly the four fields); DT:security/sentinel_test.dart:202 (no store call or stored value holds any 6-character part of the debug token or the API key; run by every scenario at :340) | - | An issue time and a lifetime, as Android's received time and duration. No limited-use token, debug token or throttle state is written. |
| Stored record checks | an expired token is dropped J:internal-api.ts:89-99 | an unreadable token is cleared AI:StorageHelper.java:94-119 | refused under 5 min or received in the future G:Core/AppCheckCore.swift:174-184 | - | a record is rejected for one of seven reasons (too long, not JSON, unknown version, invalid token, invalid times, issued in the future, expired); a rejected record is removed unless another writer replaced it (DL:token_record.dart:57-102, DL:token_store.dart:52-67,161-170) | different | not in decisions doc | DT:record_test.dart:73 (each reason), :151 (the order), :164 (no part of the value); DT:store_test.dart:288 (removed unless changed), :335 (expired: removed, not logged), :356 | - | Anyone who can write the store can plant a record, so every field is untrusted. Each reason except "expired" is logged once. |
| Load | at activation J:api.ts:143-150 | at construction, in the background; calls wait AI:DefaultFirebaseAppCheck.java:90,94-109,188 | Keychain on every call G:Core/AppCheckCore.swift:165-172 | - | at the first call, for at most 500 ms (DL:token_manager.dart:17,590-630) | different | Dec Load and write timing; Dep Storage/a deadline on the load | DT:store_test.dart:113,129,148 (calls during the load), :218 (slower than 500 ms); DT:manager_test.dart:854 (a call that arrives 300 ms into the load shares its 500 ms from the start: not done at 499 ms, done at 500 ms) | - | A constructor does no I/O, and a blocked store cannot break the 8 s response deadline. |
| Write | awaited J:internal-api.ts:215-218 | in the background AI:DefaultFirebaseAppCheck.java:319-321 | awaited G:Core/AppCheckCore.swift:192 | - | not awaited; every token of the instance's own exchange is written (DL:token_store.dart:71-76, DL:token_manager.dart:374-377) | same (Android) | Dec Load and write timing | DT:store_test.dart:384 (the write is unconditional), :449 (a planted far-expiry record is overwritten) | - | |
| Store failure | a warning, then memory J:storage.ts:32-64 | cleared, never thrown AI:StorageHelper.java:94-119 | a Keychain error; a read error falls through to an exchange G:Core/AppCheckCore.swift:155-163 | - | caught, logged once per operation, memory continues (DL:token_store.dart:121-128,172-177) | same (JS) | Dec Load and write timing | DT:store_test.dart:602 (a failing store: read :607, write :633 and update :663 each logged once, tokens from memory, Exception and Error); DT:store_test.dart:688 (two failed removals give one remove line); DT:seam_test.dart:247 (a store that throws an Error) | - | Errors are caught too. |
| Sharing between instances and tabs | tabs share IndexedDB, read at activation J:api.ts:143-150 | - | - | - | a record issued later than the cached token is adopted at the load, before each proactive refresh and when store.changes reports the key (IndexedDB only) (DL:token_manager.dart:249-260,606, DL:token_store.dart:83-110, DL:refresher.dart:159) | different | Dec Order of stored records; Dec Instances on one store at refresh time; Dep Storage/records ordered by issue time | DT:store_test.dart:421 (a forced refresh replaces a record that expires later), :449, :493, :541, :576; DT:manager_test.dart:665 (no exchange when the token was replaced during the refresh's read); DT:browser/two_tabs_test.dart:106,122 (browser only; it polls with real 10 ms delays, a deliberate exception); DT:refresher_test.dart:142 (the second instance adopts at its own due time, not before it) | - | Records are ordered by issue time, so a forced refresh is never discarded for a record that expires later. |
| Encryption at rest | - | - | Keychain G:Core/Storage/AppCheckCoreStorage.swift:30-33 | - | none; the record is not encrypted | different | not in decisions doc (README states it) | no test | - | Other processes of the same user (file store) and every script of the origin (IndexedDB) can read it, as in JS. The README says so. |
| Feature | JS | Android | iOS | C++ | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|---|
| Error type | FirebaseError appCheck/<code> J:errors.ts:20-32 | FirebaseException with a message AI:NetworkClient.java:198-204 | NSError, codes 0 to 4 IH:FIRAppCheckErrors.h:22-39 | AppCheckError, codes 0 to 5 CH:app_check.h:28-46 | FirebaseAppCheckException extends FirebaseException, plugin firebase_app_check, with httpStatus, serverStatus, serverMessage, retryAfter and cause (DL:exception.dart:55-119) | different | not in decisions doc (house convention) | DT:exchange_test.dart:155 (plugin), :300 (the fields) | - | Kebab-case codes, as every client of the repository. |
| Codes | 11 codes J:errors.ts:20-32 | none | 5 codes IH:FIRAppCheckErrors.h:22-39 | 6 codes CH:app_check.h:28-46 | fetch-network-error, fetch-timeout, fetch-status-error, fetch-parse-error, throttled, provider-error, provider-timeout, app-check-closed; FirebaseAppCheckException.errorCode gives them as the enum AppCheckErrorCode, with unknown for a code this version does not know (DL:exception.dart:4-53,89,166-240) | different | not in decisions doc | DT:exchange_test.dart:173; DT:gate_test.dart:190 (each code is produced); DT:idiomatic_test.dart:264 (AppCheckErrorCode has exactly the eight codes, in order) | - | JS's fetch names and throttled are kept. storage-*, recaptcha-error, initial-throttle, already-initialized and use-before-activation are not used. Programming errors are ArgumentError and StateError. |
| Messages | the original error text and the raw ttl J:errors.ts:43-50, J:client.ts:94-98 | the server body AI:NetworkClient.java:200-204 | the response body G:Core/Errors/AppCheckCoreHTTPError.swift:29-37 | the response body CD:debug_provider_desktop.cc:365-369 | fixed texts; server text only in serverMessage; cause is never rendered (DL:exception.dart:114-118,166-240) | different | Dep Errors/fixed messages; server text only in a field | DT:exchange_test.dart:173,452 (fixed texts); DT:custom_provider_test.dart:118 (the cause is kept, never rendered); DT:security/sentinel_test.dart:656,875 (sentinel texts in every failure; every 6-character part is a needle), :532,:549 (exact exception text) | - | A callback's own text may hold a secret, so cause is kept as an object and never printed. |
| Request URL in errors | the fetch error text, which can name the ?key= URL J:client.ts:66-71 | an IOException from the connection propagates AI:NetworkClient.java:125-136 | - | - | never: a transport exception is not kept as cause, because an HTTP library's text prints the URL (DL:exchange_client.dart:203-210) | different | Lead ruling (errors never carry the URL); Dec API key | DT:security/sentinel_test.dart:585 (the client fails with its URL in its text); DT:exchange_test.dart:539 | - | Errors never carry the URL, so a ?key= could not leak; the key is in a header anyway. |
| Debug token echoed by the server | - | - | - | - | control and invisible characters are removed from serverMessage first, then every verbatim echo of the debug token (ignoring case) becomes <redacted>, then 1 KiB is kept; a 200 token that holds the debug token anywhere is fetch-parse-error (DL:exchange_client.dart:24-40,260-283,306-310) | different | Dep Secrets/removal before redaction; a 200 token that holds the debug token is refused | DT:security/sentinel_test.dart:1097 (18 spellings of the echo and, at :1157, a JSON-escaped echo, redacted), DT:debug_token_echo_test.dart:143 (U+FE0F, U+034F, U+180B, U+E0020), :74 (every range of removed characters, at both ends), :53 (a 200 token that contains the debug token is refused), DT:exchange_test.dart:388 (ignoring case), :257 (a token equal to the debug token is refused); look-alike and overlapping echoes are documented as not caught, no test | - | JS, Android and C++ keep or log the server text with the token in it. Only a verbatim echo is caught: an encoded, split-by-other-means or look-alike spelling is not. |
| Logging | a logger and console.log J:storage.ts:41,59,108 | Log AD:internal/DebugAppCheckProvider.java:109 | the Firebase logger level I:Core/FIRAppCheck.m:73-74 | LogWarning CD:debug_provider_desktop.cc:245-248 | the logger: argument, an AppCheckLogger function of (AppCheckLogLevel, String); seven fixed lines; silent without one (DL:logger.dart:6-135) | different | Dec Default logger | DT:logging_test.dart:78 (the debug-provider line), :166 (the refresh lines), :244 (the failure lines), :300 (the gate lines), :362 (every logger call goes through safeLog); the closed line DT:seam_test.dart:988; store failures DT:store_test.dart:602; refused records DT:store_test.dart:288; DT:security/sentinel_test.dart:223,:340 (print captured, must stay empty); DT:logging_test.dart:446 (a throwing logger on a refused record and a failed removal) | - | The library opens no output channel unasked. No line holds a token, the API key, a URL, a body or a server's or callback's text. |
| A throwing logger | - | - | - | - | every logger call goes through safeLog: what the logger throws, an Error included, or a future it returns that fails, is dropped (DL:logger.dart:115-128,133-135) | different | Lead ruling (safeLog) | DT:logging_test.dart:362 (a logger that throws changes nothing), :478 (a failing future); DT:seam_test.dart:763 (every log line throws; the seam still never throws); DT:logging_test.dart:446 (a throwing logger on a refused record and a failed removal) | - | A log line is never a reason to fail a call or stop a timer. |
toString | - | - | - | - | AppCheckToken and DebugAppCheckProvider print <redacted> for the secret; FirebaseAppCheckException prints code, message and HTTP status only (DL:provider.dart:83,137, DL:app_check_token.dart:37-40,92-95, DL:exception.dart:114-118, DL:firebase_app_check.dart:344-345) | different | not in decisions doc | DT:debug_provider_test.dart:92 (exact text); DT:security/sentinel_test.dart:488 (exact text of AppCheckToken :497, its UTC form :504, SessionToken :512, TokenEvent :519, the exception :532,:549, AppCheckTokenResult :562), :446 (every object's text searched for every 6-character window of every sentinel) | - | No toString in the package prints a debug token, an App Check token or the API key. |
| Feature | JS | Android | iOS | C++ | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|---|
| Interface for products | FirebaseAppCheckInternal J:types.ts:22-39 | InteropAppCheckTokenProvider AX:interop/InteropAppCheckTokenProvider.java:22-49 | FIRAppCheckInterop I:Core/FIRAppCheck.m:208-243 | a function registry CD:app_check_desktop.cc:238-247 | a seam object, FirebaseAppCheck.tokenProvider (an AppCheckTokenProvider that is also a LimitedUseAppCheckTokenProvider, from firebase_app_dart), set as app.appCheckProvider when install is true (DL:app_check_seam.dart:49-156, DL:firebase_app_check.dart:192-195) | same | Dec How the client meets the seam | DT:seam_test.dart:247 (never throws), :316 (usable token without an error), :416 (implements LimitedUseAppCheckTokenProvider), :829 (installation); :591 (the seam's timer is cancelled when the call answers :592, fails :620, and at close() or app deletion :639); :570 (a throw when the timer fires still answers the call); :896 (a constructor that throws StateError leaves no change listener on the store, :925) | - | It never throws and answers within the 8 s response deadline: its own timer fires at 7.75 s. |
| Seam answer deadline | - | - | - | - | each seam call has its own timer 250 ms under the 8 s response deadline (7.75 s): it answers fetch-timeout with the unexpired cached token, or the placeholder, and the work goes on in the background (DL:app_check_seam.dart:13,168-211) | different | Dec Provider deadline | DT:seam_test.dart:442 (forced call joined an exchange, with an unexpired token, with none; 7.749 s and 7.75 s), :485 (a limited-use call whose work stalled 1 s answers at exactly 7.75 s, so only the seam timer can answer), :516 (limited-use with a provider that hangs), :543 (a late session token after the timer is cached and announced) | - | No upstream SDK answers within a deadline. |
| Failure on the interface | the placeholder and the error J:internal-api.ts:40-54,430-435 | the placeholder and the error AI:DefaultAppCheckTokenResult.java:30,43-45 | the placeholder and the error G:Core/AppCheckCoreTokenResult.swift:17,38-43 | an error, no token CD:app_check_desktop.cc:166-174 | AppCheckTokenResult.failure(error), whose token is the placeholder (DL:app_check_seam.dart:114-156,221-233) | same (JS, Android, iOS) | Dec Failure on the seam; Dep Seam/a limited-use failure is the placeholder and an error | DT:seam_test.dart:247 (never throws), :361 (a failure with no unexpired token is the placeholder), :398 (limited-use failure) | - | A limited-use failure is also the placeholder (Android, iOS AI:DefaultFirebaseAppCheck.java:226-248); JS rejects. |
| Last minutes of a token | the still-valid token with internalError J:internal-api.ts:193-205 | the placeholder once under 5 min AI:DefaultFirebaseAppCheck.java:191-221 | the placeholder G:Core/AppCheckCore.swift:174-178 | - | when the request fails, the unexpired cached token: without the error while it is usable, with the error in its last minutes (DL:app_check_seam.dart:221-233) | same (JS) | - | DT:seam_test.dart:334 (a token in its last five minutes comes with the error), :316 (usable: no error); DT:manager_test.dart:279 | - | Dropping the token would not make the request succeed. |
After close() | - | - | - | - | the seam object stays on the app, unbound, and answers an empty token with a StateError, so services send no header; a new FirebaseAppCheck on the app binds it again (DL:app_check_seam.dart:103-111,238-247, DL:firebase_app_check.dart:145,192) | different | Dep Seam/the seam object survives close(); Dec Services that keep the provider they read at creation (Firestore, Auth, Database) | DT:seam_test.dart:988 (re-bound after close), :668 (a call waiting at close() logs no closed line through the next instance), :1043 (the stream ends at app deletion, not at close), :738 (the seam stream does not end at close()); DT:close_test.dart:462 (the seam answers an empty token with a StateError) | - | Firestore, Auth and Database keep the provider they read at creation. Create App Check before them. |
| Emulator | - | - | - | - | none | same | - | no test | - | No App Check emulator exists. An app on emulators creates no instance or uses a custom provider with a fixed string. |
| Library version registration | registerVersion J:index.ts:85 | fire-app-check A:FirebaseAppCheckRegistrar.java:47,78 | fire-app-check I:Core/FIRAppCheckComponent.m:34 | DEFINE_FIREBASE_VERSION_STRING C:common/app_check.cc:62 | none | won't do | Lead ruling (not in decisions doc) | no test (not built) | - | There is no platform logging service in this repository. Upstream it feeds the heartbeat header, which this package does not send. |
| Token supplied by a server app | FirebaseServerApp.settings.appCheckToken, read by Functions JS packages/functions/src/context.ts:58-59 | - | - | - | none; a server passes a CustomAppCheckProvider that returns its token | won't do | Lead ruling (not in decisions doc) | no test (not built) | - | Dart has no FirebaseServerApp. |
| Language idioms | - | Kotlin Firebase.appCheck, component1, component2 A:FirebaseAppCheck.kt:26-44 | Swift names IH:FIRAppCheck.h:30-53 | ...LastResult() futures CH:app_check.h:160,169 | none | won't do | Lead ruling (not in decisions doc) | no test (not built) | - | As on the other parity tabs. |
This document compares the public API and the behaviour of the Firebase AI Logic clients of three official SDKs with firebase_ai_dart (firebase_ai/firebase_ai_dart), feature by feature:
Read from docs/ai_logic_parity.md on origin/main at 9122437c.
packages/ai of firebase-js-sdk at a086865 (@firebase/ai 3.1.0). It is the reference for the protocol and for request and response shapes.ai-logic/firebase-ai of firebase-android-sdk at 2cfdd03 (firebase-ai 18.2.1).FirebaseAI of firebase-ios-sdk at cef246f (FirebaseAILogic 13.3.0).09d2e7a has no AI Logic client, so it has no column.firebase_ai_dart 0.1.0 and the FirebaseAI it describes. The Dart column states the behaviour of the package; it was checked row by row against the code at 9f09e488 (branch mini/firebase-ai). The package has not run against a production project yet; firebase_ai/firebase_ai_dart/tool/verify_production.dart is the check for that. To read a row quickly, start with the Dart and Notes columns.The three SDKs were read as source clones on 2026-11-28; their code was read, not run. Line numbers will drift. The reasons for each departure from upstream, the alternative that was rejected and the test that pins it are in ai_logic_decisions.md; the Departure column names the entry of each row, and "P1" to "P4" are the choices that bind phase 2 (0.2.0). The guide is guides/ai_logic.md.
The Status column compares the Dart behaviour with the SDK named in the cell, or with all three when it names none:
Columns after Status:
- when the row matches upstream.T:file:line; "no test" when none does, or names the part that no test covers.9f09e488 have it; - when there was none.Path shorthand:
J: is JS packages/ai/src.A: is Android ai-logic/firebase-ai/src/main/kotlin/com/google/firebase/ai, AT: is A:type, and AC: is the module root ai-logic/firebase-ai.I: is iOS FirebaseAI/Sources.D: is firebase_ai/firebase_ai_dart/lib/src (this repository).T: is firebase_ai/firebase_ai_dart/test; TT: is firebase_core/_firebase_transport_dart/test, where the shared token rules are pinned.Same: Dart has it as the official SDKs do. Different: Dart has it, in another shape or with other behaviour. Missing: a gap Dart could close. Won't do: will not be done, is not needed, makes no sense in Dart or does not apply to it; none of it is a gap. The Status column keeps the doc's wording, including the SDK named in brackets.
150 feature rows in 13 groups.
| Status | Rows |
|---|---|
| same | 79 |
| different | 53 |
| missing | 4 |
| won't do | 14 |
129 rows are pinned by a named test; 2 more are pinned in part and name what no test covers; 19 have no test (features that are not built, and the model factory, input shortcuts, history size bound and retries). The six rows closed after 0.1.0 (tuned and custom model names, the prefix warning, modelVersion, video metadata, speech metadata, multi-speaker speech) cite the code and tests of the change that closed them rather than 9f09e488. No row keeps an open fix; 7 are resolved.
The official clients are JS (browser and Node), Android, iOS and FlutterFire firebase_ai. FlutterFire's package is Dart, but it depends on the Flutter plugins firebase_core, firebase_app_check and firebase_auth and declares only Android, iOS, macOS and web. firebase_ai_dart is an AI Logic client for the Dart VM (macOS, Windows, Linux: servers, command-line tools, desktop) and the web (dart2js, dart2wasm), with no Flutter dependency. It talks to the same proxy, firebasevertexai.googleapis.com, over REST and server-sent events; no SDK uses gRPC for AI Logic.
| Feature | JS | Android | iOS | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|
| Get an instance | getAI(app, options) J:api.ts:90 | FirebaseAI.getInstance(app, backend, useLimitedUseAppCheckTokens) A:FirebaseAI.kt:247-278 | FirebaseAI.firebaseAI(app:backend:useLimitedUseAppCheckTokens:) I:FirebaseAI.swift:48 | FirebaseAI.googleAI(app:, ...) or FirebaseAI.agentPlatform(app:, location:, ...); sends nothing; app is required D:firebase_ai.dart:52,71 | different | alt: Public API shape | T:firebase_ai_test.dart:549 | - | FlutterFire's call shape without its default app (decisions, alternatives: "Public API shape"). Configuration is immutable and passed in. |
| Instance cache | one per app and backend J:helpers.ts:31-33; a second getAI with another limited-use flag throws already-initialized J:api.ts:106-118 | keyed by backend and limited-use flag A:FirebaseAIMultiResourceComponent.kt:60 | keyed by app, backend and flag I:FirebaseAI.swift:199,308 | none: two calls give two independent instances D:firebase_ai.dart:52-64 | different | alt: Instances | T:firebase_ai_test.dart:535 | - | No global instance cache (decisions, alternatives: "Instances"). |
| Gemini Developer API backend | GoogleAIBackend J:backend.ts:62-83 | GenerativeBackend.googleAI() AT:GenerativeBackend.kt:28 | Backend.googleAI() I:Types/Public/Backend.swift:38 | FirebaseAI.googleAI; model path /v1beta/projects/{projectId}/models/{name} D:backend.dart:58-90 | same | - | T:model_name_test.dart:159-181 | - | |
| Agent Platform backend | AgentPlatformBackend(location?), default global J:backend.ts:94-114, J:constants.ts:22 | GenerativeBackend.agentPlatform(location = "global") AT:GenerativeBackend.kt:38 | Backend.agentPlatform(location: "global") I:Types/Public/Backend.swift:28 | FirebaseAI.agentPlatform(location: 'global'); path .../locations/{location}/publishers/google/models/{name} D:backend.dart:50-90; D:firebase_ai.dart:71-109 | same | - | T:model_name_test.dart:202, :220 | - | |
| Location check | none | blank or containing / throws InvalidLocationException AT:GenerativeBackend.kt:39-40 | fatalError on empty, whitespace or / I:FirebaseAI.swift:274-281 | ArgumentError at construction unless it matches ^[a-z0-9]+(-[a-z0-9]+)*$ D:validation.dart:21,74-82 | different | row 19 | T:firebase_ai_test.dart:176-227 | - | Decisions row 19: the location goes into the URL path; a thrown error replaces iOS's crash. |
| Required app options | no-api-key, no-project-id, no-app-id J:models/utils.ts:32-47 | read, not checked A:FirebaseAI.kt:116-121 | fatalError without project id or API key I:FirebaseAI.swift:236-239 | a missing or empty API key or project id is a StateError at the first call that needs it (FirebaseApp.withOptions already refuses an empty app id); a malformed one an ArgumentError at construction D:validation.dart:89-109; D:headers.dart:123-153; D:generative_model.dart:404-419 | different | row 20 | T:firebase_ai_test.dart:38-175 | - | Decisions row 20: an app can construct an instance it never calls. There is no invalid-app-config code. |
| Host and API version | https://firebasevertexai.googleapis.com, v1beta J:constants.ts:24-29 | the same AT:RequestOptions.kt:28-29 | the same in release builds I:Types/Internal/APIConfig.swift:74,106 | the same; the version is one constant D:backend.dart:8-14 | same | - | T:model_name_test.dart:159-181 (path with v1beta); T:request_shape_test.dart:234 (the production origin by default) | - | Moving to v1 is a minor release, made after the production verification kit passes on it. |
| Base URL override | RequestOptions.baseUrl J:types/requests.ts:455, J:requests/request.ts:99-103 | internal only AT:RequestOptions.kt:28 | DEBUG-only endpoints I:Types/Internal/APIConfig.swift:76-97 | FirebaseAI.test(serverOrigin:), @visibleForTesting: https, or http to a loopback host D:firebase_ai.dart | different (JS) | row 9 | T:firebase_ai_test.dart:269-329 | - | For tests only; a fixed, checked origin keeps tokens away from other hosts (Decisions row 9). |
| Pre-minted App Check token | FirebaseServerApp settings.appCheckToken J:models/utils.ts:57-61 | - | - | none; tokens come only from app.appCheckProvider | won't do | - | no test (not built) | - | Dart has no FirebaseServerApp; a server installs a custom AppCheckTokenProvider. |
| Library version registration | registerVersion J:index.ts:44-46 | LibraryVersionComponent fire-ai A:FirebaseAIRegistrar.kt:59,63 | - (the version goes in the client header only) | none | won't do | - | no test (not built) | - | No platform logging service; the client header carries the version. |
| Injected HTTP client | - (global fetch) | internal engine A:common/APIController.kt:111-124 | internal URLSession I:GenerativeModel.swift:88 | httpClient:; it must abort, must not retry and must not follow redirects D:firebase_ai.dart:55,121-122 | different | row 21 | T:firebase_ai_test.dart:443 (only an owned client is closed); T:security/limits_test.dart:52-246 (the request is aborted at a cap); T:security/hosts_test.dart:153-244 (a redirect is refused); must not retry: no test | - | Decisions row 21: needed for tests and proxies on the VM. A retrying client bills a generation twice; the README says so. |
close() | internal _delete J:service.ts:59 | - | - | close(): idempotent, aborts requests in flight with ai-closed, closes the HTTP client it created; runs when the app is deleted D:firebase_ai.dart:133-134,209-217 | different | row 22 | T:firebase_ai_test.dart:330-533 | - | Decisions row 22: every client of this repository has a close(). |
| Logging | @firebase/logger J:logger.ts:20 | android.util.Log; Ktor logging in debug builds, redacting the key A:common/APIController.kt:161-165 | AILog, -FIRDebugEnabled I:AILog.swift | an AILogger constructor argument, silent when absent; never a token, the key, a body, a prompt or a response D:logger.dart:23-41; D:headers.dart:44-46,155-164 | different | row 23 | T:tokens_test.dart:606-661 (the info line, a logger that throws); T:security/leakage_test.dart:294-495 (no token in any log or message) | resolved: unused dart:async import removed (logger.dart) | Decisions row 23: Remote Config's pattern; no global switch. |
| Feature | JS | Android | iOS | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|
| Model factory | getGenerativeModel(ai, params, requestOptions) J:api.ts:142 | generativeModel(modelName, generationConfig, safetySettings, tools, toolConfig, systemInstruction, requestOptions) A:FirebaseAI.kt:70 | generativeModel(modelName:...) I:FirebaseAI.swift:81 | generativeModel(model:, safetySettings, generationConfig, tools, toolConfig, systemInstruction, requestTimeout, streamIdleTimeout) D:firebase_ai.dart:178-221 | same | - | no test (every test calls it) | - | |
| Default model name | gemini-3.5-flash-lite for hybrid only J:constants.ts:42, J:api.ts:163 | none | none | none; model is required D:firebase_ai.dart:179 | won't do | - | no test (not built) | - | Model names change between releases. |
| Model name rules | Developer API: always models/{name}, so models/x becomes models/models/x; Agent Platform passes other / forms through J:models/ai-model.ts:89-111 | string template, no check A:FirebaseAI.kt:116-121 | fatalError on empty, whitespace or / I:FirebaseAI.swift:256-263 | ^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$, optionally prefixed models/; on Agent Platform also the tuned and custom forms of the next row; anything else ArgumentError D:validation.dart:20,63-112 | different | row 6 | T:model_name_test.dart:75-157, :183-200 | - | Decisions row 6. The name goes into the URL path. |
| Tuned and custom model names | other / forms passed unchecked into the Agent Platform path J:models/ai-model.ts:96-111 | - | - (refuses /) | Agent Platform: publishers/<p>/models/<m> and endpoints/<e>, each segment ^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$, placed after projects/<project>/locations/<location>/; the Developer API refuses every / form but models/ D:validation.dart:63-112; D:backend.dart:58-88 | different (JS) | row 6 | T:model_name_test.dart:245-388 (paths, host and query on both forms; projects/<p>/locations/<l>/... refused even for the instance's own project and location; traversal, extra-segment, backslash, URL, look-alike, whitespace and task forms refused before any request) | - | JS's pass-through lets a name build another project's or location's path; two fixed shapes keep it inside the instance's. |
| Model name prefix warning | - | warns unless gemini- A:FirebaseAI.kt:123-131 | warns unless gemini- or gemma- I:FirebaseAI.swift:89-90 | an AILogLevel.warning unless the model id starts with gemini- or gemma-; a publishers/ form is judged by its model id, an endpoints/ form not at all D:firebase_ai.dart:188-201; D:validation.dart:89-101 | same (iOS) | - | T:model_name_test.dart:389-478 (message text, no API key, app id or project id in it, a throwing logger) | - | The message holds only the checked model name. |
| Readable model configuration | model, generationConfig, safetySettings, tools, toolConfig, systemInstruction J:models/generative-model.ts:55-62 | none public A:GenerativeModel.kt:70-72 | none public I:GenerativeModel.swift:29-56 | model, the plain name D:generative_model.dart:32 | same (Android, iOS) | - | T:model_name_test.dart:98 | - | |
| Configuration checks at creation | unsupported for budget with level, schema with JSON schema, or a schema without a JSON MIME type J:models/generative-model.ts:252-286 | builders throw for budget with level and for schema with JSON schema AT:ThinkingConfig.kt:92-96, AT:GenerationConfig.kt:235-237 | budget and level exclusive by initializer I:Types/Public/ThinkingConfig.swift:61,80 | budget and level exclusive by constructor (withThinkingBudget, withThinkingLevel); when the model is made, only the model name, the system instruction and the durations are checked; the safety settings, generation configuration, tools and tool configuration are checked at every call, model-level ones included D:config.dart:213-222; D:firebase_ai.dart:188-204; D:generative_model.dart:267-287 | different | alt: Request validation | T:validation_test.dart:344 (checked at the call, not at generativeModel); T:validation_test.dart:274 | resolved: generativeModel dartdoc now names the checks made at each call (firebase_ai.dart:143-150) | Client checks protect only the client and the URL; copied server rules drift (decisions, alternatives: "Request validation"). A bad model-level value fails at the first call, not at generativeModel. |
| Per-call configuration | request fields override the model's J:models/generative-model.ts:143-166 | - | internal only I:GenerativeModel.swift:263 | safetySettings, generationConfig, tools, toolConfig per call; they replace the model's values D:generative_model.dart:267-287 | same (JS) | - | T:chat_test.dart:1121 (a chat's configuration replaces the model's); T:request_shape_test.dart:597-664 (per call) | - | Replace, not merge, as FlutterFire does. |
| Request timeout | 180 s, RequestOptions.timeout J:constants.ts:37, J:types/requests.ts:446-448 | 180 s, timeoutInMillis AT:RequestOptions.kt:42 | 180 s, RequestOptions(timeout:) I:GenerativeAIRequest.swift:34 | requestTimeout 180 s per model; timeout per call D:firebase_ai.dart:185; D:generative_model.dart:289-299 | same | - | T:timeout_test.dart:286-337; T:validation_test.dart:169 (negative refused) | - | What the deadline covers differs; see "Transport and bounds". |
| Per-call cancel | SingleRequestOptions.signal J:types/requests.ts:477-508 | coroutine cancellation | task cancellation I:GenerativeAIService.swift:128-130 | abortTrigger future on every call that returns a future (generateContent, countTokens, sendMessage); the call fails with cancelled. A stream has none: cancelling its subscription aborts it D:generative_model.dart:53,134; D:chat.dart:50; D:request.dart:206-214 | same (JS) | - | T:timeout_test.dart:502-581 (against the deadline); T:stream_test.dart:293-394 (in flight, completed before the call) | - | The backend may still finish and bill the request; the README says so. |
| Feature | JS | Android | iOS | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|
generateContent | J:models/generative-model.ts:143 | A:GenerativeModel.kt:83-118 | I:GenerativeModel.swift:134,144 | Future<GenerateContentResponse> generateContent(Iterable<Content> prompt, {safetySettings, generationConfig, tools, toolConfig, timeout, abortTrigger}) D:generative_model.dart:46-65 | same | - | T:model_name_test.dart:159-181 (URL, method); T:response_test.dart:972 (decoding); T:request_shape_test.dart:156-248 (exact URL, headers and body) | - | |
| Input shortcuts | a string or an array of strings and parts J:requests/request-helpers.ts:120 | String and Bitmap overloads, JPEG at quality 80 A:GenerativeModel.kt:107,118 | PartsRepresentable, images as JPEG I:PartsRepresentable+Image.swift | Content.text, Content.multi, Content.inlineData(mimeType, bytes), Content.model, Content.functionResponse, Content.functionResponses and Content.system; no image codec D:content.dart:61-95 | different | row 24 | no test (factories are used by every test) | - | Decisions row 24: a Dart program has no platform image type; it passes bytes and a MIME type. |
generateContentStream | {stream, response} J:models/generative-model.ts:174, J:types/responses.ts:46-49 | Flow A:GenerativeModel.kt:129-164 | AsyncThrowingStream I:GenerativeModel.swift:164,175 | lazy Stream<GenerateContentResponse> built with Stream.multi (each listener starts its own request), with the arguments of generateContent; nothing is sent, and no deadline runs, until it is listened to; argument errors are thrown before the stream is returned D:generative_model.dart:85-124; D:stream.dart:44-62 | same (Android, iOS) | - | T:stream_test.dart:629 (nothing is sent until it is listened to); T:stream_test.dart (an unlistened stream has no timer; every listen sends its own request) | resolved: the call starts at the listen (L-N3) | The call deadline starts at the listen: a stream that is never listened to has no timer and no place among the instance's calls. |
| Aggregated stream response | the response promise J:requests/stream-reader.ts:94-137 | - | - | internal only D:aggregate.dart:31-79; D:stream.dart:266-271 | won't do | alt: Stream result | T:stream_test.dart:575-627 (the exception carries the aggregate) | - | A public aggregate would fix the merge rules as API (decisions, alternatives: "Stream result"). A failed stream's exception carries it. |
countTokens | J:models/generative-model.ts:229 | A:GenerativeModel.kt:224-257 | I:GenerativeModel.swift:199,208 | Future<CountTokensResponse> countTokens(Iterable<Content>, {timeout, abortTrigger}) D:generative_model.dart:131-140 | same | - | T:response_test.dart:765-788 (decoding); T:validation_test.dart:119 (argument checks); T:request_shape_test.dart:184-211, :293-362 (call, body, totalTokens); T:errors_test.dart:186-268 (a 200, a 400 envelope, an Agent Platform 404) | resolved: README :237-239 and guides/ai_logic.md :288 say the history must not be empty (N2) | |
countTokens body, Developer API | {generateContentRequest: {model, contents}} J:googleai-mappers.ts:121-133 | the wrapper with the model's configuration, roles kept A:common/Request.kt:62-71 | the wrapper with the model's configuration, roles removed, models/{name} I:GenerativeModel.swift:208-232 | iOS's shape D:backend.dart:159-168 | same (iOS) | row 12 | T:request_shape_test.dart:293-362 | - | Decisions row 12: the count includes what generateContent sends. |
countTokens body, Agent Platform | {contents} only J:methods/count-tokens.ts:42-47 | flat fields plus model A:common/Request.kt:73-80 | contents, systemInstruction, tools, generationConfig I:Types/Internal/Requests/CountTokensRequest.swift:73-83 | iOS's shape D:backend.dart:148-158 | same (iOS) | row 12 | T:request_shape_test.dart:293-362 | - | Decisions row 12. |
model field in the generate body | none J:methods/generate-content.ts:48-60 | sent A:common/Request.kt:35-43 | only for countTokens I:GenerateContentRequest.swift:46-50 | none D:backend.dart:128-135 | same (JS, iOS) | - | T:request_shape_test.dart:363-387 | - | The proxy accepts both. |
CountTokensResponse | totalTokens, promptTokensDetails J:types/responses.ts:569 | AT:CountTokensResponse.kt:31 | missing values decode to 0 and [] I:Types/Internal/Requests/CountTokensRequest.swift:42-47 | totalTokens, promptTokensDetails, raw D:response.dart:728-756 | same | - | T:response_test.dart:765-788 | - | |
| Typed structured output | - | generateObject(JsonSchema<T>), @Generable and a KSP generator A:GenerativeModel.kt:184-210, A:annotations | - | none; the app sets responseSchema or responseJsonSchema and parses text | won't do | - | no test (not built) | - | It needs code generation; Dart gets structured output through responseSchema JSON. |
| Checks before sending | chat message shape only J:requests/request-helpers.ts:103-115 | chat role only A:Chat.kt:240-249 | a failed image conversion throws when sent I:ModelContent.swift:22-30 | prompt not empty, every content has a part, no system role in a prompt, finite doubles, values JSON can encode (see "Values JSON cannot encode"); ArgumentError, thrown synchronously by the stream methods D:validation.dart:153-157,163-187; D:generative_model.dart:85-101 | different | alt: Request validation | T:validation_test.dart:124-215, :361-639 | - | Only checks that protect the client or the URL; the server decides the rest. |
| Values JSON cannot encode | JSON.stringify writes null for NaN and fails on a cycle at send time | - | - | a NaN or infinite number, a cycle, a map key that is not text, or an object with no working toJson in a prompt, a function argument or response, a schema or the settings is an ArgumentError naming the field and never the value, thrown before anything is sent | different (JS) | row 32 | T:validation_test.dart:361-639 | - | Decisions row 32. Android and iOS were not read for this row. |
| Feature | JS | Android | iOS | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|
| Content and roles | user, model, function, system J:types/enums.ts:28, J:types/content.ts:24 | Content(role = "user", parts) AT:Content.kt:37 | ModelContent(role: "user", parts:) I:ModelContent.swift:132 | Content(ContentRole? role, Iterable<Part> parts) (the parts are copied) with factories; a null role is omitted D:content.dart:11-40,47-58 | same | - | T:validation_test.dart:156 (roles user, model, function, null); T:chat_test.dart:249 | - | |
| System instruction | string, part or content, role system J:requests/request-helpers.ts:32 | role forced to system A:generativemodel/CloudGenerativeModelProvider.kt:117 | role removed I:GenerativeModel.swift:100-106 | Content.system(...), role system; a system content in a prompt throws D:content.dart:94-95; D:validation.dart:170-176 | same (JS, Android) | - | T:validation_test.dart:137; T:chat_test.dart:1121 | - | |
| Text part | J:types/content.ts:76 | AT:Part.kt:47 | I:Types/Public/Part.swift:30 | TextPart D:content.dart:190-211 | same | - | T:response_test.dart:556-608 (read and written back); T:request_shape_test.dart:156-248, :1361-1618 (wire body) | - | |
| Inline data part | J:types/content.ts:117 | AT:Part.kt:232 | I:Types/Public/Part.swift:94 | InlineDataPart(mimeType, bytes), base64 on the wire D:content.dart:260-298 | same | - | T:response_test.dart:451-471; T:chat_test.dart:1057 (base64 AQID on the wire) | - | No size check, as upstream; the server enforces its own limit, which the production verification kit measures (tool/verify_production.dart, check K11). |
| File data part | J:types/content.ts:168 | AT:Part.kt:452 | I:Types/Public/Part.swift:134 | FileData(mimeType, fileUri) D:content.dart:301-329 | same | - | T:response_test.dart:556-608 (read and written back); T:request_shape_test.dart:1361-1618 (wire body, both backends) | - | The client does not check which URI schemes a backend accepts; the production verification kit asks the server. |
| Function call part | J:types/content.ts:148,233 | AT:Part.kt:315 | I:Types/Public/Part.swift:164 | FunctionCall(name, args, {id}) D:content.dart:332-358 | same | - | T:response_test.dart:556-608 (read and written back); T:request_shape_test.dart:1361-1618 (wire body, both backends) | - | |
| Function response part | {id, name, response, parts} J:types/content.ts:256-267 | FunctionResponsePart(name, response, id, parts) AT:Part.kt:375 | FunctionResponsePart(name, response, functionId) I:Types/Public/Part.swift:220 | FunctionResponse(name, response, {id}), sent with role user; Content.functionResponse builds it D:content.dart:361-387,79-85 | same (iOS) | - | T:response_test.dart:556-608 (read and written back); T:request_shape_test.dart:1361-1618 (wire body, both backends) | - | JS and Android also carry multimodal parts in a function response; Dart follows iOS. |
| Code execution parts | J:types/content.ts:179,189 | AT:Part.kt:98,146 | I:Types/Public/Part.swift:270,324 | ExecutableCodePart({language, code}), CodeExecutionResultPart({outcome, output}); language is a CodeLanguage and outcome a CodeOutcome; a value this version does not know keeps the part an UnknownPart D:content.dart:394-500 | same | - | T:response_test.dart:556-608 (read and written back); T:request_shape_test.dart:1361-1618 (wire body, both backends) | - | |
| Thought flag and signature | thought, thoughtSignature J:types/content.ts:57-61 | isThought, thoughtSignature AT:Part.kt:34,50-51 | isThought, internal signature I:Types/Public/Part.swift:26,39 | isThought and thoughtSignature on every part, read and written back D:content.dart:151-187 | same | - | T:response_test.dart:556-608 (read and written back); T:request_shape_test.dart:1361-1618 (wire body, both backends) | - | A reply sent back without its signature can end with MISSING_THOUGHT_SIGNATURE. |
| Video metadata | videoMetadata on the inline-data part J:types/content.ts:117-142; the Developer API mapper refuses it in responses J:googleai-mappers.ts:174-185 | - | - | VideoMetadata(startOffset, endOffset) as Durations on InlineDataPart and FileData, written and read as protobuf durations on both backends D:content.dart:240-257,277,318,691-730 | different (JS) | row 35 | T:speech_video_version_test.dart:429-711 (encoding table, both backends with count, bad offsets null, fps kept in raw) | - | Also on FileData, and no response-side refusal on the Developer API (decisions row 35). |
| Speech metadata on text | speechMetadata J:types/content.ts:89-111 | speechMetadata, preview AT:Part.kt:52 | internal I:Types/Public/Part.swift:35 | TextPart.speechMetadata: SpeechMetadata(speaker, style), written and read; a wrong type is null and the text stays D:content.dart:203,217-232,682-689 | same (JS, Android) | - | T:speech_video_version_test.dart:269-428 | - | |
| Unknown parts | an untyped part before tagging J:types/content.ts:49 | - | dropped with a log I:ModelContent.swift:246-251 | UnknownPart(data), kept and written back unchanged; inline data that is not valid base64 becomes one too; a part with no keys is dropped D:content.dart:503-523,563-587 | different | alt: Unknown response data; row 11 | T:response_test.dart:401-472 | - | New part kinds survive a chat round trip (decisions, alternatives: "Unknown response data"). |
| Feature | JS | Android | iOS | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|
GenerationConfig fields | 15 fields J:types/requests.ts:162-239 | the same 15 AT:GenerationConfig.kt:72 | 14, no responseJsonSchema I:GenerationConfig.swift:21-60 | the same 15 D:config.dart:121-207 | same (JS, Android) | - | T:request_shape_test.dart:156-211 (temperature, maxOutputTokens), :809-1180 (every field, both backends) | - | |
topK type | a number, rounded with a warning for the Developer API J:googleai-mappers.ts:71-82 | Int | Int | int D:config.dart:157 | same (Android, iOS) | - | T:request_shape_test.dart:1128-1180 (topK and the counts are integers, the rest doubles) | - | An integer needs no rounding. |
| Thinking configuration | thinkingBudget, thinkingLevel, includeThoughts J:types/requests.ts:843 | builder AT:ThinkingConfig.kt:27 | two initializers I:Types/Public/ThinkingConfig.swift:61,80 | ThinkingConfig.withThinkingBudget and .withThinkingLevel, includeThoughts D:config.dart:211-239 | same (iOS) | - | T:request_shape_test.dart:851-933 | - | |
| Image configuration | enums: 14 aspect ratios, 4 sizes J:types/enums.ts:295-336 | 10 aspect ratios AT:ImageConfig.kt:28 | 14 aspect ratios I:Types/Public/ImageConfig.swift:31 | ImageConfig(aspectRatio, imageSize) as strings D:config.dart:320-335 | different | row 25 | T:request_shape_test.dart:934-964 | - | Decisions row 25: values are added server-side; a string needs no client release. |
| Response modalities | TEXT, IMAGE, AUDIO J:types/enums.ts:409 | AT:ResponseModality.kt:24 | I:Types/Public/ResponseModality.swift | ResponseModality { text, image, audio } D:config.dart:99-115 | same | - | T:request_shape_test.dart:965-1003 | - | |
| Speech configuration, one voice | J:types/requests.ts:950 | AT:SpeechConfig.kt:85 | SpeechConfig(voiceName:languageCode:) I:Types/Public/SpeechConfig.swift:48 | SpeechConfig({languageCode, voiceName}) D:config.dart:243-275 | same | - | T:request_shape_test.dart:1004-1049 | - | |
| Multi-speaker speech | MultiSpeakerSpeechConfig J:types/requests.ts:962-989 | MultiSpeakerVoiceConfig, SpeakerVoiceConfig AT:SpeechConfig.kt:31,60 | SpeechConfig(multiSpeakerVoiceConfig:) I:Types/Public/SpeechConfig.swift:77 | SpeechConfig.multiSpeaker with MultiSpeakerVoiceConfig and SpeakerVoiceConfig, camelCase JSON as JS; exactly two speakers with distinct names, else ArgumentError before sending D:config.dart:254-316; D:validation.dart:364-399 | different | row 34 | T:speech_video_version_test.dart:712-869 (JSON on both backends with count; 0, 1, 3 speakers and a repeated name refused) | - | The count is the limit the Firebase documentation states; no SDK checks it (decisions row 34). |
| Safety settings | {category, threshold, method} J:types/requests.ts:130 | AT:SafetySetting.kt:30 | I:Safety.swift:217 | SafetySetting(category, threshold, [method]) D:config.dart:338-358 | same | - | T:request_shape_test.dart:156-211, :508-596 | - | |
method on the Developer API | unsupported before sending J:googleai-mappers.ts:59-69 | InvalidStateException before sending A:generativemodel/CloudGenerativeModelProvider.kt:104-112 | no check | FirebaseAIException('unsupported') before sending D:validation.dart:295-302 | same (JS, Android) | - | T:validation_test.dart:659-695 | - | Thrown at the call, also for a model-level setting. The production verification kit (check K14) asks the server whether it accepts the field; the refusal is removed if it does. |
| Harm categories | four J:types/enums.ts:34-39 | four plus civic integrity, four image categories and UNKNOWN AT:HarmCategory.kt:71-101 | five, with civic integrity I:Safety.swift:240-252 | four; any other string decodes as unknown, which cannot be sent D:config.dart:5-33; D:validation.dart:288-293; D:response.dart:782-789 | same (JS) | - | T:validation_test.dart:642; T:response_test.dart:317 | - | Android's and iOS's extra categories cannot be set. |
| Thresholds and methods | five thresholds, two methods J:types/enums.ts:51-96 | AT:HarmBlockThreshold.kt:23, AT:HarmBlockMethod.kt:26 | I:Safety.swift:152-181 | HarmBlockThreshold (five), HarmBlockMethod (two) D:config.dart:36-74 | same | - | T:request_shape_test.dart:508-596 (methods), :597-664 (BLOCK_LOW_AND_ABOVE, BLOCK_NONE); the other thresholds: no test | - |
| Feature | JS | Android | iOS | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|
| Function declarations | {name, description, parameters} J:types/requests.ts:531,659 | Tool.functionDeclarations AT:Tool.kt:72, AT:FunctionDeclaration.kt:55 | Tool.functionDeclarations I:Tool.swift:220, FunctionDeclaration I:Tool.swift:41 | Tool.functionDeclarations([FunctionDeclaration(name, description, {parameters})]) D:tool.dart:37-40,73-88,112-143 | same | - | T:request_shape_test.dart:156-211, :447-496 | - | Manual function calling only in 0.1.0. |
| Search, code execution, URL context and Maps tools | J:types/requests.ts:515-520 | AT:Tool.kt:97-154 | I:Tool.swift:242-271 | Tool.googleSearch(), .codeExecution(), .urlContext(), .googleMaps(), passed through; const constructors of a sealed Tool (GoogleSearchTool and the others) D:tool.dart | same (constructor names) | - | T:request_shape_test.dart:156-211 (googleSearch), :1181-1251 (the four built-in tools, each an empty object), :597-664 (codeExecution per call) | - | |
| Tool configuration | mode AUTO, ANY, NONE, allowedFunctionNames J:types/requests.ts:768-788 | AT:ToolConfig.kt:27, AT:FunctionCallingConfig.kt:27 | I:Tool.swift:121-148 | ToolConfig({functionCallingConfig, retrievalConfig}); FunctionCallingConfig({mode, allowedFunctionNames}) with FunctionCallingMode { auto, any, none } D:tool.dart:6-22,147-181 | same | - | T:request_shape_test.dart:156-211, :597-664, :1318-1354 | - | |
| Retrieval configuration | {latLng, languageCode} J:types/requests.ts:794 | AT:RetrievalConfig.kt:27 | a CLLocationCoordinate2D I:Tool.swift:170 | RetrievalConfig({latLng: LatLng(latitude:, longitude:), languageCode}) D:tool.dart:185-219 | same | - | T:request_shape_test.dart:1252-1332 | - | |
| Schema builders | Schema.string, integer, number, boolean, enumString, array, object, anyOf J:requests/schema-builder.ts:110-160 | adds long, double, float AT:Schema.kt:62-322 | adds float, double I:Types/Public/Schema.swift:176-450 | Schema.string, enumString, integer, number, boolean, array, object, anyOf, redirecting to the final subclasses of a sealed Schema (StringSchema, EnumSchema, ObjectSchema and the others) D:schema.dart | same (JS, constructor names) | - | T:schema_test.dart:61-110 (object); T:request_shape_test.dart:388-446 (wire form) | - | The number variants are Schema.number(format:). |
| Optional properties | all required unless listed; an unknown name throws invalid-schema J:requests/schema-builder.ts:289-331 | optionalProperties AT:Schema.kt:228 | an unknown name is fatalError I:Types/Public/Schema.swift:404-414 | required is the property keys minus optionalProperties; Schema.object throws ArgumentError (name optionalProperties) for a name that is not a property D:schema.dart:101-108,298-341,372-390 | different | not in decisions doc | T:schema_test.dart:16-58 (refused), :61-110 (required); T:request_shape_test.dart:447-506 | resolved: this row | JS throws invalid-schema and iOS stops with fatalError; Dart's error is an ArgumentError, matched by exact name. |
| Schema type case | lower case J:types/schema.ts:26 | upper case AT:Schema.kt:67 | upper case I:Types/Internal/DataType.swift:20 | upper case, the proto enum names D:schema.dart:5-30,127-132 | same (Android, iOS) | - | T:request_shape_test.dart:388-446 | - | The proxy accepts both (inferred). |
| JSON Schema output | responseJsonSchema J:types/requests.ts:162-239 | typed JsonSchema<T> AT:JsonSchema.kt:45 | - | JsonSchema(json), sent verbatim D:config.dart:172,198; D:schema.dart:364-370 | same (JS) | - | T:request_shape_test.dart:1050-1127 | - |
| Feature | JS | Android | iOS | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|
| Response object | candidates, promptFeedback, usageMetadata J:types/responses.ts:106 | adds modelVersion, inferenceSource AT:GenerateContentResponse.kt:31-38 | adds modelVersion I:GenerateContentResponse.swift:63-80 | candidates, promptFeedback, usageMetadata, raw D:response.dart:213-256 | same (JS) | - | T:response_test.dart:928-969 | - | raw keeps fields the version does not model. |
modelVersion | - | AT:GenerateContentResponse.kt:38 | default unknown-model-version I:GenerateContentResponse.swift:74-80 | modelVersion, null when absent or not text, also in raw; a stream's aggregate takes the last one D:response.dart:235,251; D:aggregate.dart:26-27,39,53-55,68,75-77 | same (Android) | - | T:speech_video_version_test.dart:92-195 (both backends' answers, wrong types, stream chunks), :196-268 (aggregate of v1, v2, none is v2; a later wrong type keeps the earlier value; a failed stream's partial answer) | - | Null rather than iOS's invented default, as Android. |
text accessor | text parts joined with '' J:requests/response-helpers.ts:223 | joined with a space AT:GenerateContentResponse.kt:52 | joined with a space I:GenerateContentResponse.swift:191 | non-thought text parts of the first candidate joined with ''; null when none D:response.dart:266,285-291 | same (JS) | - | T:response_test.dart:610-638; T:finish_reason_test.dart:272 | - | |
| Other accessors | thoughtSummary(), functionCalls(), inlineDataParts() J:requests/response-helpers.ts:152-200 | AT:GenerateContentResponse.kt:63-89 | I:GenerateContentResponse.swift:108-140 | thoughtSummary, functionCalls, inlineDataParts getters; they never throw (empty or null for a blocked response) D:response.dart | different (JS) | - | T:finish_reason_test.dart:165-196 | - | Only the first candidate is examined, as in JS. |
| Finish reasons that throw | accessors throw for 16 reasons J:requests/response-helpers.ts:280-302 | any reason but STOP throws on receipt, MAX_TOKENS included A:common/APIController.kt:498-502 | first candidate not STOP throws on receipt I:GenerativeModel.swift:290-294 | JS's rule for text alone: it throws response-error for the 16; the other three accessors give null or an empty list; MAX_TOKENS, OTHER and unknown never throw D:response.dart:280-306; D:validation.dart:29-50 | same (JS) | not a departure (decisions, "Choices against Android and iOS") | T:finish_reason_test.dart:159-216, :322-440 | - | Not a departure, as JS is the reference. A billed partial answer stays usable (decisions, alternatives: "Finish reasons"). |
| Blocked prompt | accessors throw on any promptFeedback J:requests/response-helpers.ts:138-149 | PromptBlockedException on receipt A:common/APIController.kt:497 | promptBlocked on receipt I:GenerativeModel.swift:286-288 | with no candidate, text throws only when blockReason is set D:response.dart:266,293-325 | different | row 18 | T:finish_reason_test.dart:219-290 | - | Decisions row 18: every event is emitted, so JS's rule would make chunk.text throw on a harmless chunk. |
| Candidate fields | J:types/responses.ts:181-190 | AT:Candidate.kt:47 | I:GenerateContentResponse.swift:197-217 | index, content, finishReason, finishMessage, safetyRatings, citationMetadata, groundingMetadata, urlContextMetadata, raw D:response.dart:324-365 | same | - | T:response_test.dart:640-689 | - | |
| Candidate index | only candidate 0 gets a default J:requests/response-helpers.ts:111-116 | no index field AT:Candidate.kt:47 | no index field | a missing index gets its list position D:response.dart:827 | different (JS) | row 15 | T:response_test.dart:641, :725 | - | Decisions row 15. |
| Finish reason values | 19 values J:types/enums.ts:205 | the same plus UNKNOWN AT:Candidate.kt:311 | open enum I:GenerateContentResponse.swift:285 | 19 values plus unknown D:response.dart:14-79 | same | - | T:response_test.dart:213-257 | - | |
| Prompt feedback and block reasons | J:types/responses.ts:166, J:types/enums.ts:176 | AT:PromptFeedback.kt:31,53 | I:GenerateContentResponse.swift:376 | PromptFeedback, BlockReason with unknown D:response.dart:82-102,369-390 | same | - | T:response_test.dart:258-283 | - | |
| Safety ratings | J:types/responses.ts:538 | probabilityScore defaults to 0 AT:Candidate.kt:169 | I:Safety.swift:24-53 | SafetyRating with nullable fields D:response.dart:394-426,859-875 | same (JS) | - | T:response_test.dart:181, :284-316, :737-764 | - | |
| Developer API safety defaults | invents HARM_SEVERITY_UNSUPPORTED and scores of 0 J:googleai-mappers.ts:162-171,212-218 | - | - | missing fields stay null D:response.dart:859-875; D:backend.dart:171-184 | different (JS) | row 7 | T:backend_mapping_test.dart:94-146 | - | Decisions row 7. |
| Citations | citationSources renamed to citations for the Developer API J:googleai-mappers.ts:153-158 | AT:Candidate.kt:217-252 | decodes both keys I:GenerateContentResponse.swift:675-684 | renamed in the backend mapper; publicationDate only when year, month and day are valid D:backend.dart:206-238; D:response.dart:877-904 | same | - | T:backend_mapping_test.dart:148-254; T:response_test.dart:790-874 | - | |
| Grounding metadata | web and Maps chunks, supports, queries, widget token J:types/responses.ts:241-418 | no Maps text, no widget token AT:Candidate.kt:468-640 | I:GenerateContentResponse.swift:430 | every JS field D:response.dart:906-956 | same (JS) | - | T:response_test.dart:875-927 | - | |
| URL context metadata | J:types/responses.ts:425-505 | AT:Candidate.kt:666-730 | I:Types/Public/URLContextMetadata.swift:18 | UrlContextMetadata, UrlRetrievalStatus with unknown D:response.dart:958-972 | same | - | T:response_test.dart:371-399 | - | |
| Usage metadata | ten fields J:types/responses.ts:117-147 | AT:UsageMetadata.kt:36 | I:GenerateContentResponse.swift:20-59 | the same ten, nullable D:response.dart:653-718,974-988 | same | - | T:response_test.dart:690-764 | - | |
| Unknown fields and values | any string accepted | UNKNOWN members, unknown keys ignored A:common/APIController.kt:91-97 | open enums, logged | a field of the wrong type is absent and stays in raw; unknown enum strings are unknown D:response.dart:765-780,791-822 | same | - | T:response_test.dart:129-212 | - |
| Feature | JS | Android | iOS | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|
| Endpoint | :streamGenerateContent?alt=sse J:requests/request.ts:105-110 | A:common/APIController.kt:245 | I:GenerateContentRequest.swift:79 | the same D:backend.dart:86-88 | same | - | T:model_name_test.dart:159-181 (alt=sse) | - | |
| SSE parsing | one data: line per event, a regex J:requests/stream-reader.ts:40 | line by line, data: removed A:common/util/ktor.kt:48-54,81-86 | data: lines; other lines kept as an error body I:GenerativeAIService.swift:100-119 | the shared SseDecoder: full SSE grammar, data over several lines, 64 MiB per event, 256 MiB per stream D:stream.dart:13-17,144-151,159-165 | different | row 9 | T:sse_test.dart:74-143 (caps), :284 (data over two lines), :300-350 (line endings) | - | Decisions row 9: no SDK caps a stream. A document split over several data: lines fails JS's regex. |
| UTF-8 and leftover text | strict UTF-8; leftover text is parse-failed J:requests/stream-reader.ts:57-59,191-197 | - | leftover text parsed as an error I:GenerativeAIService.swift:117-118 | strict UTF-8; a body ending inside an event is parse-failed D:stream.dart:200-204; D:errors.dart:157-165 | same (JS) | - | T:sse_test.dart:146-198 | - | |
| Error inside a 200 stream | - | - | non-data: lines become an error at the end I:GenerativeAIService.swift:112-119 | an event with a top-level error becomes the exception of its envelope; the stream closes D:stream.dart:180-183; D:errors.dart:92-114 | different | row 27 | T:stream_test.dart:129-179; T:stream_test.dart:644-744 (an event with no error.code) | resolved: E-N1 is pinned (T:stream_test.dart:644-744) | Decisions row 27: an error must never be read as a chunk (row 1 for the non-200 case). An event with no error.code has httpStatus null, like a local failure. |
| Which events are emitted | events without parts, finish reason, citations or URL context are hidden J:requests/stream-reader.ts:164-172 | every chunk | chunks with empty candidates skipped I:GenerativeModel.swift:345-351 | every event that decodes D:stream.dart:184-192 | different (JS, iOS) | row 3 | T:stream_test.dart:55-93 | - | Decisions row 3: JS hides the final usage event. |
| Aggregation | last chunk's values, overwritten with undefined; role user; empty text parts dropped J:requests/stream-reader.ts:235-315 | - | chat merges adjacent text parts I:History.swift:47 | candidates grouped by index (absent counts as 0); last non-null value per field; role is the first one seen, else model; an empty text part is dropped unless it has a signature; text parts are not merged D:aggregate.dart:31-157 | different | row 15 | T:backend_mapping_test.dart:255-654 | - | Decisions row 15. |
| Usage in the aggregate | dropped J:requests/stream-reader.ts:239-241 | - | - | the last non-null one D:aggregate.dart:51-52,72-77 | different | row 3 | T:stream_test.dart:94-128; T:backend_mapping_test.dart:526-558 | - | Decisions row 3. |
| Empty part object | invalid-content during aggregation J:requests/stream-reader.ts:298-304 | - | - | dropped D:content.dart:525-535 | different | row 11 | T:response_test.dart:1023-1052, :401 | - | Decisions row 11: JS fails after the chunks were shown. |
| Non-200 answer to a stream | an error before the body is read J:requests/request.ts:237 | A:common/APIController.kt:427 | whole body parsed as an error I:GenerativeAIService.swift:81-96 | read with a 64 KiB cap, then the error described under "Errors" D:stream.dart:119-130 | same | - | T:stream_test.dart:180-230 | - | |
| Stream deadline | the timer is cleared at the headers; nothing bounds the body J:requests/request.ts:307-310 | Ktor request timeout; socket timeout at least 180 s A:common/APIController.kt:154-156 | timeoutInterval 180 s I:GenerativeAIService.swift:147 | the call's deadline until the headers, then two idle bounds of streamIdleTimeout (180 s): no bytes, and no event; a comment line counts as bytes but does not extend the event bound; a per-call timeout replaces the deadline and both idle bounds D:stream.dart:110-113,141-157,244-251; D:generative_model.dart:359 | different | row 13 | T:timeout_test.dart:94-284, :354 (a per-call timeout replaces both bounds) | - | Decisions row 13: a stalled stream would otherwise hang and block a chat. |
| Stream cancel | AbortSignal J:types/requests.ts:508 | coroutine cancellation | task cancellation I:GenerativeAIService.swift:128-130 | cancelling the subscription aborts the request and is not an error, also for one of several listeners; a stream takes no abortTrigger; close() emits ai-closed D:stream.dart:233-240; D:generative_model.dart:85-124 | same | - | T:stream_test.dart:231-290, :525-572 (cancel, one of two listeners), :395-468 (close()); T:browser/stream_test.dart:200 (browser cancel aborts the request and cancels the body) | resolved: browser cancel spy (T:browser/stream_test.dart:200) | |
| Partial answer on failure | - | - | - | the exception's response holds the aggregate of the emitted chunks D:stream.dart:266-271; D:exception.dart:72-86 | different | row 28 | T:stream_test.dart:575-627 | - | Decisions row 28: a billed partial answer is not lost. |
| Feature | JS | Android | iOS | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|
| Start a chat | startChat(params) J:models/generative-model.ts:204 | startChat(history) A:GenerativeModel.kt:213 | startChat(history:) I:GenerativeModel.swift:181 | startChat({history, safetySettings, generationConfig}) D:generative_model.dart:151-166 | same | - | T:chat_test.dart:74-178 | - | |
| Per-chat tools, tool config and system instruction | StartChatParams J:types/requests.ts:388-393 | - | - | the model's D:chat.dart:60-64; D:generative_model.dart:151-166; D:generative_model.dart:421-430 | same (Android, iOS) | - | T:chat_test.dart:1121 | - | A chat may set its own safety settings and generation config only. |
| Send a message | sendMessage, sendMessageStream J:methods/chat-session.ts:139,151 | A:Chat.kt:68,149 | I:Chat.swift:46-75 | sendMessage(Content, {timeout, abortTrigger}), sendMessageStream(Content, {timeout}) D:chat.dart:48-89 | same | - | T:chat_test.dart:734-763 | - | |
| Read the history | async getHistory(), waits for sends J:methods/chat-session-base.ts:93-95 | public mutable list A:Chat.kt:51 | get and set I:Chat.swift:30 | history: an unmodifiable copy, synchronous D:chat.dart:40 | different (Android, iOS) | row 26 | T:chat_test.dart:159-178 (a copy) | - | Decisions row 26: only a successful turn changes the history; an app that wants another history starts a new session. |
| Initial history checks | roles, parts, order and a per-role part table J:methods/chat-session-helpers.ts:25-148 | none | none | first role user; roles user, model, function; parts present; turns alternate; no part table D:validation.dart:238-281 | different (JS) | row 5 | T:chat_test.dart:74-158, :1057 | - | Decisions row 5: JS rejects image and code replies a session itself stored. |
| Message role | sent as user J:requests/request-helpers.ts:62 | must be user; function warns A:Chat.kt:240-249 | a missing role becomes user I:Chat.swift:148-155 | user or null, else ArgumentError D:validation.dart:283-299; D:chat.dart:91-96 | same (Android) | - | T:chat_test.dart:180-281, :249 | - | |
| Function responses mixed with other parts | invalid-content J:requests/request-helpers.ts:103-108 | - | - | ArgumentError D:validation.dart:301-308 | same (JS) | - | T:chat_test.dart:180-281 (mixed with text), :257 | - | |
| Concurrent sends | queued J:methods/chat-session-base.ts:141-149 | a second send throws InvalidStateException A:Chat.kt:251-257 | not serialized; the history has a lock I:History.swift:18 | queued; a stream takes its slot when listened to; deadlines count from the call (a stream's, from the listen) D:chat.dart:98-118,193-230 | same (JS) | - | T:chat_test.dart:283-524 | - | A stream never listened to blocks nothing. |
| History update rule | unary appends the message even with no candidate; blocked candidates are appended J:methods/chat-session-base.ts:183-200,216-217, J:methods/chat-session-base.ts:315-336 | appended only on success; any reason but STOP throws first A:Chat.kt:93,165-170 | appended on success I:Chat.swift:99-104,131-142 | message and reply appended together, only when the first candidate has parts and no blocking finish reason; MAX_TOKENS and OTHER replies are appended D:chat.dart:122-140; D:validation.dart:314-321 | different | row 4 | T:chat_test.dart:733-1056 | - | Decisions row 4: one rule for both send kinds; JS's code contradicts its own documentation. |
| Empty text part in a stored reply | the reply parts are stored as received J:methods/chat-session-base.ts:189-193 | - | - | an empty text part without a thoughtSignature is dropped from the reply before it is stored, for both send kinds; a reply of only such parts is not stored; the decoder keeps TextPart('') | different (JS) | row 33 | T:chat_test.dart:987, :1020 | - | Decisions row 33. Android and iOS were not read for this row. |
| History size bound | none | none | none | none; the README advises trimming | same | - | no test (nothing built) | - |
| Feature | JS | Android | iOS | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|
| API key | x-goog-api-key J:requests/request.ts:162 | A:common/APIController.kt:267 | I:Extensions/Internal/FirebaseInfo+Headers.swift:44 | X-Goog-Api-Key D:headers.dart:99-104,123-137 | same | - | T:browser/errors_test.dart:125 (web); T:request_shape_test.dart:156-248 (VM); T:security/hosts_test.dart:245-275 (a key with CR/LF is refused) | - | |
| Client header | gl-js/<v> fire/<v>, plus hybrid J:requests/request.ts:140-156 | gl-kotlin/<v>-ai fire/<v> A:GenerativeModel.kt:321 | gl-swift/5 fire/<v> I:Constants.swift:21-24 | gl-dart/<Dart runtime> fire/<packageVersion> in X-Goog-Api-Client D:headers.dart:40,104; D:version.dart:2 | same | - | T:browser/errors_test.dart:126 (web); T:version_test.dart:10; T:request_shape_test.dart:711-728 (VM) | - | The production verification kit (check K13) checks that the server does not treat the version differently. |
| App id header | X-Firebase-Appid when data collection is on J:requests/request.ts:163-165 | X-Firebase-AppId and X-Firebase-AppVersion when on A:common/APIController.kt:271-274 | the same two I:Extensions/Internal/FirebaseInfo+Headers.swift:76-80 | X-Firebase-AppId when isAutomaticDataCollectionEnabled is true at the request; an empty app id then throws StateError D:headers.dart:105-107,141-153 | same (JS) | - | T:browser/errors_test.dart:127, :149-156 (web); T:request_shape_test.dart:666-710 (VM) | - | Read per request, so turning data collection off takes effect at once. |
| Platform identity headers | none | X-Android-Package, X-Android-Cert A:common/APIController.kt:269-270 | x-ios-bundle-identifier I:Extensions/Internal/FirebaseInfo+Headers.swift:48 | none | won't do | alt: Identity headers for restricted keys | T:request_shape_test.dart:729-755 (the request carries no platform claims) | - | A value typed by a desktop, server or web build would be a false claim to the key restriction. |
| App Check header | X-Firebase-AppCheck J:requests/request.ts:166-176 | A:common/AppCheckHeaderProvider.kt:37-55 | I:Extensions/Internal/FirebaseInfo+Headers.swift:56-67 | X-Firebase-AppCheck through TokenSource D:headers.dart:41-47,83-87,108 | same | - | T:browser/errors_test.dart:133-146 (web); TT:tokens_test.dart:68 (shared rule); T:tokens_test.dart:342-358 | - | |
| App Check token failure | the token is sent, with a warning J:requests/request.ts:169-174 | sent, logged A:common/AppCheckHeaderProvider.kt:49-55 | sent, logged I:Extensions/Internal/FirebaseInfo+Headers.swift:61-66 | the placeholder or a held token is forwarded, warned once; the call proceeds D:headers.dart:44-46; firebase_core/_firebase_transport_dart/lib/src/tokens.dart (shared rule) | same | - | TT:tokens_test.dart:68-170 (shared rule); T:tokens_test.dart:359-434 | - | |
| No App Check provider | no header | no header, logged A:common/AppCheckHeaderProvider.kt:38 | no header | no header; one info line at the first request D:headers.dart:155-164 | same | - | TT:tokens_test.dart:95-105 (no provider, no header); T:tokens_test.dart:606-636 (the info line, logged once) | - | Enforcement is a project setting, so the client does not refuse. |
| Limited-use tokens | getLimitedUseToken() J:models/utils.ts:63-65 | limitedUseToken A:common/AppCheckHeaderProvider.kt:41-42 | I:Types/Internal/AppCheck.swift:31 | useLimitedUseAppCheckTokens; one token per request, every chat send included D:headers.dart:83-87 | same | - | TT:tokens_test.dart:68-170 (limited-use); T:tokens_test.dart:435-467 | - | |
| Failed limited-use mint | the call fails J:models/utils.ts:63-65 | placeholder sent A:common/AppCheckHeaderProvider.kt:49-55 | placeholder sent I:Types/Internal/AppCheck.swift:72-75 | a placeholder token that the provider returns together with an error is sent; a provider that throws sends no header; the call proceeds firebase_core/_firebase_transport_dart/lib/src/tokens.dart (shared rule) | different (JS) | row 17a | TT:tokens_test.dart:139-196 (shared rule); T:tokens_test.dart:468-547 | - | Decisions row 17a: the products on the shared seam (Functions, App Check, AI Logic) share one rule for token failures. |
| Provider that cannot mint limited-use tokens | - | - | throws I:Types/Internal/AppCheck.swift:31-47 | no header, warned once; the call proceeds D:headers.dart:79-86; firebase_core/_firebase_transport_dart/lib/src/tokens.dart:535-546 (shared rule) | different (iOS) | row 17b | TT:tokens_test.dart:75-86; T:tokens_test.dart:580-605 | - | Decisions row 17b. |
| Auth header | Authorization: Firebase <token> J:requests/request.ts:178-183 | A:common/AppCheckHeaderProvider.kt:58-66 | I:Extensions/Internal/FirebaseInfo+Headers.swift:70-73 | Authorization: Firebase <ID token> D:headers.dart:108 | same | - | T:browser/errors_test.dart:133-146 (web); T:tokens_test.dart:83-136 | - | |
| Auth token failure | the call fails J:requests/request.ts:178-180 | logged; sent without it A:common/AppCheckHeaderProvider.kt:66 | the call fails I:Extensions/Internal/FirebaseInfo+Headers.swift:70-71 | unauthenticated before anything is sent when the provider fails; failed-precondition for a token over 8192 characters D:errors.dart:182-196 | same (JS, iOS) | - | TT:tokens_test.dart:238-296 (Auth failure, 8192 characters); T:tokens_test.dart:137-269 | - | |
| Token wait | none | 10 s for all headers; on timeout none is sent A:common/APIController.kt:291-298, A:common/AppCheckHeaderProvider.kt:33 | none | 10 s per provider: an Auth timeout fails with unavailable, an App Check timeout sends no header; the call's deadline covers the wait D:errors.dart:186-190; D:request.dart:315-336 | different | alt: Token failures | T:timeout_test.dart:418-476; TT:tokens_test.dart:529-539; T:tokens_test.dart:270-341 | - | A slow App Check provider must not remove the user's identity (decisions, alternatives: "Token failures"). |
| After a 401 | nothing | nothing | nothing | the Auth token is invalidated when one was sent; no resend D:headers.dart:116-120 | different | alt: 401 | T:tokens_test.dart:688-832 (Auth invalidated once, no resend; App Check never) | - | The next request gets a fresh token. A resend could bill twice; the production verification kit (check K10) asks whether the proxy answers 401 after generating. |
| Where tokens may go | any URL, baseUrl included | the fixed endpoint | the fixed endpoints | only to the checked origin: https, or http to loopback D:firebase_ai.dart:121; D:headers.dart:41-47 | different | row 9 | T:firebase_ai_test.dart:269-329; TT:tokens_test.dart:299-322; T:security/hosts_test.dart:46-152, :245-337 | - | Decisions row 9. |
| Feature | JS | Android | iOS | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|
| Error type | AIError with code and customErrorData J:errors.ts:27-38 | abstract FirebaseAIException with subclasses AT:Exceptions.kt:25 | GenerateContentError I:GenerateContentError.swift:18-29 | FirebaseAIException extends FirebaseException, plugin firebase_ai, with httpStatus, serverStatus, serverMessage, reason, retryAfter, response and cause D:exception.dart:28-93 | different | row 29 | T:errors_test.dart:689-773 | - | Decisions row 29: FlutterFire's class name; one class with codes. |
| Error codes | 15 codes J:types/error.ts:65-113 | classes AT:Exceptions.kt:87-250 | four cases I:GenerateContentError.swift:18-29 | the canonical status codes plus api-not-enabled, parse-failed, response-too-large, response-error, unsupported, ai-closed; firebaseAIExceptionCodes lists them D:exception.dart:96-119 | different | alt: Error codes | T:errors_test.dart:858 | - | JS's single fetch-error hides the status (decisions, alternatives: "Error codes"). |
| Non-2xx answers | fetch-error with the status J:requests/request.ts:237-289 | by message, status not kept A:common/APIController.kt:427-482 | internal BackendError with the status I:Types/Internal/Errors/BackendError.swift:17-21 | every non-2xx is an exception; the code from the envelope's status, else from the HTTP status; httpStatus kept D:errors.dart:53-86,224-235 | different | row 1 | T:errors_test.dart:37-164 | - | Decisions row 1 (FlutterFire decodes 4xx bodies as responses). |
| API not enabled | 403 with SERVICE_DISABLED and an English link description J:requests/request.ts:250-268 | SERVICE_DISABLED with domain googleapis.com; a console message for this service A:common/APIController.kt:463-491 | detected and logged I:Errors.swift:37-44 | api-not-enabled only for firebasevertexai.googleapis.com; another service gives permission-denied with reason D:errors.dart:61-64,268-284 | different (JS) | row 8 | T:errors_test.dart:343-417 | - | Decisions row 8. |
| Codes from message text | - | "API key not valid", "quota", location, "genai config not found" A:common/APIController.kt:446-462 | - | never; reason from the ErrorInfo detail D:errors.dart:334-342 | different (Android) | row 8 | T:errors_test.dart:418-480 | - | Decisions row 8: a reworded message breaks the match. |
| Retry delay | none | none | none | retryAfter from RetryInfo or Retry-After, clamped to 0 to 24 h; never waited on D:errors.dart:286-295,345-367 | different | row 14 | T:errors_test.dart:481-605 | - | Decisions row 14. A malformed RetryInfo falls back to the Retry-After header (pinned by T:errors_test.dart:544). |
| HTML 404 on Agent Platform | fetch-error | ServerException naming the location A:common/APIController.kt:430-436 | parse error | not-found with the hint "check the location" D:errors.dart:67-71 | same (Android) | - | T:errors_test.dart:165-341 | - | |
| Timeout | AbortError "Timeout has expired." J:requests/request.ts:203-209 | RequestTimeoutException AT:Exceptions.kt:170 | wrapped in internalError I:GenerativeModel.swift:397-402 | deadline-exceeded, httpStatus null D:errors.dart:140-143; D:request.dart:138-147 | different | row 30 | T:timeout_test.dart:47-93; T:errors_test.dart:689-705 | - | Decisions row 30: one code; a null httpStatus tells a local timeout from the server's. |
| Malformed success body | parse-failed J:requests/stream-reader.ts:211-216 | SerializationException A:common/APIController.kt:494-496 | decoding error | parse-failed: not a JSON object, invalid UTF-8, nesting over 128 D:errors.dart:157-165,173-176; D:request.dart:385-396 | same (JS) | - | T:response_test.dart:972-1000; T:errors_test.dart:698-717 | - | |
| Server text in messages | status text, message and details J:requests/request.ts:280-287 | the raw message | the message | serverMessage, sanitized, at most 1 KiB; never a token, the key, a body, a prompt or a URL with a query D:errors.dart:243-254; firebase_core/_firebase_transport_dart/lib/src/http_rules.dart:217 | different | row 9 | T:errors_test.dart:637-688; T:security/leakage_test.dart:618 (server text reaches only serverMessage and reason) | - | Decisions row 9 (redaction). |
| Request URL in errors | "Error fetching from {url}" J:requests/request.ts:282,300 | - | - | never D:errors.dart (messages hold no URL) | different | row 31 | T:errors_test.dart:822-875; T:security/leakage_test.dart:496-757 | - | Decisions row 31: errors never carry the URL, so a ?key= cannot leak. |
| Feature | JS | Android | iOS | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|
| Unary deadline | cleared at the headers J:requests/request.ts:307-310 | Ktor request timeout A:common/APIController.kt:154 | idle timeoutInterval I:GenerativeAIService.swift:147 | from the call until the whole body is read, token wait included D:request.dart:166-174,255-288 | different (JS) | row 2 | T:timeout_test.dart:47-93 | - | Decisions row 2: a stalled body would otherwise hang. |
| Response caps | none | none | none | 64 MiB for generateContent, 1 MiB for countTokens; error bodies cut at 64 KiB D:request.dart:12-18; D:stream.dart:13-17 | different | row 9 | T:errors_test.dart:89 (error body cut); T:security/limits_test.dart:52-334 (success bodies, error body, SSE event and stream, gzip), :335-456 (exact SSE caps); T:sse_test.dart:74-143 | - | Decisions row 9. Whether a 4K image fits is checked by the production verification kit (check K12). |
| JSON depth | none | none | none | 128 levels, else parse-failed D:errors.dart:8; D:request.dart:388 | different | row 9 | T:security/limits_test.dart:521-614 (response bodies), :457-520 (request encoding) | - | Decisions row 9. |
| Redirects | the fetch default | the client default | the URLSession default | refused; a 3xx is unavailable D:errors.dart:217-220 | different | row 9 | T:errors_test.dart:606-635; T:security/hosts_test.dart:153-244 | - | Decisions row 9. |
| Timer clamp | - | - | - | every timeout is clamped to 2^31 - 1 ms (about 24.8 days) before a timer is made, so a very long value cannot overflow a browser timer | different | not in decisions doc | T:firebase_ai_test.dart:248 (construction); T:sse_test.dart:351-423 (a 30-day bound at a call) | - | No upstream equivalent, so not a departure and no decisions row: a browser fires a longer timer at once. |
| Retries | none | none | none | none | same | - | no test (nothing built) | - | A retried generation is billed again. |
| Feature | JS | Android | iOS | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|
| Live API | getLiveGenerativeModel J:api.ts:210 | liveModel A:FirebaseAI.kt:195 | liveModel I:FirebaseAI.swift:168 | none in 0.1.0 | missing | - | no test (not built) | - | Phase 2: 0.2.0 plans it. |
| Live credentials | key in the URL only J:requests/request.ts:115-123 | key in the URL plus token headers A:common/APIController.kt:221-223 | key and tokens in headers I:Types/Internal/Live/LiveSessionService.swift:388-408 | none in 0.1.0 | missing | P1, P2 | no test (not built) | - | Phase 2: 0.2.0 plans it. Planned: on the VM the key goes in x-goog-api-key with the full header set; on the web it goes in the URL with no tokens, because a browser cannot set upgrade headers (decisions P1 and P2). |
| Server prompt templates | getTemplateGenerativeModel J:api.ts:232 | templateGenerativeModel A:FirebaseAI.kt:162 | templateGenerativeModel I:FirebaseAI.swift:135 | none in 0.1.0 | missing | - | no test (not built) | - | Phase 2: 0.2.0 plans it. |
| Automatic function calling | functionReference, cap 10, calls in parallel J:methods/chat-session-base.ts:152-213,429 | AutoFunctionDeclaration, cap 10, throws past it A:Chat.kt:84-86 | - | none in 0.1.0 | missing | P3 | no test (not built) | - | Phase 2: 0.2.0 plans it. Planned: a function that throws fails the send, and its error text never reaches the model (decisions P3). |
| Audio conversation helper | startAudioConversation J:methods/live-session-helpers.ts:407 | startAudioConversation AT:LiveSession.kt:122 | - | none | won't do | - | no test (not built) | - | Needs platform audio; belongs in a Flutter layer. |
| On-device and hybrid inference | Chrome Prompt API J:methods/chrome-adapter.ts:61, InferenceMode J:types/enums.ts:456 | OnDeviceConfig A:OnDeviceConfig.kt:40 | - | none | won't do | - | no test (not built) | - | Neither engine exists for a pure-Dart program. |
| Foundation Models bridge | - | - | geminiLanguageModel(name:) I:Extensions/Public/FirebaseAI+GeminiLanguageModel.swift:35 | none | won't do | - | no test (not built) | - | Apple's framework. |
| Imagen | none | removed AC:CHANGELOG.md:65 | none | none | won't do | - | no test (not built) | - | Shut down upstream; images come from responseModalities. |
| Cached content | read-only cachedContentTokenCount J:types/responses.ts:140 | read-only cachedContentTokenCount AT:UsageMetadata.kt:41 | read-only cachedContentTokenCount I:GenerateContentResponse.swift:26 | read-only cachedContentTokenCount; no request API D:response.dart:653-718 | won't do | - | T:response_test.dart:690-764 (the count is read) | - | No SDK has a cached-content request API; every one only reads the token count. |
| Emulator | none | none | none | none | won't do | - | no test (not built) | - | No AI Logic emulator exists. |
| DEBUG endpoints and gcloud token | - | - | staging, direct Gemini and Agent Platform endpoints, FIRGCloudAuthAccessToken I:Types/Internal/APIConfig.swift:76-97, I:Constants.swift:46 | none | won't do | - | no test (not built) | - | A client app must not hold a Gemini key or OAuth credentials. |
| Java and Kotlin idioms | - | *Futures wrappers A:java, Kotlin builders and DSL | Swift idioms | none | won't do | - | no test (not built) | - | Language idioms, as on the other tabs. |
This document compares the public API and the behaviour of the Data Connect clients of three official SDKs with firebase_data_connect_dart (firebase_data_connect/firebase_data_connect_dart), feature by feature:
Read from docs/data_connect_parity.md on origin/main at 9122437c.
packages/data-connect of firebase-js-sdk at a086865. It is the reference for the REST protocol, which the Dart client uses on the web.firebase-dataconnect of firebase-android-sdk at 2cfdd03. With iOS it is the reference for gRPC, which the Dart client uses on the VM.f06f9e3, a repository separate from firebase-ios-sdk (cef246f, which has no Data Connect code). Its protos are the ones the Dart client copies.09d2e7a) has no Data Connect code, so this document has no C++ column.firebase_data_connect_dart 0.1.0 and the DataConnect class it exports. The Dart column states the behaviour of the package; it was checked against the code. The compat library package:firebase_data_connect_dart/flutterfire.dart mirrors the API of FlutterFire's firebase_data_connect 0.4.2 (6a80b1b), which is what firebase dataconnect:sdk:generate writes code for; rows that describe it say "compat". To read a row quickly, start with the Dart, Status and Pinned by columns.The three SDKs were read as source clones on 2026-11-28; their code was read, not run. Line numbers will drift. The reasons for each departure from upstream and the alternatives that were rejected are in data_connect_decisions.md ("DEC"): departures 1 to 15 (§1 to §15), alternatives D1 to D17 and facts still to be measured P1 to P15 (the decisions document lists no P7 and P13). How to use the package is in the guide.
Columns after Status:
dep N) or alternative (Dn) when the row differs from upstream; - when the row follows upstream or the difference has no number.T:file "name", where the name is a test or a group of that file, so a search for it finds it; a few older cites carry line numbers. no test: none exists; the note says when the row is not built.- when there is none. At this commit no row has one.The Status column compares the built Dart behaviour with the SDK named in the cell, or with all of them when it names none:
Path shorthand:
J: is JS packages/data-connect/src.A: is Android firebase-dataconnect/src/main/kotlin/com/google/firebase/dataconnect, and AP: is its src/main/proto/google/firebase/dataconnect/proto.I: is iOS Sources, and IP: is its Protos.D: is firebase_data_connect/firebase_data_connect_dart/lib/src; T: is firebase_data_connect/firebase_data_connect_dart/test.S: is firebase_core/_firebase_transport_dart/lib/src and ST: its test; G: is firebase_core/_firebase_transport_grpc_dart/lib/src and GT: its test (the shared packages the client builds on).Same: Dart has it as the official SDKs do. Different: Dart has it, in another shape or with other behaviour. Missing: a gap Dart could close. Won't do: will not be done, is not needed, makes no sense in Dart or does not apply to it; none of it is a gap. The Status column keeps the doc's wording, including the SDK named in brackets.
99 feature rows in 10 groups. No row has a pending fix.
| Status | Rows |
|---|---|
| same | 41 |
| different | 43 |
| missing | 10 |
| won't do | 5 |
| Feature | JS | Android | iOS | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|
| Get an instance | getDataConnect(app, config, settings?), cached per sorted config and project id J:api/DataConnect.ts:294-379 | getInstance(app, config, settings), cached per service, location, connector A:FirebaseDataConnect.kt:360, A:core/FirebaseDataConnectFactory.kt:55-73 | dataConnect(app:connectorConfig:settings:callerSDKType:), cached per app name, project and config I:DataConnect.swift:54-58,187-226 | DataConnect(app, connector:, ...); each call is a new instance with its own connection D:api/data_connect.dart:63-261; compat FirebaseDataConnect.instanceFor caches per app object (identity) and connector, and drops an app's entries when it is deleted D:compat/firebase_data_connect.dart:66-108,259-270 | different | - (no cache: house rule 4) | no test (no cache); compat cache: T:compat/compat_test.dart "caches by app identity and connector config" | - | No instance cache, no global state in the core. |
| A second instance with other settings | the cached instance is returned; settings apply only at creation J:api/DataConnect.ts:356-378 | IllegalArgumentException A:core/FirebaseDataConnectFactory.kt:140-157 | the new settings and caller type are ignored I:DataConnect.swift:209-226 | every constructor call takes its own settings D:api/data_connect.dart:63-207 | different | - | no test | - | Follows from having no instance cache. |
| Connector config | {location, connector, service}; only presence checked J:api/DataConnect.ts:53-57,388-405 | ConnectorConfig(connector, location, serviceId) A:ConnectorConfig.kt:34-38 | ConnectorConfig(serviceId:location:connector:) I:ConnectorConfig.swift:18-27 | ConnectorConfig({location, serviceId, connector}), const; each part must be a host label (1 to 63 of a-z, 0-9, -, no - at either end, S:hosts.dart:1,175) else ArgumentError naming the part and not the value D:api/connector_config.dart:12-49, checked at construction D:api/data_connect.dart:211; compat ConnectorConfig(location, connector, serviceId), mutable, checked in forApp D:compat/connector_config.dart:8-29, D:compat/firebase_data_connect.dart:287-293 | different | - (no number) | T:config_validation_test.dart "ConnectorConfig labels"; compat: T:compat/compat_test.dart "refuses a bad ConnectorConfig before any operation", "a refused config is not cached" | - | The parts go into a URL path and a header, so they are checked; upstream checks presence only. |
| Project id | app.options.projectId; missing: invalid-argument J:register.ts:47-52 | falls back to "<unspecified project ID>" A:core/FirebaseDataConnectFactory.kt:89 | fatalError I:DataConnect.swift:83-85,109-111 | app.options.projectId: set, printable ASCII, no /, not . or .., else ArgumentError naming the option, at construction D:api/data_connect.dart:213,640-652 | same (JS) | - | T:config_validation_test.dart "projectId" | - | A typed error, not a process abort (iOS) or a placeholder (Android); stricter than JS. |
| Read the app and config back | dc.app J:api/DataConnect.ts:113 | app, config, settings A:FirebaseDataConnect.kt:108-122 | private(set), not public I:DataConnect.swift:22-24 | DataConnect.app, DataConnect.connector D:api/data_connect.dart:287-290; compat app, connectorConfig D:compat/firebase_data_connect.dart:124-127 | same (Android) | - | no test | - | There is no settings object to read back. |
| Production host | firebasedataconnect.googleapis.com J:util/url.ts:22 | the same A:DataConnectSettings.kt:38 | the same, port 443 I:DataConnectSettings.swift:24 | firebasedataconnect.googleapis.com:443 over TLS D:api/data_connect.dart:19-20,218-220 | same | - | T:emulator_host_test.dart "without emulatorHost: production over TLS" | - | |
| Host, port and TLS settings | none; only the emulator changes the target J:api/DataConnect.ts:286-288 | DataConnectSettings(host, sslEnabled, cacheSettings) A:DataConnectSettings.kt:37-41 | DataConnectSettings(host, port, sslEnabled, cacheSettings) I:DataConnectSettings.swift:18-27 | none; production is not configurable and only DataConnect.emulator changes the target D:api/data_connect.dart:95-114 | same (JS) | - | T:emulator_host_test.dart "rule E inputs", "DataConnect.emulator" | - | Android and iOS accept any host. |
| Close | terminate(dc) removes the instance; pending tasks are not stopped (a TODO) J:api/DataConnect.ts:409-412 | close(), suspendingClose() A:FirebaseDataConnect.kt:247,266 | none | Future<void> close(): idempotent, the same future each time D:api/data_connect.dart:565-571; calls in flight fail client-closed D:retry.dart:74-76,85-103,121-123, with the transports ending in-flight calls cancelled D:transport/grpc/grpc_transport.dart:67-69,159-165,230-236, D:transport/rest/rest_transport.dart:65-67,148-161; later calls throw a StateError: query(), mutation() D:api/data_connect.dart:395,416,574-578, the sends D:api/data_connect.dart:445-447,487-489, subscribe() D:api/refs.dart:177-179; subscribe() streams obtained before get client-closed and close, also when first listened to afterwards D:api/subscriptions.dart:55-59,143-156 | same (Android) | - | T:close_test.dart "in-flight calls end client-closed, later calls throw StateError", "close() during the token wait", "streams closed", "a second close returns the same future and closes once" | - | |
| App deletion | - | closes every instance A:core/FirebaseDataConnectFactory.kt:48 | - | the instance closes on onDeleteApp D:api/data_connect.dart:283; isClosed is a pure getter that also looks at the app itself, and a call made between the deletion and the event closes the instance and finds it closed D:api/data_connect.dart:324,329-338; compat client throws a client-closed error after deletion D:compat/firebase_data_connect.dart:144-147,259-270 | same (Android) | - | T:close_test.dart "app deletion closes" | - | |
| Request deadline | none: the AbortController is never aborted J:network/rest/restTransport.ts:87,117 | none | none; keepalive only I:Internal/GrpcClient.swift:256-260 | requestTimeout, default 60 s per attempt including its token wait, any positive value (else ArgumentError) D:api/data_connect.dart:67,208-209, D:retry.dart:77-83,109-120; deadline-exceeded D:retry.dart:154-159; passed to gRPC as the call timeout D:transport/grpc/grpc_transport.dart:121 and to REST as the deadline D:transport/rest/rest_transport.dart:86 | different | dep 9, D13 | DEC §9; T:deadline_test.dart "60 s default", "zero or negative throws ArgumentError", "the token wait counts against the attempt", "a timed-out mutation is not retried"; T:grpc_errors_test.dart "the deadline gives deadline-exceeded"; T:security/leakage_test.dart "a REST call that runs out of time" | - | A REST request without a deadline has no bound. A timed-out mutation may have run; it is never retried. |
| Caller SDK type | Base, Generated and four framework values, internal J:network/transport.ts:29-43 | CallerSdkType {Base, Generated}, per ref A:FirebaseDataConnect.kt:313-322 | CallerSDKType {base, generated}, per instance I:DataConnect.swift:175-178 | CallerSdkType {base, generated}, per instance; changes only x-goog-api-client D:api/connector_config.dart:53-60, D:transport/transport.dart:84-90; compat CallerSDKType {core, generated} maps to it D:compat/connector_config.dart:32-38, D:compat/firebase_data_connect.dart:53-55 | same (iOS) | - | T:metadata_test.dart "exact headers, in order, for a", "exact headers for a"; T:browser/cors_test.dart "a call with every header of the request passes the preflight" (emulator only) | - | |
| Logging | setLogLevel J:logger.ts:22-24 | FirebaseDataConnect.logLevel, LogLevel {DEBUG, WARN, NONE} A:FirebaseDataConnect.kt:397, A:LogLevel.kt:24-33 | the Firebase logger level; payloads redacted unless -FIRPrivateLogDisabled I:Internal/Logger/DataConnectLogger.swift:18,41 | a logger constructor argument (void Function(String)); no level, no global switch; it gets warnings only (the clear-text emulator warning, the App Check placeholder warning S:tokens.dart:600-606, a failed close D:api/data_connect.dart:595-605); compat logs through dart:developer D:compat/firebase_data_connect.dart:284-285 | different | - | T:emulator_host_test.dart "non-loopback warns once (through SHARED)", "no warning while no token is sent" | - | Configuration is immutable and global state is avoided (house rule 4). What may never be logged is in the "Messages and logs" row. |
| Feature | JS | Android | iOS | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|
| Query ref | queryRef(dc, name, variables?, initialCache?) J:api/query.ts:137-148 | query(name, variables, dataDeserializer, variablesSerializer, optionsBuilder) A:FirebaseDataConnect.kt:180 | query(name:variables:resultsDataType:publisher:) I:DataConnect.swift:136-147 | query<Data, Variables>(name, decode:, variables:, encodeVariables:); an empty name, or variables that are not a Map<String, Object?> without encodeVariables, throw ArgumentError D:api/data_connect.dart:389-403, D:api/refs.dart:21-31; compat query(name, dataDeserializer, varsSerializer, vars) returns the ref already subscribed to for an equal operationId, and never throws for its variables: whatever they or their serializer throw is an error of the first operation D:compat/firebase_data_connect.dart:186-211 | same (Android) | - | compat: T:compat/compat_test.dart "the same QueryRef for an equal id while it has listeners", "computes the operation id without building the core client", "a varsSerializer that throws anything leaves query() returning a"; core: no test of the empty name | - | A decode function takes the place of the deserializer; Dart has no reflection. |
| Mutation ref | mutationRef(dc, name, variables?) J:api/Mutation.ts:62-77 | mutation(...) A:FirebaseDataConnect.kt:222 | mutation(name:variables:resultsDataType:) I:DataConnect.swift:150-161 | mutation<Data, Variables>(name, decode:, variables:, encodeVariables:) D:api/data_connect.dart:410-424; compat mutation(...) D:compat/firebase_data_connect.dart:215-228 | same (Android) | - | compat: T:compat/compat_test.dart "an ArgumentError from a mutation is other, named but without the"; core: T:operation_id_test.dart "a query and a mutation of the same name and variables share the id" | - | |
| Untyped calls | refs hold plain objects J:api/query.ts:137-148 | internal only (DataConnectUntypedData) A:DataConnectUntypedData.kt:23 | - | executeQuery(name, {variables}) and executeMutation(...) return Future<Map<String, Object?>> D:api/data_connect.dart:350-381 | same (JS) | - | T:integration/data_connect_test.dart "CreateItem returns the id of the new row", "ListItems lists what CreateItem wrote", "DeleteItem removes the row" (emulator; skipped without it) | - | |
| Execute a query | executeQuery(ref, {fetchPolicy}), default PREFER_CACHE J:api/query.ts:78-107 | execute(), execute(fetchPolicy) A:QueryRef.kt:44-48 | execute(fetchPolicy:), default .preferCache I:Queries/QueryRef.swift:44-51 | QueryRef.execute() with no fetch policy: every call asks the server D:api/refs.dart; compat execute({fetchPolicy}) keeps the parameter D:compat/refs.dart; compat execute reports every failure as a DataConnectError: core exceptions mapped, a StateError or ArgumentError as kind other with its own message D:compat/refs.dart:130-144, D:compat/errors.dart:156-185 | same | - | T:integration/data_connect_test.dart "a typed query reads the same data and says it came from the server" (emulator); compat: T:compat/compat_test.dart "execute() reports every failure as a DataConnectError (C6)", "through a ref: unauthenticated is unauthorized" | - | |
| Execute a mutation | executeMutation(ref) J:api/Mutation.ts:130-134 | MutationRef.execute() A:MutationRef.kt:39 | MutationRef.execute() I:MutationRef.swift:47 | MutationRef.execute() D:api/refs.dart:274-286; compat execute reports failures the same way D:compat/refs.dart:236-255, D:compat/errors.dart:156-185 | same | - | T:integration/data_connect_test.dart "CreateItem returns the id of the new row" (emulator); compat: T:compat/compat_test.dart "an ArgumentError from a mutation is other, named but without the" | - | |
| Query result | {data, source, fetchTime, extensions?, ref, toJSON} J:api/Reference.ts:29-46, J:api/query.ts:57-63 | QueryResult {ref, data, dataSource} A:QueryRef.kt:133-137 | OperationResult {data?, source} I:OperationResult.swift:19-21 | QueryResult {data, fetchTime, ref} with non-null data (no source: there is no cache to come from) D:api/refs.dart; compat QueryResult also holds the dataConnect D:compat/refs.dart:28-49 | same (Android) | - | T:integration/data_connect_test.dart "a typed query reads the same data and says it came from the server" (emulator) | - | Response extensions are not read in 0.1.0 (no entity cache). |
| Mutation result | {data, source: 'SERVER', fetchTime, ref} J:api/Mutation.ts:89-96 | MutationResult {ref, data} A:MutationRef.kt:80 | OperationResult(data, .server) I:OperationResult.swift:19-21 | MutationResult {data, fetchTime, ref} D:api/refs.dart:274-286,316-332; compat OperationResult D:compat/refs.dart:28-43 | same (Android) | - | T:integration/data_connect_test.dart "CreateItem returns the id of the new row" (emulator) | - | |
| Fetch time | fetchTime: Date.now().toString() for queries, toLocaleString() for mutations J:core/query/QueryManager.ts:229, J:api/Mutation.ts:95 | - | - | DateTime fetchTime in UTC on QueryResult and MutationResult: the device clock when the response arrived D:api/data_connect.dart:300,542,668, D:api/refs.dart:280,308,328; the callers of a shared request get the same time, and a subscribe() stream gets the time of the data it is given, also when it joins late D:api/subscriptions.dart:78-80,133 | same (JS) | - | T:fetch_time_test.dart "a query result carries the time its response arrived", "a mutation result carries the time its response arrived", "subscribe streams get the time of their data, also when they join late"; T:integration/data_connect_test.dart "concurrent identical queries share one response and its fetch time" (emulator) | - | JS stamps the client clock after the response, as here; the response carries no time of its own. A DateTime instead of JS's string, and one type for both kinds where JS writes a millisecond count for queries and a locale string for mutations. Android and iOS results have no time. |
| Ref identity | a new plain object per call J:api/query.ts:143-148 | a new ref per call A:FirebaseDataConnect.kt:180 | refs interned per request id (SHA-256 of name and sorted variables) I:Internal/OperationsManager.swift:51-87 | a new ref per call; operationId is the name, | and the canonical JSON of the encoded variables, keys of every map sorted, null when there are none D:api/refs.dart:51, D:value/canonical_json.dart:14-37; subscribe() groups listeners by it D:api/subscriptions.dart:55-82; compat computes it without the core client D:compat/refs.dart:83-89 | same (JS, Android) | - | T:operation_id_test.dart "key order gives one operationId", "a query and a mutation of the same name and variables share the id", "another instance gives the same id for the same operation" | - | |
| Result data is a copy | - | - | - | decode and every subscription listener receive their own deep copy of the data D:api/refs.dart:100,112, D:api/subscriptions.dart:80,132-137, D:value/json_values.dart:204-221 | different | - (no number) | T:values_test.dart "decoded maps are fresh: changing one changes no later read"; T:subscribe_test.dart "two refs, one id, two decoders" | - | no upstream counterpart; a decode that mutates its input cannot change what another listener sees. |
| Shared in-flight executes | none for REST | concurrent executes of one query join one job; a caller that arrives while a job runs waits for it and then joins or starts the next one A:querymgr/LiveQuery.kt:91-120 | none | identical queries of one instance in flight share one request, keyed by the signed-in user and operationId (variables in canonical JSON); a later caller joins until the response arrives D:api/data_connect.dart:483-512, for every fetch policy, serverOnly included; no caller joins a request started before the last authProvider.onTokenChanged event or a replaced Auth provider D:api/data_connect.dart:516-528, or before a mutation was sent D:api/data_connect.dart:448-452, and close() ends every share D:api/data_connect.dart:584; every caller gets the same response or error, with its own copies of the data, rawData and error extensions D:api/refs.dart:73-98,187-192; subscribe() streams get the response once, only while the user who sent it is still signed in, and not after the response of a later request of the id D:api/subscriptions.dart:115-139 | different (Android) | - | T:shared_executes_test.dart "one request", "separate requests", "auth", "failures", "one caller stops waiting" | - | Android makes a caller that arrives during a request wait for the next one; Dart joins the running request. Callers that already wait get what the request returns, as one unshared call would: a token change during the request, its Auth retry included, does not move them to another request. A caller that stops waiting (its own timeout) does not stop the request; it runs to its requestTimeout, or up to about twice that with the Auth retry, as Android's job outlives a cancelled caller. |
| Server-side rendering hand-off | QueryResult.toJSON(), toQueryRef, queryRef(..., initialCache) J:api/query.ts:128-131,159-167 | - | - | none | won't do | - | no test (not built) | - | It serves JS server-side rendering frameworks; Dart has no such consumer. toJSON exists only for this hand-off (J:core/query/QueryManager.ts:59). |
| Kotlin and Swift idioms | - | @ExperimentalFirebaseDataConnect, serializer modules, copy, withVariablesSerializer, withDataDeserializer A:ExperimentalFirebaseDataConnect.kt:41, A:OperationRef.kt:190-230 | ObservableQueryRef (Combine and Observation) I:Queries/ObservableQueryRef.swift:21-165 | none | won't do | - | no test (not built) | - | Language and UI idioms; decode, encodeVariables and the subscribe() stream cover their uses. |
| Feature | JS | Android | iOS | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|
| Variables | JSON.stringify of any object J:network/rest/fetch.ts:96 | a serializer into a Struct A:util/ProtoUtil.kt:497 | Encodable into a Struct through JSON I:Internal/ProtoCodec.swift:23-31 | JSON values only; a non-String key, another type, a non-finite double or nesting over 100 throws ArgumentError from execute() naming the path, never the value D:value/json_values.dart:13-102, called at D:api/refs.dart:54-65 | different | - (no number; same check on both transports) | T:values_test.dart "variables: checked before anything is sent", "variables: the gRPC encoder", "variables: the REST encoder"; T:operation_id_test.dart "variables that break the value rules throw an ArgumentError" | - | Checked before anything is sent, the same on both transports. |
| Large integers in variables | sent as a JS number | a Long becomes a Struct double | Int64 as a decimal string I:Internal/CodableHelpers.swift:27-48 | an int outside ±(2^53 − 1) throws ArgumentError; on dart2js, where a JSON number beyond that bound cannot be told from a double, it is sent as the finite double it is and only an infinite one is refused D:value/json_values.dart:41-62 | different | dep 2 | DEC §2; T:values_test.dart "2^53 + 1 throws, naming the path and not the value" (VM and dart2wasm), "2^53 - 1 and -(2^53 - 1) are sent", "1e20 decoded from JSON is a finite double and is sent" (every platform) | - | A Struct holds doubles, so the value would be rounded on the server. |
| Numbers in results | JSON numbers | Struct doubles through the deserializer A:util/ProtoUtil.kt:536 | Struct to JSON to JSONDecoder I:Internal/ProtoCodec.swift:33-42 | finite integral numbers within ±(2^53 − 1) are int, others double, on gRPC D:transport/grpc/struct_codec.dart:76-77 and REST D:transport/rest/rest_decode.dart:55-60; a number that is not finite is invalid-response D:value/json_values.dart:103-119 | different | dep 3 | DEC §3; T:values_test.dart "results: numbers, on both decoders" | - | gRPC would give 3.0 where JSON gives 3, so one app would decode differently on the VM and the web. |
| Result depth | unbounded | unbounded | unbounded | data depth over 100 is invalid-response on both decoders D:transport/grpc/struct_codec.dart:52-93, D:value/json_values.dart:120-171; the gRPC reader's recursion limit is 310 D:transport/grpc/response_parser.dart:12 | different | dep 7 | T:grpc_depth_test.dart "over gRPC" (100 passes, 101 is invalid-response); T:values_test.dart "depth 101 is invalid-response on both decoders"; REST: T:rest_shape_test.dart "data nested 100 deep is read", "data nested 101 deep" | - | Server input is bounded. |
| Optional variables | undefined is omitted | OptionalVariable {Undefined, Value} A:OptionalVariable.kt:56-107 | @OptionalVariable with isSet I:OptionalVarWrapper.swift:19-55 | compat Optional, OptionalState, ported from FlutterFire D:compat/optional.dart:8-65; the core takes maps, where an absent key is undefined | same (Android, iOS) | - | names: T:compat/exports_test.dart "the compat library exports every name of the inventory"; behaviour: T:compat/compat_test.dart "Optional" | - | |
| Timestamp | an opaque string | TimestampSerializer, RFC 3339 with up to 9 fraction digits A:serializers/TimestampSerializer.kt:39 | regex-checked I:Internal/CodableTimestamp.swift:87-90 | compat Timestamp(nanoseconds, seconds), ported from FlutterFire; fromJson checks an RFC 3339 pattern, throws Exception otherwise, floors seconds before the epoch D:compat/timestamp.dart:10-44; toJson pads the fraction on the left to nine digits D:compat/timestamp.dart:57-67; no == | different | dep 13 | DEC §13; T:compat/compat_test.dart "Timestamp departure from FlutterFire (lead ruling 2)", "Timestamp" | - | FlutterFire pads the fraction on the right and truncates negative seconds toward zero, which corrupts values below 0.1 s; data loss. Out-of-range nanoseconds are not checked. Not compared with Android or iOS in detail. |
| Date | a string | LocalDate A:LocalDate.kt:84 | LocalDate I:Scalars/LocalDate.swift:23-54 | DateTime through compat nativeFromJson<DateTime> (DateTime.parse) D:compat/optional.dart:97-125; nativeToJson writes yyyy-MM-dd by hand D:compat/optional.dart:70-88 | different | - | T:compat/compat_test.dart "nativeToJson<DateTime> against chosen dates", "nativeFromJson correctly deserializes DateTime strings" | - | The generator's mapping. Not compared with Android or iOS in detail. |
| UUID | a string | dashes removed on encode, put back on decode A:serializers/UUIDSerializer.kt:31-76 | the same I:Internal/CodableHelpers.swift:50-96 | String, sent as given (the generator maps UUID to String; no runtime code) | different | - | no test | - | |
| Int64 | as received | a Long as a Struct number | a decimal string I:Internal/CodableHelpers.swift:27-48 | BigInt through the helpers the generator writes (bigIntToJson, bigIntFromJson), a decimal string; compat nativeFromJson<int> parses a decimal string D:compat/optional.dart:111-117 | same (iOS) | - | T:compat/exports_test.dart "the fixtures confirm the generator-defined names of the inventory"; compile: T:generated_compile_test.dart "rewritten, against firebase_data_connect_dart" | - | |
| Any | any JSON | AnyValue, no null A:AnyValue.kt:90-133 | AnyValue I:Scalars/AnyValue.swift:20-48 | compat AnyValue, ported from FlutterFire; numbers pass through unchanged; an object whose toJson() throws anything is used as it is, as FlutterFire does D:compat/any_value.dart:5-49 | same | - | T:compat/compat_test.dart "AnyValue", "an object whose toJson throws is used as it is" | - | |
| Enums | a string | EnumValue {Known, Unknown} A:EnumValue.kt:23-88 | - (in generated code) | EnumValue, Known, Unknown, defined by the generator, not the runtime; neither library exports them | same (Android) | - | T:compat/exports_test.dart "every export has a show list", "exports no name the generator defines" | - | An unknown server value is kept. |
| Error path | Array<string | number> J:core/error.ts:91-108 | DataConnectPathSegment {Field, ListIndex} A:DataConnectPathSegment.kt:23-45 | DataConnectPathSegment I:DataConnectPathSegment.swift:16 | core: GraphqlError.path, a list of sealed GraphqlPathSegment (GraphqlFieldSegment, GraphqlIndexSegment); a bad entry gives [] and the error is kept D:value/json_values.dart, D:transport/grpc/struct_codec.dart; compat: sealed DataConnectPathSegment D:compat/errors.dart:96-142,236-246 | same (JS) | - | T:rest_shape_test.dart "a bad path gives []", "a good path is kept, a whole-number double as an int"; T:extensions_test.dart "gRPC path and locations read as REST reads them", "a bad gRPC path gives [] and keeps the error" | - |
| Feature | JS | Android | iOS | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|
| Fetch policies | PREFER_CACHE, CACHE_ONLY, SERVER_ONLY J:core/query/queryOptions.ts:18-22 | FetchPolicy A:QueryRef.kt:51 | QueryFetchPolicy I:Queries/QueryFetchPolicy.swift:20-33 | none in the core library until a cache exists; compat enum QueryFetchPolicy {preferCache, cacheOnly, serverOnly} D:compat/cache_types.dart | same | - | T:query_execute_test.dart "the core library exports no cache vocabulary"; compat: T:compat/compat_test.dart "preferCache and serverOnly reach the server" | - | |
preferCache without a cache | answers from an unconfigured, never-expiring map of last results J:core/query/QueryManager.ts:77-90,262-271 | the server A:core/DataConnectGrpcRPCs.kt:277 | the server I:Queries/GenericQueryRef.swift:150-157 | the server D:api/refs.dart | same (Android, iOS) | D15 | DEC D15; T:query_execute_test.dart "execute asks the server again: no result is kept"; T:integration/data_connect_test.dart "a typed query reads the same data" (emulator) | - | |
cacheOnly without a cache or on a miss | throws other J:core/query/QueryManager.ts:273-278 | throws the internal CachedDataNotFoundException A:core/DataConnectGrpcRPCs.kt:259-266 | returns data: nil from the cache I:Queries/GenericQueryRef.swift:158-160,201 | not in the core library; compat execute(fetchPolicy: cacheOnly) throws DataConnectErrorCode.cacheMiss with no network call D:compat/refs.dart | different | dep 4, D15 | DEC §4; compat: T:compat/compat_test.dart "through a ref: cacheOnly is cacheMiss with no call" | - | iOS's null data cannot be told from an empty result by typed code; Android also throws, but with no public type. |
| Cache settings | CacheSettings {cacheProvider, maxAgeSeconds}, memory only J:api/DataConnect.ts:413-433 | CacheSettings(storage, maxAge) A:CacheSettings.kt:30-38 | CacheSettings(storage, maxAge) I:Cache/CacheSettings.swift:21-46 | none in the core; the compat library has CacheSettings and CacheStorage D:compat/cache_types.dart:9-39, and a non-null cacheSettings argument logs one warning and is ignored D:compat/firebase_data_connect.dart:60-62 | missing | D6 | compat warning: T:compat/compat_test.dart "cache types warn once", "no cacheSettings, no warning", "CacheSettings defaults" | - | A later release. The emulator sends no entity metadata, so a cache cannot be tested locally. |
| Normalised entity cache | J:cache/EntityNode.ts:33 | SQLite A:sqlite/DataConnectCacheDatabaseMigrator.kt:214-218 | SQLite I:Cache/SQLiteCacheProvider.swift:33 | none | missing | D6 | no test (not built) | - | A later release. |
| Server max age | overrides the configured max age J:core/query/QueryManager.ts:131 | ignored | read from the key ttl I:Internal/ServerResponse.swift:35 | not read | missing | D6 | no test (not built) | - | Comes with the cache. |
| Cache per user | the auth uid is part of the cache id J:cache/Cache.ts:46-68 | per-user rows | per uid | none | missing | D6 | no test (not built) | - | Comes with the cache. |
| Feature | JS | Android | iOS | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|
| Error type | DataConnectError extends FirebaseError with code J:core/error.ts:42-58 | DataConnectException A:DataConnectException.kt:20 | protocol DataConnectError and four structs I:DataConnectError.swift:23-294 | DataConnectException extends FirebaseException (of firebase_app_dart), plugin data_connect, with serverMessage and cause D:errors.dart:86-105; compat DataConnectError holds the core exception as cause D:compat/errors.dart:34-49 | same (JS) | - | T:integration/data_connect_test.dart "an unknown operation is not-found" (not-found, cause null; emulator) | - | on FirebaseException with the firebase_core class does not catch them. |
| Codes | other, already-initialized, not-initialized, not-supported, invalid-argument, partial-error, unauthorized J:core/error.ts:20-40 | none; exception classes | per-struct codes I:DataConnectError.swift:87-88,135-139,282-283 | DataConnectException.errorCode, a DataConnectExceptionCode enum of the 16 gRPC statuses plus partialError, invalidResponse, codecFailed, clientClosed; code is its kebab-case text D:errors.dart; compat maps them to FlutterFire's DataConnectErrorCode D:compat/errors.dart | different | dep 5 (REST), dep 14 (GraphQL errorCode) | T:grpc_errors_test.dart "each server status code" (all 16 statuses on gRPC); REST: T:rest_errors_test.dart "order", "every row of SHARED's table"; compat mapping: T:compat/compat_test.dart "error mapping table" | - | Both transports report the server's status; JS maps every status but 401 to other. |
| Partial errors | DataConnectOperationError, partial-error, {errors, data} J:network/rest/fetch.ts:137-147, J:core/error.ts:62-89 | DataConnectOperationException with rawData, errors and typed data A:DataConnectOperationFailureResponse.kt:25-85 | DataConnectOperationError with rawJsonData, errors, data(asType:) I:DataConnectError.swift:203-271 | DataConnectOperationException<Data>, partial-error, with errors, rawData and decoded data (null when there was no data or decode threw), for queries and mutations D:errors.dart:112-135, D:api/refs.dart:75-90,100-108; compat DataConnectOperationError<T> D:compat/errors.dart:52-78,195-220 | same (Android) | - | T:integration/data_connect_test.dart "a missing variable is a partial-error with no data" (emulator); T:rest_shape_test.dart "absent data with errors is a partial error, not invalid"; the decode-throws case: T:security/leakage_test.dart "codec-failed keeps what the application's decode threw" | - | A mutation that reports errors may have written. |
| GraphQL error fields | message, path J:core/error.ts:91-108 | message, path A:DataConnectOperationFailureResponse.kt:80-85 | message, path I:DataConnectError.swift:267-271 | GraphqlError {message, path, locations, extensions} and an errorCode getter: the DataConnectExceptionCode status of extensions['code'] (a status name or a whole number 1 to 16), internal when absent, OK or neither D:errors.dart; gRPC extensions with proto3-JSON names and defaults removed D:transport/grpc/struct_codec.dart:100-156; REST keeps every key and drops the six known keys at their defaults D:transport/rest/rest_decode.dart:114-138 | different | dep 12, dep 14 | DEC §12, §14; T:extensions_test.dart "the six known keys", "absent code → internal", "a present code is its status on both decoders", "unknown key, web only"; the numeric code and workarounds differences: not pinned yet | - | No SDK surfaces locations or extensions. A key newer than the copied protos appears on the web and not on the VM. The two decoders agree on string forms only: REST keeps a non-zero numeric code and a workarounds entry as sent, gRPC writes names. |
| HTTP and transport failures | status 401 is unauthorized, every other status ≥ 400, a fetch failure and a bad body are other J:network/rest/fetch.ts:106-136 | the gRPC StatusException propagates A:core/DataConnectGrpcClient.kt:119-122 | queries wrap it in executionFailed, mutations rethrow it I:Internal/UnaryGrpcClient.swift:163 | REST: the status from error.status, then the grpc-gateway code, then the HTTP status D:transport/rest/rest_decode.dart:158-184; gRPC: the call's status RpcStatus.fromCode G:grpc_caller.dart:147, a socket or TLS failure is unavailable D:transport/grpc/grpc_transport.dart:164-166, a connection lost mid-call (an UNKNOWN that package:grpc made itself, such as a keepalive timeout) is unavailable and a server's UNKNOWN stays unknown D:transport/grpc/grpc_transport.dart:215-218, a deadline deadline-exceeded, a body or message that cannot be read invalid-response D:transport/grpc/grpc_transport.dart:158-161,195-197,212-214 | different | dep 5, dep 15 | DEC §5, §15; T:grpc_errors_test.dart "local failures keep no text", "a keepalive timeout mid-call fails unavailable", "a connection reset mid-call fails unavailable", "a reply that is not a gRPC reply (departure 15)"; REST: T:rest_errors_test.dart "order", T:security/leakage_test.dart "REST failures without a response" | - | |
| No data and no errors | returns the body as it is J:network/rest/fetch.ts:148-153 | DataConnectOperationException "no data was included" A:core/DataConnectSerialization.kt:94-95 | - | invalid-response D:api/refs.dart:91-96 | same (Android) | - | T:rest_shape_test.dart "neither data nor errors", "null data and empty errors"; gRPC: not pinned yet | - | |
| Decode failure | - (no decoder) | DataConnectOperationException with the raw data and the cause A:core/DataConnectSerialization.kt:106 | DataConnectCodecError.decodingFailed I:Internal/UnaryGrpcClient.swift:155 | codec-failed with the object decode threw as cause, the data not in the message D:api/refs.dart:112-122 | same (iOS) | - | T:security/leakage_test.dart "codec-failed keeps what the application's decode threw" | - | If the response also had GraphQL errors, the code stays partial-error and data is null D:api/refs.dart:100-108. |
| Token failure on the second attempt | - | - | - | after an Auth refusal, if the second token fetch fails the call ends with that token failure (unauthenticated, unavailable or failed-precondition, null cause), not the first refusal D:retry.dart:64-65,84-88, D:errors.dart:289-299 | different | - (no number) | T:retry_test.dart "a token failure on the second attempt is returned as it is" | - | no upstream counterpart. |
| Response count | - | - | - | zero or more than one response message to a unary call is internal D:transport/grpc/grpc_transport.dart:148-156 | different | - (no number) | T:grpc_errors_test.dart "response count" | - | |
| Malformed gRPC message | - | - | - | a message that does not parse is invalid-response, recognised by the local DATA_LOSS "Error parsing response" and not by a server's own DATA_LOSS D:transport/grpc/grpc_transport.dart:212-214, D:transport/grpc/response_parser.dart:41-56 | different | - (no number) | T:grpc_errors_test.dart "the client's own parse failure is invalid-response", "a bare server DATA_LOSS" | - | |
| Messages and logs | logs the whole error body J:network/rest/fetch.ts:131 | scrubs tokens in logs A:core/DataConnectGrpcMetadata.kt:121-134 | redacts payloads unless disabled I:Internal/Logger/DataConnectLogger.swift:18 | no ID token, App Check token, API key, URL with its query, variables or result data in any DataConnectException.message, log or toString, and no server text there beyond serverMessage; no transport exception is ever a cause. A GraphqlError is different: its message and the rawData are the server's own text and data, unsanitized (T:security/leakage_test.dart asserts that such a message can carry a token the server quoted) D:errors.dart:83-85,269-299; the gRPC channel never writes to the developer timeline G:grpc_channel.dart:100-125 | different | dep 7 | DEC §7; T:security/leakage_test.dart "server text reaches the caller only as serverMessage", "token failures"; the timeline: GT:channel_test.dart "with isTimelineLoggingEnabled, no timeline event records the token" | - | package:http's ClientException prints its URL, and the REST URL carries ?key=. |
| Server text | the body's message J:network/rest/fetch.ts:161 | the gRPC status description | - | serverMessage, control characters removed and cut to 1 KiB through sanitizeServerText; null when the server sent none, and for a failure package:grpc made itself (isFromServer) D:transport/grpc/grpc_transport.dart:208-226, D:transport/rest/rest_decode.dart:158-184 | different | dep 7 | T:grpc_errors_test.dart "server message"; REST: T:security/leakage_test.dart "an error body quoting the secrets", "GraphQL errors quoting the secrets" | - | Server text is untrusted, and so is the text of a GraphqlError: apps should not log either blindly. |
| Feature | JS | Android | iOS | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|
| Auth token | auth-internal getToken(forceRefresh); auth/token-not-initialized counts as no token J:core/FirebaseAuthProvider.ts:52-72 | InternalAuthProvider behind a token manager A:core/DataConnectAuth.kt:31 | currentUser.getIDToken(); errors swallowed, header skipped I:Internal/GrpcClient.swift:310-321 | app.authProvider through the shared TokenSource, read per attempt D:retry.dart:73-105, D:api/data_connect.dart:230-249; no signed-in user or no Auth API is no token S:tokens.dart:446-454; an Auth failure fails the call before sending D:errors.dart:289-299 | different | dep 1 | T:retry_test.dart "no ID token: no invalidate, no retry", "auth changed: sent once more with the new token", "only TokenKind.auth is invalidated, never appCheck"; T:deadline_test.dart "a hanging Auth provider ends the call at requestTimeout" | - | An Auth failure fails the call, where iOS sends it without a token. |
| Auth header | X-Firebase-Auth-Token, no Bearer J:network/rest/fetch.ts:86-88 | x-firebase-auth-token A:core/DataConnectGrpcMetadata.kt:175 | the same I:Internal/GrpcClient.swift:55 | x-firebase-auth-token, the raw ID token, on both transports AuthHeaderStyle.firebaseAuthToken D:transport/grpc/grpc_transport.dart:119, D:transport/rest/rest_transport.dart:118 | same | - | T:metadata_test.dart "gRPC metadata", "REST headers"; T:browser/cors_test.dart "a call with every header of the request passes the preflight" (web; emulator) | - | |
| App Check token | X-Firebase-AppCheck J:network/rest/fetch.ts:92-94 | x-firebase-appcheck A:core/DataConnectGrpcMetadata.kt:181 | getToken(forcingRefresh: false) I:Internal/GrpcClient.swift:323-325 | app.appCheckProvider through the TokenSource; a missing or failed token never fails the call, and a placeholder token is sent with one warning to logger S:tokens.dart:512-523,596-606 | same | - | T:metadata_test.dart "gRPC metadata", "REST headers"; T:retry_test.dart "only App Check changed: sent once more"; T:security/leakage_test.dart "token failures" (a failed token never fails the call; the placeholder warning); T:browser/cors_test.dart "a call with every header of the request passes the preflight" (web; emulator) | - | |
FirebaseServerApp App Check token | used when set J:core/AppCheckTokenProvider.ts:38-40 | - | - | none | won't do | - | no test (not built) | - | Dart has no FirebaseServerApp; a server installs a custom App Check provider. |
Retry after unauthenticated | once, with a forced Auth refresh, only if this call's token differs from the previous call's J:network/transport.ts:310-336 | forces Auth and App Check and retries once, always A:core/DataConnectGrpcClient.kt:109-138 | none | no retry when no ID token was sent; else invalidate(auth) (forced at most once per 60 s S:tokens.dart:254,436), App Check never forced, one retry only if the tokens changed D:retry.dart:52-70,148-152 | different | dep 1, D7 | DEC §1; T:retry_test.dart "auth changed: sent once more with the new token", "unchanged (sameTokensAs): no second request", "second refusal within 60 s: no retry"; ST:tokens_test.dart:537-540,1110-1116 (the 60 s rule); T:integration/data_connect_test.dart "a token without a user id is unauthenticated" (emulator) | - | Android spends an attestation per failure; JS never refreshes a token revoked on the server; iOS fails on one expired token. |
Mutations retried after unauthenticated | yes, the same rule | yes | none | yes, the same rule D:retry.dart:22-23,52-70 | same (JS, Android) | dep 1 (P14) | DEC §1; T:retry_test.dart "mutation retried once" | - | Assumes UNAUTHENTICATED comes before the operation runs; unmeasured (P14). |
| Retry of other errors | none | none | none | none D:retry.dart:60-63 | same | - | T:retry_test.dart "other results are not retried" | - | A retried mutation could run twice. |
| Routing headers | not sent | x-goog-request-params, x-firebase-sqlconnect-affinity A:core/DataConnectGrpcMetadata.kt:87-90 | the same I:Internal/GrpcClient.swift:115-116 | sent on gRPC (location=<l>&frontend=data; project id and service id joined) D:transport/grpc/grpc_transport.dart:128-139, not on REST D:transport/rest/rest_transport.dart:52-57 | same | P6 | T:metadata_test.dart "gRPC metadata" | - | |
x-goog-api-client | gl-js/ fire/<ver>, plus js/gen J:network/rest/fetch.ts:47-61 | gl-kotlin/… gl-android/… fire/<ver> grpc/, plus kotlin/gen A:core/DataConnectGrpcMetadata.kt:64-74 | gl-swift/… fire/<ver> gl-<os>/… grpc-swift/, plus swift/gen I:Internal/GrpcClient.swift:118-125 | shared apiClientHeader (gl-dart/<runtime> fire/<ver>, then grpc/<ver> on gRPC, then dart/gen for generated callers) D:transport/transport.dart:84-90, S:headers.dart:80-101, D:transport/grpc/grpc_transport.dart:133-135, D:transport/rest/rest_transport.dart:54 | different | dep 8 | DEC §8; T:metadata_test.dart "exact headers, in order, for a", "gl-dart/web on the web"; T:browser/cors_test.dart "a call with every header of the request passes the preflight" (emulator) | - | The Dart runtime version, not FlutterFire's package version. |
x-client-version | web/<ver> J:network/rest/fetch.ts:84 | android/<ver> A:core/DataConnectGrpcMetadata.kt:90 | ios/<ver> I:Internal/GrpcClient.swift:299-302 | dart/<package version> on both transports D:transport/transport.dart:93, D:transport/grpc/grpc_transport.dart:136, D:transport/rest/rest_transport.dart:55 | different | dep 8, D9, P8 | DEC §8; T:version_test.dart "packageVersion is the version of pubspec.yaml"; the header: T:metadata_test.dart "exact headers, in order, for a" | - | Acceptance by production is P8. |
| App id header | x-firebase-gmpid when set J:network/rest/fetch.ts:89-91 | when not blank A:core/DataConnectGrpcMetadata.kt:91-93 | inside the data-collection gate I:Internal/GrpcClient.swift:297 | always; a missing app id is a StateError at the first call D:api/data_connect.dart:626-631, D:transport/transport.dart:99-113, and one that cannot be a header value an ArgumentError at construction naming the option D:api/data_connect.dart:214,655-666 | different | - (no number) | T:config_validation_test.dart "appId"; T:metadata_test.dart "a missing app id or API key", "app id or API key refused by isHeaderValue at construction" | - | A call is never sent without it. |
| Data-collection gate | none | none | non-token headers only when isDataCollectionDefaultEnabled I:Internal/GrpcClient.swift:292-306 | always sent | same (JS, Android) | - | no test | - | These headers carry app, client and routing ids, not user data. |
| API key | ?key= on REST J:util/url.ts:68-75, J:network/rest/restTransport.ts:92,120 | none | none | ?key= on web REST only, required there (a missing key is a StateError at the first call) D:transport/rest/rest_transport.dart:49-51,135-143, D:api/data_connect.dart:632-636; never on gRPC D:transport/grpc/grpc_transport.dart:128-139 | same | dep 11, D12, P4 | DEC §11; T:metadata_test.dart "?key= only on REST with a key", "no API key on gRPC", "a missing API key is a StateError at the first web call"; T:config_validation_test.dart "apiKey"; T:browser/cors_test.dart "a call with every header of the request passes the preflight" (only the key parameter; emulator) | - | A header JS does not send may fail the browser preflight. |
| Where tokens go | any configured host | any configured host | any configured host | only to https, to http on this machine, or to the configured emulator; one clear-text warning to logger for an emulator that is not on this machine and has no TLS S:hosts.dart:295-310, S:tokens.dart:372-381,604-606, D:api/data_connect.dart:230-249 | different | dep 7 | DEC §7; the rule itself: ST:http_rules_test.dart, ST:tokens_test.dart; the product wiring: T:transport_platform_test.dart "tokens are asked for the destination the transport sends to", T:emulator_host_test.dart "non-loopback warns once (through SHARED)" | - | The shared token rule keeps a token from reaching a host the application did not choose. |
| Feature | JS | Android | iOS | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|
| Transport | REST and JSON J:network/rest/restTransport.ts:92,120 | gRPC unary A:core/DataConnectGrpcRPCs.kt:180,270 | gRPC unary, or the stream while subscriptions exist I:Internal/GrpcClient.swift:172-190 | gRPC unary on the VM, REST on the web, chosen at compile time D:transport/transport_factory.dart:1-7, D:transport/transport_factory_io.dart, D:transport/transport_factory_web.dart | same | D1 | T:transport_platform_test.dart "the factory builds the transport of the platform" | - | The owner asked for gRPC where possible; browsers cannot speak it. |
| Methods | :executeQuery, :executeMutation J:network/rest/restTransport.ts:92,120 | ConnectorService/ExecuteQuery, /ExecuteMutation AP:connector_service.proto:43-47 | the same IP:connector_service.proto:43-46 | both, per transport: /google.firebase.dataconnect.v1.ConnectorService/ExecuteQuery and ExecuteMutation over gRPC D:transport/grpc/grpc_transport.dart:16-29; POST /v1/projects/<p>/locations/<l>/services/<s>/connectors/<c>:executeQuery and :executeMutation over REST D:transport/rest/rest_transport.dart:122-133 | same | P10 | T:grpc_errors_test.dart "the request on the wire"; T:transport_platform_test.dart "the factory builds the transport of the platform" (REST path, web only); T:rest_shape_test.dart "request body golden" | - | |
| Proto definitions | none (TypeScript types) | AP:connector_service.proto; ExecuteMutationResponse without extensions AP:connector_service.proto:102 | a superset, with mutation extensions and the full error extensions IP:connector_service.proto:101-107 | the iOS copies (res/protos); generated messages in D:proto, no service stubs; regenerated by tool/gen_protos.sh | same (iOS) | D14, D5 | no test | - | The Android copy lacks the error-extension fields the emulator sends. |
| REST body | {name, operationName, variables} J:network/rest/fetch.ts:62-66 | - | - | the same keys, variables only when given D:transport/rest/rest_transport.dart:58-64 | same (JS) | - | T:rest_shape_test.dart "request body golden", "every malformed response of 5.5 rule 5 is invalid-response" | - | An absent field is the same in proto3 JSON. |
| gRPC channel | - | keepalive 30 s; plaintext for the emulator A:core/DataConnectGrpcRPCs.kt:756-764 | keepalive 30 s, 10 s timeout I:Internal/GrpcClient.swift:253-260 | one HTTP/2 connection per instance; connect 15 s (the TLS handshake and the HTTP/2 settings acknowledgement count against it), keepalive ping 30 s while calls are active, 20 s ping timeout, 256 KiB window G:grpc_channel.dart:29-40,60-98, G:keep_alive_transport.dart:142-175, built at D:transport/grpc/grpc_transport.dart:37-49 | different | D4 | GT:channel_test.dart "has the documented defaults", "keepalive", "connect timeout" (the TLS and the HTTP/2 handshake); GT:keep_alive_connect_test.dart | - | The defaults of the shared gRPC channel, which follow Firestore's. |
| Response size | response.json() uncapped J:network/rest/fetch.ts:118 | the gRPC default | the gRPC default | 16 MiB for a success on both transports D:transport/transport.dart:23, 16 KiB for a REST error body D:transport/rest/rest_transport.dart:14,84-85; on gRPC the announced length is checked before allocation by the channel D:transport/grpc/grpc_transport.dart:47,158-161 and the parser D:transport/grpc/response_parser.dart:23-26; an over-limit message is invalid-response, and cancelled after close | different | dep 7, D17 | DEC §7, D17; T:grpc_depth_test.dart "a message announcing 16 MiB + 1", "more than 16 MiB is refused by the parser as a fallback"; GT:inbound_limit_test.dart; REST: T:security/limits_test.dart "2xx bodies: 16 MiB", "non-2xx bodies: 16 KiB" | - | grpc-dart would otherwise allocate the announced length, up to 4 GiB. Read in the shared source and not measured against a hostile peer. |
| Redirects | followed (fetch default) J:network/rest/fetch.ts:97-101 | - | - | refused: the call fails unavailable D:transport/rest/rest_transport.dart:81-88, S:http_rules.dart:473,575, S:rpc_status.dart:230 | different | dep 7 | T:security/limits_test.dart "redirects refused on REST"; T:rest_shape_test.dart "redirects are not followed"; ST:http_rules_test.dart:139-175,404 (the shared rule) | - | A redirect could carry tokens to another host. |
| Cloud Workstations | credentials: 'include' and a ping J:network/rest/fetch.ts:102-104, J:api/DataConnect.ts:279-281 | - | - | none | won't do | - | no test (not built) | - | A non-goal: BrowserClient.withCredentials is not wired. |
| Developer timeline | - | - | - | the gRPC channel is an _UntracedChannel: calls never create a TimelineTask, so isTimelineLoggingEnabled cannot put tokens, variables or results on the timeline G:grpc_channel.dart:85-125 | different | - (no number) | GT:channel_test.dart "with isTimelineLoggingEnabled, no timeline event records the token" | - | Pinned to grpc 5.2.0's createCall; grpc 5.1.0 is identical. |
| Web imports | - | - | - | the web build never reaches dart:io, package:grpc/ or package:protobuf/ (conditional imports pick the REST transport and the stub environment) D:transport/transport_factory.dart:1-7, D:environment_stub.dart:1-13; CI runs the checker with the gRPC transport, protos and gRPC sources forbidden .github/workflows/ci.yml | different | D1, D3 | T:transport_platform_test.dart "the factory builds the transport of the platform"; the checker itself: T:tool/check_web_imports_test.dart "--forbid", "conditional imports" (a tool test, not a check of this package) | - |
| Feature | JS | Android | iOS | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|
| Connect | connectDataConnectEmulator(dc, host, port?, sslEnabled) J:api/DataConnect.ts:273-284 | useEmulator(host, port) A:FirebaseDataConnect.kt:145 | useEmulator(host:port:) I:DataConnect.swift:74-103 | the DataConnect.emulator(app, connector:, host: 'localhost', port:, secure: false) constructor, validated by EmulatorHost when the instance is made: port 1 to 65535, no scheme, a production Google host refused, the error never repeats the input D:api/data_connect.dart:95-114,188-193, S:hosts.dart:183-250; compat useDataConnectEmulator(host, port, {automaticHostMapping, isSecure}) D:compat/firebase_data_connect.dart:238-257 | different | dep 6 (compat) | T:grpc_errors_test.dart "emulatorSecure"; T:emulator_host_test.dart "rule E inputs", "DataConnect.emulator"; compat: T:compat/compat_test.dart "useDataConnectEmulator: Android host mapping", T:compat/compat_emulator_test.dart "a bracketed IPv6 host" | - | Immutable configuration in the core. |
| Default host and port | none | 10.0.2.2:9399 A:FirebaseDataConnect.kt:145 | 127.0.0.1:9399 I:DataConnect.swift:45-47 | localhost for the host, none for the port D:api/data_connect.dart:98-99; the compat library maps localhost and 127.0.0.1 to 10.0.2.2 on Android unless automaticHostMapping is false D:compat/firebase_data_connect.dart:244-248 | different | - | T:compat/compat_test.dart "on Android, localhost and 127.0.0.1 become 10.0.2.2", "elsewhere, localhost and 127.0.0.1 are kept" | - | A non-goal of the core. |
| Switch after first use | refused unless the options are equal J:api/DataConnect.ts:232-245 | IllegalStateException A:core/FirebaseDataConnectImpl.kt:395-404 | allowed; rebuilds the client, old refs keep it I:DataConnect.swift:74-103 | core: constructor only; compat: allowed, the core client is closed and replaced, earlier refs use the new client and old subscribe() streams end with an error whose cause has the code client-closed D:compat/firebase_data_connect.dart:144-179,248-256,272-282 | different | dep 6, dep 10 | DEC §6, §10; T:compat/compat_emulator_test.dart "departure 6.1-6: refs made before the switch use the emulator", "departure 6.1-10: subscribe streams from before the switch" | - | In-flight failure on a switch is documented in the dartdoc only. |
| TLS to the emulator | sslEnabled J:util/url.ts:33 | always plaintext A:core/FirebaseDataConnectImpl.kt:258 | always plaintext I:DataConnect.swift:77 | DataConnect.emulator(..., secure: true) (a secure flag cannot exist without an address); plaintext h2c otherwise D:api/data_connect.dart:95-114,220 | same (JS) | - | T:grpc_errors_test.dart "builds a secure GrpcTarget", "without it the emulator target is plaintext" | - | |
| Environment variable | FIREBASE_DATA_CONNECT_EMULATOR_HOST (http(s)://host:port), read on Node at construction J:api/DataConnect.ts:68-69,117-124 | - | - | DataConnect.emulatorFromEnvironment(app, connector:, secure:, ...) (host:port; null on the web or when unset); no constructor reads it D:api/data_connect.dart:128-153, D:environment_io.dart:12, D:environment_stub.dart:7 | different | - (no number) | T:emulator_host_test.dart "environment" | - | Explicit configuration: a program that wants the variable passes it on. |
| Emulator service | - | GetEmulatorInfo and StreamEmulatorIssues, logged only A:core/FirebaseDataConnectImpl.kt:416,449 | - | none | won't do | - | no test (not built) | - | A non-goal: Android only logs it. |
| Feature | JS | Android | iOS | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|
subscribe API | subscribe(ref, observer) J:core/query/subscribe.ts:66-124 | QueryRef.subscribe(), a QuerySubscription with a flow A:QueryRef.kt:92, A:QuerySubscription.kt:70-81 | subscribe(), an AnyPublisher I:Queries/QueryRef.swift:38-41 | core: Stream<QueryResult> subscribe(), a broadcast stream; the first listener of an operationId runs one server fetch D:api/refs.dart:173-174, D:api/subscriptions.dart:42-92; compat: a broadcast Stream.multi with one core subscription per listener, and it logs one warning per client D:compat/refs.dart:157-201, D:compat/firebase_data_connect.dart:20-21,313-322 | different | D2 | DEC D2; T:subscribe_test.dart "5.10 item 1: the first listener", "5.10 item 4: the end"; compat: T:compat/compat_test.dart "subscribe() is a broadcast stream, as FlutterFire's (C4)", "subscribe() warns once" | - | In 0.1.0 the stream shows only results this instance fetches, not changes made elsewhere; server push is a later release. |
| Subscription stream errors | - | - | - | variables that break the value rules, or an encodeVariables that throws, end that stream with the error D:api/subscriptions.dart:61-68; a fetch error goes to the first listener only D:api/subscriptions.dart:86-92; a decode that throws is a codec-failed error on that listener's stream only D:api/subscriptions.dart:183-192 | different | - (no number) | T:subscribe_test.dart "5.10 item 1: the first listener", "two refs, one id, two decoders"; an encodeVariables that throws: no core test; compat: T:compat/compat_test.dart "a StateError on subscribe reaches the listener as other" | - | |
| Local results reach listeners | results go to the query's subscribers J:core/query/QueryManager.ts:153-213 | executes of one query share its updates A:querymgr/LiveQuery.kt:91-120 | - | every successful execute() of a query with that operationId reaches every listener, decoded by each listener's own ref, once per shared request, and only while the user who sent it is still signed in; a response to a request that started before the one last delivered for the id is dropped, so a slow older request cannot replace newer data; a mutation does not D:api/data_connect.dart:530-554, D:api/subscriptions.dart:115-139 | same (JS, Android) | - | T:subscribe_test.dart "5.10 item 2: later results", "request order"; T:shared_executes_test.dart "a subscribe stream gets one result per shared request", "a subscribe stream of the next user gets no data of a request sent before the switch"; the mutation case: no test | - | |
| Replay to a new listener | the cached result, stale allowed J:core/query/QueryManager.ts:191 | the latest update A:querymgr/LiveQuery.kt:91-120 | the cached result first I:Queries/GenericQueryRef.swift:58 | the last raw data map, stored with the uid of the user who sent its request, unless the auth uid changed since; a response to an older request than the stored one is not stored; dropped when the last listener of the id cancels D:api/subscriptions.dart:77-81,94-104,115-139 | different | - (FlutterFire's rule) | T:subscribe_test.dart "5.10 item 3: a listener joining while others listen", "uid change blocks replay", "a sign-out between store and join blocks replay", "a listener joining after the dropped response gets the newer data" | - | There is no cache in 0.1.0. |
| Server push | WebSocket Connect J:network/stream/websocket.ts:51 | gRPC bidi Connect A:core/DataConnectGrpcRPCs.kt:480-485 | gRPC bidi Connect I:Internal/StreamingGrpcClient.swift:385 | none | missing | D2, P1, P2 | no test (not built) | - | A later release: the emulator never pushes and the production path is not measured. |
| Stream endpoint | /ws/google.firebase.dataconnect.v1.ConnectorStreamService.Connect/{project}/locations/{l}/services/{s} J:util/url.ts:47-66 | ConnectorStreamService/Connect AP:connector_stream_service.proto:31 | the same IP:connector_stream_service.proto:43 | none | missing | D2, P1 | no test (not built) | - | A later release; the production WebSocket path form is P1. |
| Execute over the stream | while subscriptions exist, with a REST fallback J:network/manager.ts:111-151 | never | while subscriptions exist I:Internal/GrpcClient.swift:173-184 | always unary D:transport/grpc/grpc_transport.dart:60-101 | same (Android) | - | no test | - | Unary calls stay unary when realtime arrives. |
| Idle close | after 15 s J:network/stream/streamTransport.ts:53 | after 15 s A:core/DataConnectBidiConnectStream.kt:239 | at once | none | missing | D2 | no test (not built) | - | Comes with realtime. |
| Reconnect backoff | 1 s × 1.5 up to 60 s, early retry on online J:network/stream/streamTransport.ts:60,139 | 1 s × 1.5 up to 60 s A:core/RetryBackoffCalculator.kt:59-63 | 1 s × 1.3 up to 30 s I:Internal/StreamingGrpcClient.swift:268-294 | none | missing | D2 | no test (not built) | - | Comes with realtime; the JS and Android curve is the likely choice. |
| Auth change on a stream | the stream closes with unauthorized J:network/stream/streamTransport.ts:1041 | AuthUserChangedException A:core/DataConnectBidiConnectStream.kt:776 | pending executes fail I:Internal/StreamingGrpcClient.swift:714 | none (the replay rule compares the uid, see "Replay to a new listener") | missing | D2 | no test (not built) | - | Comes with realtime; the plan is to close and reopen the stream on a uid change. |
| Feature | JS | Android | iOS | Dart | Status | Departure | Pinned by | Pending fix | Notes |
|---|---|---|---|---|---|---|---|---|---|
| Runtime contract for generated code | validateArgs, validateArgsWithOptions J:util/validateArgs.ts:47,89 | GeneratedConnector, GeneratedOperation A:generated/GeneratedConnector.kt:37, A:generated/GeneratedOperation.kt:40 | OperationRef, OperationVariable I:BaseOperationRef.swift:19,29 | the compat library package:firebase_data_connect_dart/flutterfire.dart, with FlutterFire 0.4.2's symbol set: FirebaseDataConnect, ConnectorConfig, CallerSDKType, QueryRef, MutationRef, QueryResult, OperationResult, QueryFetchPolicy, DataSource, CacheSettings, CacheStorage, the DataConnectError family, Optional, OptionalState, Timestamp, AnyValue, the serializer typedefs and helpers, nativeToJson, nativeFromJson lib/flutterfire.dart:13-54 | different | D10 | DEC D10; T:compat/exports_test.dart "every export has a show list", "exports no name the generator defines", "a show list that dart format wraps onto the next line is parsed"; T:generated_compile_test.dart "as generated, against fixtures/stub_runtime", "rewritten, against firebase_data_connect_dart" | - | Dart generated code is FlutterFire's: the generator hard-codes its import. The compat library and the core library both define ConnectorConfig, QueryRef and other names, so an application imports one of them, or the other with a prefix. |
| Rewrite command | - | - | - | dart run firebase_data_connect_dart:rewrite_generated [--check] <directory> swaps the FlutterFire import for the compat library and foundation.dart for package:meta/meta.dart; idempotent, refuses other package:flutter/ imports, writes through temporary files (a failure while writing them changes nothing; a rename that fails midway is not rolled back), --check writes nothing and exits 1 when a file would change firebase_data_connect/firebase_data_connect_dart/bin/rewrite_generated.dart:1-30 | different | - (no number) | T:rewrite_generated_test.dart "rewrite" | - | No upstream counterpart: generated code on the VM needs it after every generate. The rename-phase failure is untested and not rolled back. |
| Override package | - | - | - | none in this tree (a git dependency_overrides package named firebase_data_connect that maps FlutterFire's FirebaseApp) | missing | D11 | no test (not built) | - | A separate later pull request, so that generated code compiles unchanged in Flutter apps. |