capacitor-firebase icon indicating copy to clipboard operation
capacitor-firebase copied to clipboard

bug: Invalid serialization of `DocumentReference` Java objects

Open gre-v-el opened this issue 1 year ago • 1 comments

Plugin(s)

  • [ ] Analytics
  • [ ] App
  • [ ] App Check
  • [ ] Authentication
  • [ ] Crashlytics
  • [x] Cloud Firestore
  • [ ] Cloud Functions
  • [ ] Cloud Messaging
  • [ ] Cloud Storage
  • [ ] Performance
  • [ ] Remote Config

Version

7.0.0

Platform(s)

  • [x] Android
  • [ ] iOS
  • [ ] Web

Current behavior

Invalid serialization of DocumentReferences: when retrieving a document which contains references to other documents, the returned JSON object contains strings like "com.google.firebase.firestore.DocumentReference@d2335ee5" instead of valid reference paths.

Expected behavior

The JSON serialization should produce a valid firestore reference.

Reproduction

Steps to reproduce

let someDocument = await FirebaseFirestore.getDocument({reference: `some/reference`});
let someData = someDocument.snapshot.data;
console.log(someData.someReference);
// what is logged: "com.google.firebase.firestore.DocumentReference@d2335ee5"
// what should be logged: `some/anotherreference`

Other information

No response

Capacitor doctor

💊   Capacitor Doctor  💊 

Latest Dependencies:

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

Installed Dependencies:

  @capacitor/ios: not installed
  @capacitor/cli: 7.0.1
  @capacitor/core: 7.0.1
  @capacitor/android: 7.0.1

[success] Android looking great! 👌

Before submitting

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

gre-v-el avatar Feb 07 '25 08:02 gre-v-el

Thank you for reporting that. Would you be willing to create a PR?

robingenz avatar Feb 07 '25 08:02 robingenz