gutenberg-mobile icon indicating copy to clipboard operation
gutenberg-mobile copied to clipboard

Offline support for Embeds blocks

Open hypest opened this issue 4 years ago • 3 comments

This is an umbrella ticket for the various tasks we want to capture for a better offline support around the embeds blocks.

  • [ ] Don't try to fetch inline preview when offline
  • [ ] When offline, embed preview placeholder should denote that device is offline so preview is not available
  • [ ] Listen to connectivity changes and trigger fetching the preview when device gets online while in the editor
  • [ ] Listen to device getting offline and stop any previews still in progress

hypest avatar Sep 02 '21 11:09 hypest

Thanks for creating this issue @hypest While working on https://github.com/wordpress-mobile/gutenberg-mobile/pull/3921 I ran into related offline support cases. Should the functionality here be prioritized and implemented soon? Currently, I don't see any mechanisms within the editor for monitoring connectivity changes, so I am thinking that connectivity observers would have to be implemented in WP Android and WP iOS, and updates get passed over the bridge.

jd-alexander avatar Sep 08 '21 15:09 jd-alexander

For iOS I saw that we use the method ReachabilityUtils.isInternetReachable() in different places to determine if the device is offline. Probably we could expose a function in the bridge to check if internet is reachable on both platforms.

fluiddot avatar Sep 10 '21 17:09 fluiddot

Thanks for checking @fluiddot similarly on Android, NetworkUtils.isNetworkAvailable(WordPress.getContext()) is utilized across the codebase to check if the device is offline or not.

jd-alexander avatar Sep 10 '21 17:09 jd-alexander