I have multiple listeners using addSnapshotListener:
db.collection("messages")
.addSnapshotListener { querySnapshot, error in
// ...
}
I understand that the first query snapshot contains all the matching documents. And they are retrieved from the server.
Question: What happens when I call .addSnapshotListener again? Does it still make a call to the server for the initial batch, thus incurring the cost of multiple document reads again?
Logically, I don't see a need to call the server, since it actively monitors for changes so the cached documents shouldn't be stale, but it's unclear what Firebase SDK actually does while the costs could be significant if I call this many times (say, in SwiftUI on each navigation).