Firestore Connectivity Error

I’ve noticed an error warning keeps cropping up in Xcode‘s output console when doing the iOS Database lessons and challenges. Until now it hasn’t really been an issue, but in the latest challenge it is.

This is the error message:

2022-04-17 17:21:47.365853+0100 Firebase Demo[11383:331544] 8.15.0 - [Firebase/Firestore][I-FST000001] WatchStream (7faddcc0ad88) Stream error: 'Unavailable: Network connectivity changed'

2022-04-17 17:21:47.367895+0100 Firebase Demo[11383:331544] 8.15.0 - [Firebase/Firestore][I-FST000001] Could not reach Cloud Firestore backend. Connection failed 1 times. Most recent error: Network connectivity changed
 This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.

I’ve hunted around to find a solution to this, but nothing is forthcoming. Certainly I couldn’t find anything on the CWC+ forums. I’ve tried all sorts of different things, such as turning off my VPN, but nothing seems to make any difference.

The problem with this error occurs comes when I’m expecting a database query to return three items of data, yet it only returns two.

I wondered if the problem was with the simulator, and so spent the time setting Xcode up to work with my iPhone SE (the 2020 version, because the one I normally use is stuck on an older iOS that won’t work with our project). Another 40 minutes for thumb-twiddling.

I restarted Xcode and then tried running the app on the physical phone, with nothing showing on the output console.

I switched back to the simulator and ran it again. This time there’s no error, but I do get all three items of data shown in the output console.

Running the app on the similator again does, again, show up the error message as shown above only, this time, all three items of data are displayed.

What’s going on?

Only Apple knows. I wonder if they do…