woocommerce / woocommerce-ios

WooCommerce iOS app
https://www.woocommerce.com/mobile
GNU General Public License v2.0
312 stars 113 forks source link

Offline banner: it will not be dismissed when the internet connection is back on Simulator #5052

Open pmusolino opened 3 years ago

pmusolino commented 3 years ago

It happened to me on the simulator (iPhone 13 Pro, iOS 15.0), while I was testing the shipping labels, that my connection stopped working. The wifi was connected, but the internet was not surfing.

The offline banner was displayed correctly in the order list, in the order detail, and in shipping label form screens, but when the connection returned and everything was back to normal, the banner was not dismissed. Even closing the view, and reopening it, the banner was still there, visible, as if I were still offline for it.

peril-woocommerce[bot] commented 3 years ago
Fails
:no_entry_sign: Please add a feature label to this issue. e.g. 'feature: stats'

Generated by :no_entry_sign: dangerJS

pmusolino commented 3 years ago

Tagging you @itsmeichigo because you worked on this feature, and maybe you know the reason.

itsmeichigo commented 3 years ago

NWPathMonitor doesn't work well on simulator, so I had to test with real devices when working on the offline banner. Do you think it's worth it to disable the banner when running on simulator?

pmusolino commented 3 years ago

Thank you @itsmeichigo, I didn't know that and I think it will be a case that will often happen to other colleagues who will not know about this thing. I believe that in this case, the best solution is to modify the banner text only when running on the simulator, clearly writing that the banner does not work correctly on the simulator. What do you think?

itsmeichigo commented 3 years ago

Sure! I'll create a PR to make the banner available only on devices.

pmusolino commented 3 years ago

I would not disable the banner, because it is part of the UI of the app in production, and therefore we could verify that everything continues to work as before. 👍