wordpress-mobile / WordPress-Android

WordPress for Android
http://android.wordpress.org
GNU General Public License v2.0
2.97k stars 1.32k forks source link

Posting/Editing: cannot create new post after selecting a hidden site using the site switcher #10911

Open designsimply opened 4 years ago

designsimply commented 4 years ago

Steps to reproduce:

  1. Open the app.
  2. Go to My Sites at the bottom left
  3. Choose Switch Site.
  4. If you don't already have any hidden sites, tap the more menu at top right and hide one of the sites.
  5. Hit the search icon on the top.
  6. Tap the text input box and search for a hidden site.
  7. Tap a hidden site to choose.
  8. See the site is now the current site.
  9. Tap new post button at the bottom.

Props @kraftbj for providing the steps to reproduce. 😍

Result: I cannot create a post and two error notices appeared. (29s)

This blog is hidden and couldn't be loaded. Enable it again in settings and try again.

An error occurred when loading the post. Refresh your posts and try again.

Screen Shot 2019-12-05 at Dec 5 1 04 40 PM Screenshot_20191205-121020 Tested with WPAndroid alpha-200 on Pixel 3 Android 10.

Note: when I tested, sometimes I was able to create a new post and sometimes I couldn't. I think this is because sometimes a site visibility change takes place after selecting a hidden site with the site switcher and sometimes it doesn't.

Most of the time, the logs indicate that the site visibility was updated. I spotted one Volley error in one session that seems to be about the post not being able to be created though. I am not sure why it only appeared in some of the sessions, regardless of whether or not the new post button worked.

Screenshot_20191205-123102 Screenshot_20191205-122815

