firebase / firebase/firebase-ios-sdk
Query returns empty snapshot after app update
- Dominant language
- C++
- Stars
- 6.7k
- Forks
- 1.8k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 75
Description
### Description
I have a very old app that was built using React native and it was using Firestore 1.2.1.
I completely rebuilt the app natively and using Firestore 11.3.0.
If I fresh install the app everything works as expected; on the other hand, if I update the app (either through TestFlight or from Xcode) I get a weird issue:
for this particular query, I get an empty Snapshot, no error:
```swift
let time = Date.now.timeIntervalSince1970 * 1000
print(time)
return try await db
.collection("events")
.whereField("end", isGreaterThan: time)
.whereField("status", isEqualTo: "PUBLISHED")
.order(by: "end")
.getDocuments()
.documents.map { try $0.data(as: Event.self) }
```
the issue seems with the `whereField("end", isGreaterThan: time)`: if I remove it, I get results (of course without filtering them).
If I run the query in web firebase console, it works too.
Also, enabling `-FIRDebugEnabled` actually shows the expected documents
### Reproducing the issue
_No response_
### Firebase SDK Version
11.3.0
### Xcode Version
16.0
### Installation Method
Swift Package Manager
### Firebase Product(s)
Firestore
### Targeted Platforms
iOS
### Relevant Log Output
```shell
11.3.0 - [FirebaseFirestore][I-FST000001] WatchStream (68dc776d01) watch: : {
database: "projects/area-dance/databases/(default)"
add_target {
query {
parent: "projects/area-dance/databases/(default)/documents"
structured_query {
from {
collection_id: "events"
}
where {
composite_filter {
op: AND
filters {
field_filter {
field {
field_path: "end"
}
op: GREATER_THAN
value {
integer_value: 1729503636777
}
}
}
filters {
field_filter {
field {
field_path: "status"
}
op: EQUAL
value {
string_value: "PUBLISHED"
}
}
}
}
}
order_by {
field {
field_path: "end"
}
direction: ASCENDING
}
order_by {
field {
field_path: "__name__"
}
direction: ASCENDING
}
limit {
value: 10000
}
}
}
target_id: 186
}
}
11.3.0 - [FirebaseFirestore][I-FST000001] WatchStream (b8a68f0601) headers (allowlisted): date: Mon, 21 Oct 2024 09:38:56 GMT
11.3.0 - [FirebaseFirestore][I-FST000001] WatchStream (b8a68f0601) response: : {
target_change {
target_change_type: ADD
target_ids: 186
}
}
11.3.0 - [FirebaseFirestore][I-FST000001] WatchStream (b8a68f0601) headers (allowlisted): date: Mon, 21 Oct 2024 09:38:56 GMT
11.3.0 - [FirebaseFirestore][I-FST000001] WatchStream (b8a68f0601) response: : {
document_change {
document {
name: "projects/area-dance/databases/(default)/documents/events/OkQD8qZqn9kHLs1CqGxD"
fields {
key: "externalLinkName"
value {
string_value: "Instagram Link"
}
}
fields {
key: "priority"
value {
integer_value: 2
}
}
fields {
key: "externalLink"
value {
string_value: "https://www.instagram.com/milantapfestival2024?igsh=MWRoY29jbHgweDhoaQ%3D%3D&utm_source=qr"
}
}
fields {
key: "status"
value {
string_value: "PUBLISHED"
}
}
fields {
key: "end"
value {
integer_value: 1733007300000
}
}
fields {
key: "disciplines"
value {
array_value {
values {
string_value: "m5jap7uJjMw76gsCGwXr"
}
}
}
}
fields {
key: "color"
value {
map_value {
fields {
key: "secondary"
value {
string_value: "#87cefa"
}
}
fields {
key: "primary"
value {
string_value: "#87cefa"
}
}
}
}
}
fields {
key: "description"
value {
string_value: "\n22,23,24 novembre 2024\n#milantapfestival\nDai creatori del Turin Tap Festival, ecco un appuntamento unico per tutti gli appassionati di Tip Tap. Un week-end a Milano all\342\200\231insegna del ritmo e dello studio con alcuni dei piu\342\200\231 interessanti insegnanti di tap del panorama europeo.\nArea Dance, lo spazio danza di riferimento per i danzatori professionisti a Milano, ospiter\303\240 30 classi di stili diversi.\nA breve sveleremo gli insegnanti ospiti.\nCome and Play with your tap shoes #tapclass #tapdancers\n\nSegui la nostra pagina Instagram:\n\nhttps://www.instagram.com/milantapfestival2024?igsh=MWRoY29jbHgweDhoaQ%3D%3D&utm_source=qr"
}
}
fields {
key: "cover"
value {
string_value: "https://firebasestorage.googleapis.com/v0/b/area-dance.appspot.com/o/pCI9rqLuoZclqg2h5VMQkcZ3ZYD3%2Flocandina_MilanTapFestival_2024_APP.jpg?alt=media&token=28f3e314-7c6e-4406-831d-767296b05173"
}
}
fields {
key: "price"
value {
null_value: NULL_VALUE
}
}
fields {
key: "lessons"
value {
array_value {
values {
string_value: "LCAGyEgPGOVNcp8hR1hz"
}
values {
string_value: "TYP4WXEXX6YFxMlIRRMm"
}
values {
string_value: "E3g2rBx9YD5LIopG9NcV"
}
values {
string_value: "gCfc37h4uwg9GeikWBeg"
}
values {
string_value: "5BZcKXmZKs6A5hyVOuVb"
}
values {
string_value: "7Pgjo3njWo38Sut8WDGT"
}
values {
string_value: "AD9FB0nB5sQJjZr9PDWl"
}
values {
string_value: "cK4hiMnWfKu5Amyp1ZON"
}
values {
string_value: "Tm22gnhW5ZwTRiJ6HnTZ"
}
values {
string_value: "VvL1s5ZhfFnqBf8m0yrj"
}
values {
string_value: "BqJK1OFiELcR74YXaDag"
}
values {
string_value: "Ogr47h31pwxxXx2QUOgo"
}
values {
string_value: "krzVILukEYmUMn3k7YSY"
}
values {
string_value: "uxd84kzgPspgON6RoFRd"
}
values {
string_value: "ZolvdaQDhrl1M37TYah1"
}
values {
string_value: "boEaW72TEj63RmtJxuQz"
}
values {
string_value: "b3ootRs8lA4XInxkNcdb"
}
values {
string_value: "gWs88xcClkql2ZsUGxL6"
}
values {
string_value: "UsyqhTUHkvvbA419yYWe"
}
values {
string_value: "nuaTI0GxASel7eovafVQ"
}
values {
string_value: "k6d3s5P6ewkMR7jiiWby"
}
values {
string_value: "1OWN52RbBHWiDwgTquT6"
}
values {
string_value: "KMp1jedtQOkJt8MS5Xph"
}
values {
string_value: "0H4YtOtMYFBhM40j9Lpz"
}
values {
string_value: "lIzYsCehRS1AH2RJcAgY"
}
values {
string_value: "7sXsHlP6DRKzI2ImLhSA"
}
values {
string_value: "tEUPsfjsWQ3P5vKO9bkh"
}
values {
string_value: "9w6GbFMBIQQ6TOt3WPNf"
}
values {
string_value: "g0GnXDHhTgr6z6IRiJoO"
}
values {
string_value: "fxoYxtDQmCOAh8ZIXKj2"
}
values {
string_value: "lUFaO0SsuMsOMdMS5NzJ"
}
values {
string_value: "1EdpXf63ymEuOjkldAQR"
}
values {
string_value: "TTjsrFh69oPioYxOPvPJ"
}
values {
string_value: "F2wEpamXS2cT2lKY0F5k"
}
}
}
}
fields {
key: "title"
value {
string_value: "MILAN TAP FESTIVAL"
}
}
fields {
key: "months"
value {
array_value {
values {
string_value: "2024-07"
}
values {
string_value: "2024-08"
}
values {
string_value: "2024-09"
}
values {
string_value: "2024-10"
}
values {
string_value: "2024-11"
}
}
}
}
fields {
key: "isDateVisible"
value {
boolean_value: false
}
}
fields {
key: "start"
value {
integer_value: 1721772000000
}
}
fields {
key: "endTime"
value {
string_value: "23:55"
}
}
fields {
key: "packages"
value {
array_value {
values {
string_value: "BxIm5ViSHImvHtyl3ziy"
}
values {
string_value: "7ZgyZPAAUjOWRIm16iKz"
}
values {
string_value: "zCCNuJ2duWyhfex6OUmq"
}
values {
string_value: "djbH4WF7OeY4Ltf4XH33"
}
}
}
}
fields {
key: "id"
value {
string_value: "OkQD8qZqn9kHLs1CqGxD"
}
}
fields {
key: "teachers"
value {
array_value {
values {
string_value: "04GMuUPoTLP60zXAkuRHtw98mls1"
}
values {
string_value: "ThTfs3YH4IVBF8oLzdAt5cffXW53"
}
values {
string_value: "f5fyVCBDS1YsGeAXaHSCrM6RIOt1"
}
values {
string_value: "gWCcTkrokXT2OnIlEgak8pdv7L82"
}
values {
string_value: "rrM1YvC8txbCwXEOEWQi8wJ5V112"
}
values {
string_value: "Wci15a2yv7SM4g2GDNuZhsYBND92"
}
}
}
}
fields {
key: "startTime"
value {
string_value: "00:00"
}
}
create_time {
seconds: 1721838328
nanos: 747689000
}
update_time {
seconds: 1728339845
nanos: 542811000
}
}
target_ids: 186
}
}
11.3.0 - [FirebaseFirestore][I-FST000001] WatchStream (b8a68f0601) headers (allowlisted): date: Mon, 21 Oct 2024 09:38:56 GMT
11.3.0 - [FirebaseFirestore][I-FST000001] WatchStream (b8a68f0601) response: : {
document_change {
document {
name: "projects/area-dance/databases/(default)/documents/events/KK6awuzr6WyuTzLuFFNA"
fields {
key: "isDateVisible"
value {
boolean_value: false
}
}
fields {
key: "description"
value {
string_value: "\360\237\207\256\360\237\207\271 Diploma di Insegnante di Danza STILE MUSICAL certificato dal C.O.N.I. attraverso l\342\200\231Ente di promozione sportiva ASI\n\342\234\205 Rilascio del Tesserino di Tecnico 2\302\260 Livello SHOW DANCE BC005 per insegnare nelle A.S.D.\n\342\234\205 Inserimento insegnante nell\'ALBO TECNICO ASI\n\342\234\205 Il corso \303\250 rivolto a insegnanti (o aspiranti tali) e danzatori in carriera con buona tecnica di danza jazz e classica che vogliono compiere un percorso formativo che permetta loro di migliorare ed approfondire le loro conoscenze per impostare una lezione di Musical partendo dall\342\200\231analisi del repertorio e strutturare lo spettacolo di fine anno.\n\342\234\205 45 ore di corso di cui 43 in studio in Area Dance (Milano) 2 ore dedicato all\342\200\231Associazionismo e alla Riforma dello Sport per collaboratori sportivi\n\360\237\223\215 DOCENTI PERFORMER\nFloriana Monici (docente) (istruttore MODERN di II livello e SHOWDANCE IV livello)\nRoberto Colombo (docente) (istruttore Showdance di III livello)\nGiuseppe Galizia (docente) (istruttore Showdance di III livello)\n\360\237\223\215 QUANDO\nIl corso si svolger\303\240 tra i mesi di OTTOBRE e NOVEMBRE 2024\n(ottenimento del tesserino tecnico entro fine DICEMBRE 2024)\n\360\237\223\215 COME\nParte del corso sar\303\240 ON-LINE (2 h) e il resto IN STUDIO (43 h) ovvero nelle sale danza\342\200\250\360\237\223\215 DATE\n2/3 novembre\n9/10 novembre\n16/17 novembre\n30 nov/1 dic\n\342\200\250\n\342\234\205PRENOTAZIONE e maggior informazioni:\342\234\205\nSito: areadance.it (Sezione CORSI C.O.N.I. > Musical)\nArea Dance 02 83412168"
}
}
fields {
key: "endTime"
value {
string_value: "23:55"
}
}
fields {
key: "packages"
value {
array_value {
}
}
}
fields {
key: "id"
value {
string_value: "KK6awuzr6WyuTzLuFFNA"
}
}
fields {
key: "months"
value {
array_value {
values {
string_value: "2024-08"
}
values {
string_value: "2024-09"
}
values {
string_value: "2024-10"
}
values {
string_value: "2024-11"
}
values {
string_value: "2024-12"
}
}
}
}
fields {
key: "teachers"
value {
array_value {
values {
string_value: "Ai3DLmo5DUY2jBk2RXeyYnwZAsI2"
}
values {
string_value: "rrM1YvC8txbCwXEOEWQi8wJ5V112"
}
values {
string_value: "C4cqalkAFnSYR7tyZFjAmmiLE923"
}
}
}
}
fields {
key: "color"
value {
map_value {
fields {
key: "secondary"
value {
string_value: "#3cb371"
}
}
fields {
key: "primary"
value {
string_value: "#3cb371"
}
}
}
}
}
fields {
key: "disciplines"
value {
array_value {
}
}
}
fields {
key: "externalLink"
value {
string_value: "https://www.areadance.it/corso-insegnanti-danza-stile-musical/"
}
}
fields {
key: "price"
value {
null_value: NULL_VALUE
}
}
fields {
key: "startTime"
value {
string_value: "00:00"
}
}
fields {
key: "cover"
value {
string_value: "https://firebasestorage.googleapis.com/v0/b/area-dance.appspot.com/o/pCI9rqLuoZclqg2h5VMQkcZ3ZYD3%2Flocan_corsoInsegnanti_ottNov2024_musical_APP.jpg?alt=media&token=0fd8a411-f671-452e-b765-087128872514"
}
}
fields {
key: "lessons"
value {
array_value {
}
}
}
fields {
key: "externalLinkName"
value {
string_value: "Info e Iscrizione"
}
}
fields {
key: "priority"
value {
integer_value: 0
}
}
fields {
key: "title"
value {
string_value: "Diploma insegnante danza STILE MUSICAL"
}
}
fields {
key: "end"
value {
integer_value: 1733093700000
}
}
fields {
key: "start"
value {
integer_value: 1723327200000
}
}
fields {
key: "status"
value {
string_value: "PUBLISHED"
}
}
create_time {
seconds: 1723400105
nanos: 157928000
}
update_time {
seconds: 1728943675
nanos: 228740000
}
}
target_ids: 186
}
}
```
### If using Swift Package Manager, the project's Package.resolved
Expand Package.resolved snippet
```json
{
"originHash" : "dad211cad9ed42e8160f8011fca9b0beef83aa40eaa4bb33cdfc2deb86ba74ce",
"pins" : [
{
"identity" : "abseil-cpp-binary",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/abseil-cpp-binary.git",
"state" : {
"revision" : "194a6706acbd25e4ef639bcaddea16e8758a3e27",
"version" : "1.2024011602.0"
}
},
{
"identity" : "app-check",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/app-check.git",
"state" : {
"revision" : "87dd288fc792bf9751e522e171a47df5b783b0b8",
"version" : "11.1.0"
}
},
{
"identity" : "braintree-ios-drop-in",
"kind" : "remoteSourceControl",
"location" : "https://github.com/braintree/braintree-ios-drop-in",
"state" : {
"revision" : "f969c0a09b39626d7dd5a4a76a0744308f7b054a",
"version" : "9.13.0"
}
},
{
"identity" : "braintree_ios",
"kind" : "remoteSourceControl",
"location" : "https://github.com/braintree/braintree_ios",
"state" : {
"revision" : "da2484a697dc9940861d588157771906b40c89a3",
"version" : "5.26.0"
}
},
{
"identity" : "firebase-ios-sdk",
"kind" : "remoteSourceControl",
"location" : "https://github.com/firebase/firebase-ios-sdk",
"state" : {
"revision" : "f909f901bfba9e27e4e9da83242a4915d6dd64bb",
"version" : "11.3.0"
}
},
{
"identity" : "googleappmeasurement",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleAppMeasurement.git",
"state" : {
"revision" : "93406fd21b85e66e2d6dbf50b472161fd75c3f1f",
"version" : "11.3.0"
}
},
{
"identity" : "googledatatransport",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleDataTransport.git",
"state" : {
"revision" : "617af071af9aa1d6a091d59a202910ac482128f9",
"version" : "10.1.0"
}
},
{
"identity" : "googleutilities",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleUtilities.git",
"state" : {
"revision" : "53156c7ec267db846e6b64c9f4c4e31ba4cf75eb",
"version" : "8.0.2"
}
},
{
"identity" : "grpc-binary",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/grpc-binary.git",
"state" : {
"revision" : "f56d8fc3162de9a498377c7b6cea43431f4f5083",
"version" : "1.65.1"
}
},
{
"identity" : "gtm-session-fetcher",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/gtm-session-fetcher.git",
"state" : {
"revision" : "a2ab612cb980066ee56d90d60d8462992c07f24b",
"version" : "3.5.0"
}
},
{
"identity" : "interop-ios-for-google-sdks",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/interop-ios-for-google-sdks.git",
"state" : {
"revision" : "2d12673670417654f08f5f90fdd62926dc3a2648",
"version" : "100.0.0"
}
},
{
"identity" : "kingfisher",
"kind" : "remoteSourceControl",
"location" : "https://github.com/onevcat/Kingfisher.git",
"state" : {
"revision" : "33696a71dd4d71f1b0f781ade11a48ba5549581a",
"version" : "8.0.3"
}
},
{
"identity" : "leveldb",
"kind" : "remoteSourceControl",
"location" : "https://github.com/firebase/leveldb.git",
"state" : {
"revision" : "a0bc79961d7be727d258d33d5a6b2f1023270ba1",
"version" : "1.22.5"
}
},
{
"identity" : "metacodable",
"kind" : "remoteSourceControl",
"location" : "https://github.com/SwiftyLab/MetaCodable.git",
"state" : {
"revision" : "eeb9f27fc80b4ef21cde1ce22e7dd7e58dbbed38",
"version" : "1.0.0"
}
},
{
"identity" : "nanopb",
"kind" : "remoteSourceControl",
"location" : "https://github.com/firebase/nanopb.git",
"state" : {
"revision" : "b7e1104502eca3a213b46303391ca4d3bc8ddec1",
"version" : "2.30910.0"
}
},
{
"identity" : "promises",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/promises.git",
"state" : {
"revision" : "540318ecedd63d883069ae7f1ed811a2df00b6ac",
"version" : "2.4.0"
}
},
{
"identity" : "sfsafesymbols",
"kind" : "remoteSourceControl",
"location" : "https://github.com/SFSafeSymbols/SFSafeSymbols.git",
"state" : {
"revision" : "e2e28f4e56e1769c2ec3c61c9355fc64eb7a535a",
"version" : "5.3.0"
}
},
{
"identity" : "swift-collections",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-collections.git",
"state" : {
"revision" : "671108c96644956dddcd89dd59c203dcdb36cec7",
"version" : "1.1.4"
}
},
{
"identity" : "swift-protobuf",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-protobuf.git",
"state" : {
"revision" : "ebc7251dd5b37f627c93698e4374084d98409633",
"version" : "1.28.2"
}
},
{
"identity" : "swift-syntax",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-syntax.git",
"state" : {
"revision" : "64889f0c732f210a935a0ad7cda38f77f876262d",
"version" : "509.1.1"
}
}
],
"version" : 3
}
```
Contributor guide
Assessment
This issue has not been assessed yet.