I have problems with Firestore, when I add a document the changes are not updated in the console, and in the log it says hasPendingWrites = true isFromCache = true
These documents do not appear on the console ????
B4X:
Sub Activity_Create(FirstTime As Boolean)
fs.Initialize("Firestore",True)
'Public datos As CollectionReference
datos = fs.collection("datos", "datos")
datos.setEventname("leerdatos","leerdatos")
datos.addSnapshotListener
'Public todos As DocumentReference
todos = fs.document("datos/todos")
todos.setEventname("leertodos","leertodos")
todos.addSnapshotListener
End Sub
Sub leerdatos_Snapshot(success As Boolean, snap As QuerySnapshot, info As String)
Log($"leerdatos_Snapshot(${snap.Size},${snap})"$)
Dim meta As SnapshotMetadata = snap.Metadata
Log("hasPendingWrites= - " & meta.hasPendingWrites &" isFromCache = - " & meta.isFromCache)
End Sub
Sub BotonEscribir_Click
If fs.isInitialized Then
Dim fecha As Long = DateTime.Now
Dim m As Map = CreateMap("hora": DateTime.GetHour(fecha),"minuto":DateTime.GetMinute(fecha),"segundo":DateTime.GetSecond(fecha))
todos.update(m,"")
End If
End Sub
Log
leerdatos_Snapshot(4,com.google.firebase.firestore.QuerySnapshot@4d027fd1)
hasPendingWrites= - true isFromCache = - true
DocumentNo: #0: ZIQzCB1RpquKJTl0FNpb
(MyMap) {hora=12, segundo=53, minuto=48}
DocumentNo: #1: todos
(MyMap) {hora=13, segundo=0, minuto=15}
DocumentNo: #2: uGe0APYBwyzgre1hcNFd
(MyMap) {hora=12, segundo=56, minuto=49}
DocumentNo: #3: vEFaoha6y742ReSCvje2
(MyMap) {hora=12, segundo=34, minuto=49}
leertodos_onevent(DocumentSnapshot{key=datos/todos, metadata=SnapshotMetadata{hasPendingWrites=true, isFromCache=true}, doc=Document{key=datos/todos, data=ArraySortedMap{(hora=>13), (minuto=>15), (segundo=>0)};, version=SnapshotVersion(seconds=0, nanos=0), documentState=LOCAL_MUTATIONS}})
(MyMap) {hora=13, segundo=0, minuto=15}
These documents do not appear on the console ????