capawesome-team / capacitor-firebase

⚑️ Firebase plugins for Capacitor. Supports Android, iOS and the Web.

Home Page:https://capawesome.io/plugins/firebase/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bug(firestore): `NaN` cannot be set

robingenz opened this issue Β· comments

Plugin(s)

  • Analytics
  • App
  • App Check
  • Authentication
  • Crashlytics
  • Cloud Firestore
  • Cloud Messaging
  • Cloud Storage
  • Performance
  • Remote Config

Version

5.4.0

Platform(s)

  • Android
  • iOS
  • Web

Current behavior

The following works on iOS, but not on Android:

await FirebaseFirestore.setDocument({
  reference: `samples/1`,
  data: {
    nan: NaN,
  },
});

iOS:
grafik

Android:
grafik

Expected behavior

It should be possible to set an value to NaN on Android.

Reproduction

Steps to reproduce

await FirebaseFirestore.setDocument({
  reference: `samples/1`,
  data: {
    nan: NaN,
  },
});

Other information

The reason for this behavior is that Capacitor converts NaN to null on Android.

Capacitor doctor

πŸ’Š   Capacitor Doctor  πŸ’Š 

Latest Dependencies:

  @capacitor/cli: 5.7.0
  @capacitor/core: 5.7.0
  @capacitor/android: 5.7.0
  @capacitor/ios: 5.7.0

Installed Dependencies:

  @capacitor/cli: 5.4.2
  @capacitor/android: 5.4.2
  @capacitor/core: 5.4.2
  @capacitor/ios: 5.4.2

[success] iOS looking great! πŸ‘Œ
[success] Android looking great! πŸ‘Œ

Before submitting

  • I have read and followed the bug report guidelines.
  • I have attached links to possibly related issues and discussions.
  • I understand that incomplete issues (e.g. without reproduction) are closed.