wordpress-mobile / WordPress-iOS

WordPress for iOS - Official repository
http://ios.wordpress.org/
GNU General Public License v2.0
3.66k stars 1.11k forks source link

Offline Support: Add Category showing blocking alert. #11431

Closed diegoreymendez closed 3 months ago

diegoreymendez commented 5 years ago

Post Settings > Categories > Add Category - typing in a category and pressing save in upper right displays “Error / The internet connection appears to be offline dialog”

yaelirub commented 5 years ago

In case of no connectivity When saving a new category first we check to see if the category already exist using categoryService findWithBlogObjectID if it exists and the blog categories are available, we don't show the network alert. same_category

If the category doesn't exist, we attempt to create a new category by calling categoryService.createCategoryWithName (which in turn calls TaxonomyServiceRemote.createCategory). When this call fails with an error other than 403, we call [WPError showXMLRPCErrorAlert:error]; (not sure why it is called like that) that eventually show a generic error.
new_category

A few questions for discussion:

  1. Should we try and queue the request and retry until success or timeout? (maybe use something like AlamoFire RequestRetrier ?

  2. Do want to implement some sort of behavior other than failing and notifying the user for this feature?

  3. If the answer to 2 is yes, how do we want to notify the user that their request will be executed when regaining connectivity?

  4. If the answer to 2 is no, how do we want to notify the user ? Is snack bar applicable here?

@diegoreymendez , @megsfulton

megsfulton commented 5 years ago

What I would assume from a user perspective would be that any post settings are saved and stored the same way modifications to post content would be.

Is it possible to save the new category locally and handle the creation of the category with the post upload?

diegoreymendez commented 5 years ago

My initial expectation would be to match what @megsfulton described above. Let's see what we need to make that happen and if it's possible for us to do so.