(internal reference: p4k3M4-2BP-p2#comment-2107 cc @kraftbj @maxme)

designsimply commented 4 years ago

Here is a full set of logs from a session where I tried the steps twice. Interestingly, on the first pass starting at 19:55 creating a new post was successful and I saw a Volley error early on and in the second pass starting at 19:57 I saw the error notices but nothing matching in the logs. 🤔

Click to expand logs:
WordPress - 13.8-rc-1 - Version code: 802
Android device name: Google Pixel 3
01 - [Dec-05 19:55 DB] Site found by (local) ID: 13 02 - [Dec-05 19:55 DB] Updating site: http://thetimeywimeykindof.family.blog 03 - [Dec-05 19:55 API] Volley error on https://public-api.wordpress.com/rest/v1.1/sites/161701929/post/0/diffs/?locale=en_US - exception: null 04 - [Dec-05 19:55 API] StackTrace: com.android.volley.ClientError at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:199) at com.android.volley.NetworkDispatcher.processRequest(NetworkDispatcher.java:131) at com.android.volley.NetworkDispatcher.processRequest(NetworkDispatcher.java:111) at com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:90) 05 - [Dec-05 19:55 API] Dispatching action: PostAction-FETCHED_REVISIONS 06 - [Dec-05 19:55 API] Volley error on https://public-api.wordpress.com/rest/v1.1/sites/161701929/post/0/diffs/?locale=en_US - exception: null 07 - [Dec-05 19:55 API] StackTrace: com.android.volley.ClientError at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:199) at com.android.volley.NetworkDispatcher.processRequest(NetworkDispatcher.java:131) at com.android.volley.NetworkDispatcher.processRequest(NetworkDispatcher.java:111) at com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:90) 08 - [Dec-05 19:55 API] Dispatching action: PostAction-FETCHED_REVISIONS 09 - [Dec-05 19:55 API] An error occurred while fetching History revisions 10 - [Dec-05 19:55 API] An error occurred while fetching History revisions 11 - [Dec-05 19:55 EDITOR] Running application "gutenberg" with appParams: {"initialProps":{"initialData":"","postType":"post","initialHtmlModeEnabled":false,"initialTitle":"","locale":"en-us","translations":{"%s block. Empty":["%s block. Empty"],"Move block down from row %1$s to row %2$s":["Move block down from row %1$s to row %2$s"],"Unsupported":["Unsupported"],"Double tap and hold to edit":["Double tap and hold to edit"],"Paste URL":["Paste URL"],"'%s' isn't yet supported on WordPress for iOS":["'%s' isn't yet supported on WordPress for iOS"],"Double tap to toggle setting":["Double tap to toggle setting"],"RESET":["RESET"],"Post title. %s":["Post title. %s"],"Level %1$s. %2$s":["Level %1$s. %2$s"],"ADD BLOCK HERE":["ADD BLOCK HERE"],"Title:":["Title:"],"Image caption. %s":["Image caption. %s"],"ADD VIDEO":["ADD VIDEO"],"Move block up":["Move block up"],"Hide keyboard":["Hide keyboard"],"Page break block. %s":["Page break block. %s"],"My post publish panel":["My post publish panel"],"Level %s. Empty.":["Level %s. Empty."],"Empty":["Empty"],"Content…":["Content…"],"Take a Video":["Take a Video"],"Take a Photo or Video":["Take a Photo or Video"],"Link inserted":["Link inserted"],"Annotations Sidebar":["Annotations Sidebar"],"'%s' isn't yet supported on WordPress for Android":["'%s' isn't yet supported on WordPress for Android"],"Double tap to select":["Double tap to select"],"Start writing…":["Start writing…"],"Show section":["Show section"],"We are working hard to add more blocks with each release. In the meantime, you can also edit this post on the web.":["We are working hard to add more blocks with each release. In the meantime, you can also edit this post on the web."],"Double tap to move the block down":["Double tap to move the block down"],"Size":["Size"],"Double tap to edit this value":["Double tap to edit this value"],"WordPress Media Library":["WordPress Media Library"],"No application can handle this request. Please install a Web browser.":["No application can handle this request. Please install a Web browser."],"ADD IMAGE":["ADD IMAGE"],"ADD IMAGE OR VIDEO":["ADD IMAGE OR VIDEO"],"Choose from device":["Choose from device"],"Ungroup":["Ungroup"],"Add URL":["Add URL"],"Link text":["Link text"],"My pre publish panel":["My pre publish panel"],"Double tap to redo last change":["Double tap to redo last change"],"Current value is %s":["Current value is %s"],"Reset Block":["Reset Block"],"Here is the panel content!":["Here is the panel content!"],"Tap to hide the keyboard":["Tap to hide the keyboard"],"Sidebar title plugin":["Sidebar title plugin"],"Remove block at row %s":["Remove block at row %s"],"Double tap to remove the block":["Double tap to remove the block"],"Add link text":["Add link text"],"Navigate Up":["Navigate Up"],"Double tap to select a video":["Double tap to select a video"],"Open Settings":["Open Settings"],"Double tap to add a block":["Double tap to add a block"],"Alt Text":["Alt Text"],"Tap here to show help":["Tap here to show help"],"Move block up from row %1$s to row %2$s":["Move block up from row %1$s to row %2$s"],"Double tap to select an image":["Double tap to select an image"],"Add annotation":["Add annotation"],"Help icon":["Help icon"],"Double tap to undo last change":["Double tap to undo last change"],"Remove annotations":["Remove annotations"],"Translate":["Translate"],"Clear All Settings":["Clear All Settings"],"Double tap to change the value using slider":["Double tap to change the value using slider"],"Problem displaying block":["Problem displaying block"],"Failed to insert media.\nPlease tap for options.":["Failed to insert media.\nPlease tap for options."],"An unknown error occurred. Please try again.":["An unknown error occurred. Please try again."],"Problem opening the video":["Problem opening the video"],"Double tap to move the block up":["Double tap to move the block up"],"%s block. This block has invalid content":["%s block. This block has invalid content"],"Move block down":["Move block down"],"Take a Photo":["Take a Photo"],"Row %d.":["Row %d."],"Post title. Empty":["Post title. Empty"],"%s Block":["%s Block"],"Add a description":["Add a description"],"My post status info":["My post status info"],"My Document Setting Panel":["My Document Setting Panel"]}},"rootTag":1}. __DEV__ === false, development-level warning are OFF, performance optimizations are ON 12 - [Dec-05 19:55 EDITOR] 'locale', 'en', { '%s block. Empty': [ '%s block. Empty' ], 'Move block down from row %1$s to row %2$s': [ 'Move block down from row %1$s to row %2$s' ], Unsupported: [ 'Unsupported' ], 'Double tap and hold to edit': [ 'Double tap and hold to edit' ], 'Paste URL': [ 'Paste URL' ], '\'%s\' isn\'t yet supported on WordPress for iOS': [ '\'%s\' isn\'t yet supported on WordPress for iOS' ], 'Double tap to toggle setting': [ 'Double tap to toggle setting' ], RESET: [ 'RESET' ], 'Post title. %s': [ 'Post title. %s' ], 'Level %1$s. %2$s': [ 'Level %1$s. %2$s' ], 'ADD BLOCK HERE': [ 'ADD BLOCK HERE' ], 'Title:': [ 'Title:' ], 'Image caption. %s': [ 'Image caption. %s' ], 'ADD VIDEO': [ 'ADD VIDEO' ], 'Move block up': [ 'Move block up' ], 'Hide keyboard': [ 'Hide keyboard' ], 'Page break block. %s': [ 'Page break block. %s' ], 'My post publish panel': [ 'My post publish panel' ], 'Level %s. Empty.': [ 'Level %s. Empty.' ], Empty: [ 'Empty' ], 'Content…': [ 'Content…' ], 'Take a Video': [ 'Take a Video' ], 'Take a Photo or Video': [ 'Take a Photo or Video' ], 'Link inserted': [ 'Link inserted' ], 'Annotations Sidebar': [ 'Annotations Sidebar' ], '\'%s\' isn\'t yet supported on WordPress for Android': [ '\'%s\' isn\'t yet supported on WordPress for Android' ], 'Double tap to select': [ 'Double tap to select' ], 'Start writing…': [ 'Start writing…' ], 'Show section': [ 'Show section' ], 'We are working hard to add more blocks with each release. In the meantime, you can also edit this post on the web.': [ 'We are working hard to add more blocks with each release. In the meantime, you can also edit this post on the web.' ], 'Double tap to move the block down': [ 'Double tap to move the block down' ], Size: [ 'Size' ], 'Double tap to edit this value': [ 'Double tap to edit this value' ], 'WordPress Media Library': [ 'WordPress Media Library' ], 'No application can handle this request. Please install a Web browser.': [ 'No application can handle this request. Please install a Web browser.' ], 'ADD IMAGE': [ 'ADD IMAGE' ], 'ADD IMAGE OR VIDEO': [ 'ADD IMAGE OR VIDEO' ], 'Choose from device': [ 'Choose from device' ], Ungroup: [ 'Ungroup' ], 'Add URL': [ 'Add URL' ], 'Link text': [ 'Link text' ], 'My pre publish panel': [ 'My pre publish panel' ], 'Double tap to redo last change': [ 'Double tap to redo last change' ], 'Current value is %s': [ 'Current value is %s' ], 'Reset Block': [ 'Reset Block' ], 'Here is the panel content!': [ 'Here is the panel content!' ], 'Tap to hide the keyboard': [ 'Tap to hide the keyboard' ], 'Sidebar title plugin': [ 'Sidebar title plugin' ], 'Remove block at row %s': [ 'Remove block at row %s' ], 'Double tap to remove the block': [ 'Double tap to remove the block' ], 'Add link text': [ 'Add link text' ], 'Navigate Up': [ 'Navigate Up' ], 'Double tap to select a video': [ 'Double tap to select a video' ], 'Open Settings': [ 'Open Settings' ], 'Double tap to add a block': [ 'Double tap to add a block' ], 'Alt Text': [ 'Alt Text' ], 'Tap here to show help': [ 'Tap here to show help' ], 'Move block up from row %1$s to row %2$s': [ 'Move block up from row %1$s to row %2$s' ], 'Double tap to select an image': [ 'Double tap to select an image' ], 'Add annotation': [ 'Add annotation' ], 'Help icon': [ 'Help icon' ], 'Double tap to undo last change': [ 'Double tap to undo last change' ], 'Remove annotations': [ 'Remove annotations' ], Translate: [ 'Translate' ], 'Clear All Settings': [ 'Clear All Settings' ], 'Double tap to change the value using slider': [ 'Double tap to change the value using slider' ], 'Problem displaying block': [ 'Problem displaying block' ], 'Failed to insert media.\nPlease tap for options.': [ 'Failed to insert media.\nPlease tap for options.' ], 'An unknown error occurred. Please try again.': [ 'An unknown error occurred. Please try again.' ], 'Problem opening the video': [ 'Problem opening the video' ], 'Double tap to move the block up': [ 'Double tap to move the block up' ], '%s block. This block has invalid content': [ '%s block. This block has invalid content' ], 'Move block down': [ 'Move block down' ], 'Take a Photo': [ 'Take a Photo' ], 'Row %d.': [ 'Row %d.' ], 'Post title. Empty': [ 'Post title. Empty' ], '%s Block': [ '%s Block' ], 'Add a description': [ 'Add a description' ], 'My post status info': [ 'My post status info' ], 'My Document Setting Panel': [ 'My Document Setting Panel' ] } 13 - [Dec-05 19:55 STATS] 🔵 Tracked: editor_session_start, Properties: {"has_unsupported_blocks":"0","editor":"gutenberg","content_type":"new","session_id":"9d28c13a-cc2c-4fe5-a94b-034dc610791c","post_type":"post","blog_type":"wpcom","editor_has_hw_disabled":"0","unsupported_blocks":[]} 14 - [Dec-05 19:55 API] Dispatching action: PostAction-REMOVE_POST 15 - [Dec-05 19:55 API] Dispatching action: ListAction-LIST_ITEMS_REMOVED 16 - [Dec-05 19:55 STATS] 🔵 Tracked: editor_closed 17 - [Dec-05 19:55 UTILS] trackLastActivity, activityId: My Site 18 - [Dec-05 19:55 API] Dispatching action: AccountAction-FETCH_ACCOUNT 19 - [Dec-05 19:55 PROFILING] Visual Editor Startup: begin 20 - [Dec-05 19:55 PROFILING] Visual Editor Startup: 0 ms, EditorFragment.onCreate 21 - [Dec-05 19:55 PROFILING] Visual Editor Startup: 3416 ms, WPMainActivity.onResume 22 - [Dec-05 19:55 PROFILING] Visual Editor Startup: end, 3416 ms 23 - [Dec-05 19:55 API] Dispatching action: AccountAction-FETCHED_ACCOUNT 24 - [Dec-05 19:55 STATS] 🔵 Tracked: editor_session_end, Properties: {"has_unsupported_blocks":"0","editor":"gutenberg","content_type":"new","session_id":"9d28c13a-cc2c-4fe5-a94b-034dc610791c","post_type":"post","blog_type":"wpcom","editor_has_hw_disabled":"0","outcome":"cancel"} 25 - [Dec-05 19:56 UTILS] trackLastActivity, activityId: Me 26 - [Dec-05 19:56 STATS] 🔵 Tracked: me_tab_accessed 27 - [Dec-05 19:56 STATS] 🔵 Tracked: support_opened, Properties: {"origin":"ME_SCREEN_HELP"} 28 - [Dec-05 19:56 UTILS] trackLastActivity, activityId: Help Screen 29 - [Dec-05 19:56 UTILS] App goes to background 30 - [Dec-05 19:56 STATS] 🔵 Tracked: application_closed, Properties: {"last_visible_screen":"Help Screen","time_in_app":91} 31 - [Dec-05 19:56 MAIN] ConnectionChangeReceiver successfully unregistered 32 - [Dec-05 19:57 UTILS] App comes from background 33 - [Dec-05 19:57 STATS] 🔵 Tracked: application_opened 34 - [Dec-05 19:57 READER] notifications update job service > job scheduled 35 - [Dec-05 19:57 NOTIFS] notifications update job service > created 36 - [Dec-05 19:57 UTILS] trackLastActivity, activityId: Help Screen 37 - [Dec-05 19:57 NOTIFS] notifications update service > completed 38 - [Dec-05 19:57 NOTIFS] notifications update job service > all tasks completed 39 - [Dec-05 19:57 UTILS] trackLastActivity, activityId: Me 40 - [Dec-05 19:57 API] Dispatching action: AccountAction-FETCH_ACCOUNT 41 - [Dec-05 19:57 NOTIFS] notifications update job service > destroyed 42 - [Dec-05 19:57 API] Dispatching action: AccountAction-FETCHED_ACCOUNT 43 - [Dec-05 19:57 UTILS] trackLastActivity, activityId: My Site 44 - [Dec-05 19:57 STATS] 🔵 Tracked: my_site_tab_accessed, Properties: {"blog_id":161701929,"is_jetpack":false} 45 - [Dec-05 19:57 UTILS] trackLastActivity, activityId: Site Picker 46 - [Dec-05 19:57 API] Dispatching action: SiteAction-FETCH_SITE 47 - [Dec-05 19:57 UTILS] trackLastActivity, activityId: My Site 48 - [Dec-05 19:57 API] Dispatching action: AccountAction-FETCH_ACCOUNT 49 - [Dec-05 19:57 API] Dispatching action: SiteAction-FETCH_POST_FORMATS 50 - [Dec-05 19:57 API] Dispatching action: SiteAction-FETCH_SITE_EDITORS 51 - [Dec-05 19:57 API] Received site Categories 52 - [Dec-05 19:57 API] Successfully fetched WP.com categories 53 - [Dec-05 19:57 API] Received response to Settings REST request. 54 - [Dec-05 19:57 API] Dispatching action: SiteAction-FETCHED_POST_FORMATS 55 - [Dec-05 19:57 API] Dispatching action: SiteAction-FETCHED_SITE_EDITORS 56 - [Dec-05 19:57 API] Dispatching action: AccountAction-FETCHED_ACCOUNT 57 - [Dec-05 19:57 API] Dispatching action: SiteAction-UPDATE_SITE 58 - [Dec-05 19:57 DB] Site found by (local) ID: 1 59 - [Dec-05 19:57 DB] Updating site: http://made4testing0318.blog 60 - [Dec-05 19:57 DB] Site found by (local) ID: 1 61 - [Dec-05 19:57 DB] Updating site: http://made4testing0318.blog 62 - [Dec-05 19:57 UTILS] trackLastActivity, activityId: My Site 63 - [Dec-05 19:57 API] Dispatching action: AccountAction-FETCH_ACCOUNT 64 - [Dec-05 19:57 API] Dispatching action: AccountAction-FETCHED_ACCOUNT 65 - [Dec-05 19:57 UTILS] trackLastActivity, activityId: Site Picker 66 - [Dec-05 19:57 API] Dispatching action: SiteAction-UPDATE_SITE 67 - [Dec-05 19:57 DB] Site found by (local) ID: 13 68 - [Dec-05 19:57 DB] Updating site: http://thetimeywimeykindof.family.blog 69 - [Dec-05 19:57 API] Site visibility successfully updated 70 - [Dec-05 19:57 API] Dispatching action: SiteAction-UPDATE_SITE 71 - [Dec-05 19:57 DB] Site found by (local) ID: 13 72 - [Dec-05 19:57 DB] Updating site: http://thetimeywimeykindof.family.blog 73 - [Dec-05 19:57 API] Dispatching action: SiteAction-FETCH_SITE 74 - [Dec-05 19:57 UTILS] trackLastActivity, activityId: My Site 75 - [Dec-05 19:57 API] Dispatching action: AccountAction-FETCH_ACCOUNT 76 - [Dec-05 19:57 API] Dispatching action: SiteAction-FETCH_POST_FORMATS 77 - [Dec-05 19:57 API] Dispatching action: SiteAction-FETCH_SITE_EDITORS 78 - [Dec-05 19:57 API] Received site Categories 79 - [Dec-05 19:57 API] Successfully fetched WP.com categories 80 - [Dec-05 19:57 API] Received response to Settings REST request. 81 - [Dec-05 19:57 API] Dispatching action: SiteAction-FETCHED_SITE_EDITORS 82 - [Dec-05 19:57 DB] Site found by (local) ID: 13 83 - [Dec-05 19:57 DB] Updating site: http://thetimeywimeykindof.family.blog 84 - [Dec-05 19:57 API] Dispatching action: SiteAction-FETCHED_POST_FORMATS 85 - [Dec-05 19:57 API] Dispatching action: SiteAction-UPDATE_SITE 86 - [Dec-05 19:57 API] Site visibility successfully updated 87 - [Dec-05 19:57 API] Dispatching action: AccountAction-FETCHED_ACCOUNT 88 - [Dec-05 19:57 DB] Site found by (local) ID: 13 89 - [Dec-05 19:57 DB] Updating site: http://thetimeywimeykindof.family.blog 90 - [Dec-05 19:57 UTILS] trackLastActivity, activityId: My Site 91 - [Dec-05 19:57 API] Dispatching action: AccountAction-FETCH_ACCOUNT 92 - [Dec-05 19:57 API] Dispatching action: AccountAction-FETCHED_ACCOUNT 93 - [Dec-05 19:57 UTILS] trackLastActivity, activityId: My Site 94 - [Dec-05 19:57 API] Dispatching action: AccountAction-FETCH_ACCOUNT 95 - [Dec-05 19:57 API] Dispatching action: AccountAction-FETCHED_ACCOUNT 96 - [Dec-05 19:57 UTILS] trackLastActivity, activityId: Me 97 - [Dec-05 19:57 STATS] 🔵 Tracked: me_tab_accessed 98 - [Dec-05 19:58 STATS] 🔵 Tracked: support_opened, Properties: {"origin":"ME_SCREEN_HELP"} 99 - [Dec-05 19:58 UTILS] trackLastActivity, activityId: Help Screen
jd-alexander commented 3 years ago

I tested this on WPAndroid alpha-285, Pixel 3a, Android 11.

I was not able to reproduce this issue. I followed the instructions as described in the issue.

  1. I switched to a site that was already hidden and I was able to successfully create and publish posts.
  2. I also made a visible site hidden and executed the same actions and noticed no issues.
iamgabrielma commented 3 years ago

Another case: 4262616-zen . Asking the user to test these steps and will update the comment based on results :D