Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FastImage issue on Android #43149

Open
geriux opened this issue Aug 11, 2022 · 6 comments
Open

FastImage issue on Android #43149

geriux opened this issue Aug 11, 2022 · 6 comments
Assignees
Labels
Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) [Type] Bug An existing feature does not function as intended

Comments

@geriux
Copy link
Member

geriux commented Aug 11, 2022

Description

Initially, it was reported that blocks using FastImage (Image and Gallery block) were disappearing when changing the orientation of the device. We added a workaround for this but there might be cases when the images become invisible when something in the editor changes.

We should try to find the root of the problem but if's tricky to track down we should disable FastImage on Android until we figure it out.

Step-by-step reproduction instructions

There are no exact steps to reproduce from the recent reports but by just removing the workaround and rotating the device will make the images become invisible.

Expected behaviour

Images should be visible when any updates occur within the editor.

Actual behaviour

Images using the FastImage library (Image and Gallery block)

Screenshots or screen recording (optional)

N/A

@geriux geriux added the Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) label Aug 11, 2022
@geriux geriux self-assigned this Aug 11, 2022
@mkevins
Copy link
Contributor

mkevins commented Aug 12, 2022

I've investigated this issue a bit, with my findings in this comment.

One thing that may be worth noting is that the images are still fetched, even when they are invisible. I have verified this using the network inspector by clearing the app data (and cache), and viewing a post with a gallery while the fragment had a theme added via xml.

In addition, I investigated further by turning on verbose logging of the FragmentManager:

adb shell setprop log.tag.FragmentManager VERBOSE

and then copying the logs after performing the same steps:

  1. Tap "posts" to open the post list
  2. Open a post (same each time) that has a gallery

and then removing the front of the log lines to remove the timestamps, as well as using some regex to somewhat crudely remove some object ids that will be different anyway for each run: s/{.*}/{}/g and s/([0-9a-f-]* /(/g.

After this, I diff the logs to see if there is anything that stands out internally with the FragmentManager:

Without xml theme vs. With xml theme
diff --git a/without-theme-truncated b/with-theme-truncated
index 3b14446..b314479 100644
--- a/without-theme-truncated
+++ b/with-theme-truncated
@@ -295,8 +295,8 @@ V  computeExpectedState() of 5 for PostListFragment{} (id=0x7f0a066a)
 V  computeExpectedState() of 6 for PostListFragment{} (id=0x7f0a066a)
 V  computeExpectedState() of 6 for PostListFragment{} (id=0x7f0a066a)
 V  computeExpectedState() of 5 for PostListFragment{} (id=0x7f0a066a)
-V  computeExpectedState() of 5 for PostListFragment{} (id=0x7f0a066a)
 V  computeExpectedState() of 6 for PostListFragment{} (id=0x7f0a066a)
+V  computeExpectedState() of 5 for PostListFragment{} (id=0x7f0a066a)
 V  SpecialEffectsController: For fragment PostListFragment{} (id=0x7f0a066a) mFinalState = VISIBLE -> VISIBLE. 
 V  SpecialEffectsController: For fragment PostListFragment{} (id=0x7f0a066a) mFinalState = VISIBLE -> VISIBLE. 
 V  SpecialEffectsController: For fragment PostListFragment{} (id=0x7f0a066a) mFinalState = VISIBLE -> VISIBLE. 
@@ -355,9 +355,9 @@ V  computeExpectedState() of 6 for PostListFragment{} (id=0x7f0a084f tag=search_
 V  computeExpectedState() of 7 for PostListFragment{} (id=0x7f0a066a)
 V  computeExpectedState() of 5 for PostListFragment{} (id=0x7f0a066a)
 V  computeExpectedState() of 6 for PostListFragment{} (id=0x7f0a084f tag=search_fragment)
+V  computeExpectedState() of 7 for PostListFragment{} (id=0x7f0a066a)
 V  computeExpectedState() of 5 for PostListFragment{} (id=0x7f0a066a)
 V  computeExpectedState() of 6 for PostListFragment{} (id=0x7f0a084f tag=search_fragment)
-V  computeExpectedState() of 7 for PostListFragment{} (id=0x7f0a066a)
 V  SpecialEffectsController: For fragment PostListFragment{} (id=0x7f0a084f tag=search_fragment) mFinalState = VISIBLE -> VISIBLE. 
 V  SpecialEffectsController: For fragment PostListFragment{} (id=0x7f0a084f tag=search_fragment) mFinalState = VISIBLE -> VISIBLE. 
 V  SpecialEffectsController: Executing pending operations
@@ -396,9 +396,9 @@ V  computeExpectedState() of 7 for PostListFragment{} (id=0x7f0a066a)
 V  computeExpectedState() of 5 for PostListFragment{} (id=0x7f0a066a)
 V  computeExpectedState() of 7 for PostListFragment{} (id=0x7f0a084f tag=search_fragment)
 V  computeExpectedState() of 7 for SupportRequestManagerFragment{}
+V  computeExpectedState() of 7 for PostListFragment{} (id=0x7f0a066a)
 V  computeExpectedState() of 5 for PostListFragment{} (id=0x7f0a066a)
 V  computeExpectedState() of 7 for PostListFragment{} (id=0x7f0a084f tag=search_fragment)
-V  computeExpectedState() of 7 for PostListFragment{} (id=0x7f0a066a)
 V  computeExpectedState() of 7 for SupportRequestManagerFragment{}
 V  computeExpectedState() of 4 for MySiteFragment{} (id=0x7f0a0355 tag=tag-mysite)
 D  movefrom STARTED: MySiteFragment{} (id=0x7f0a0355 tag=tag-mysite)
@@ -417,13 +417,13 @@ V  SpecialEffectsController: Forcing all operations to complete
 V  saveAllState: no fragments!
 V  Saving view state for fragment MySiteTabFragment{}
 V  Saved state of MySiteTabFragment{} (tag=f0): null
-V  saveAllState: adding fragment (3c841893-2c2b-4e8f-9ba7-49c255c82e1b): MySiteTabFragment{} (tag=f0)
+V  saveAllState: adding fragment (d61ad9f1-67bb-4324-a90f-8da4362f056d): MySiteTabFragment{} (tag=f0)
 V  Saving view state for fragment MySiteFragment{}
 V  Saved state of MySiteFragment{} (id=0x7f0a0355 tag=tag-mysite): null
 V  saveAllState: no fragments!
 V  Saved state of SupportRequestManagerFragment{}: null
-V  saveAllState: adding fragment (daf4f399-aa04-4e11-92e5-1371305fbd3a): MySiteFragment{} (id=0x7f0a0355 tag=tag-mysite)
-V  saveAllState: adding fragment (786e06ac-2173-475f-9cef-03f55c268764): SupportRequestManagerFragment{}
+V  saveAllState: adding fragment (d10eb2b9-9cf4-4198-8eb2-78ff8b8fbbb7): MySiteFragment{} (id=0x7f0a0355 tag=tag-mysite)
+V  saveAllState: adding fragment (8c9065c8-c4da-4270-96ac-24c3e5f22335): SupportRequestManagerFragment{}
 V  computeExpectedState() of 5 for PostListFragment{} (id=0x7f0a066a)
 D  movefrom RESUMED: PostListFragment{} (id=0x7f0a066a)
 V  computeExpectedState() of 5 for PostListFragment{} (id=0x7f0a066a)
@@ -438,8 +438,8 @@ D  movefrom RESUMED: SupportRequestManagerFragment{}
 V  computeExpectedState() of 5 for SupportRequestManagerFragment{}
 V  computeExpectedState() of 5 for SupportRequestManagerFragment{}
 V  computeExpectedState() of 5 for PostListFragment{} (id=0x7f0a066a)
-V  computeExpectedState() of 5 for PostListFragment{} (id=0x7f0a084f tag=search_fragment)
 V  computeExpectedState() of 5 for PostListFragment{} (id=0x7f0a066a)
+V  computeExpectedState() of 5 for PostListFragment{} (id=0x7f0a084f tag=search_fragment)
 V  computeExpectedState() of 5 for SupportRequestManagerFragment{}
 V  SpecialEffectsController: Forcing all operations to complete
 V  SpecialEffectsController: Forcing all operations to complete
@@ -457,7 +457,7 @@ D  moveto ATTACHED: GutenbergEditorFragment{} (id=0x7f0a060d tag=android:switche
 V  computeExpectedState() of 7 for GutenbergEditorFragment{} (id=0x7f0a060d tag=android:switcher:2131363341:0)
 D  moveto CREATED: GutenbergEditorFragment{} (id=0x7f0a060d tag=android:switcher:2131363341:0)
 D  StrictMode violation in org.wordpress.android.editor.gutenberg.GutenbergContainerFragment
-   androidx.fragment.app.strictmode.SetRetainInstanceUsageViolation: Attempting to set retain instance for fragment GutenbergContainerFragment{} (95786a23-2970-42ed-bb40-f3e74fc68315)
+   androidx.fragment.app.strictmode.SetRetainInstanceUsageViolation: Attempting to set retain instance for fragment GutenbergContainerFragment{} (f5a80c4f-8a5a-4598-8c42-6f6bdf3a82c9)
    	at androidx.fragment.app.strictmode.FragmentStrictMode.onSetRetainInstanceUsage(FragmentStrictMode.kt:99)
    	at androidx.fragment.app.Fragment.setRetainInstance(Fragment.java:1246)
    	at org.wordpress.android.editor.gutenberg.GutenbergEditorFragment.onCreate(GutenbergEditorFragment.java:201)
@@ -885,9 +885,9 @@ V  computeExpectedState() of 6 for GutenbergEditorFragment{} (id=0x7f0a060d tag=
 V  computeExpectedState() of 5 for EditPostSettingsFragment{} (id=0x7f0a060d tag=android:switcher:2131363341:1)
 V  computeExpectedState() of 5 for EditPostPublishSettingsFragment{} (id=0x7f0a060d tag=android:switcher:2131363341:2)
 V  computeExpectedState() of 5 for HistoryListFragment{} (id=0x7f0a060d tag=android:switcher:2131363341:3)
-V  computeExpectedState() of 5 for EditPostPublishSettingsFragment{} (id=0x7f0a060d tag=android:switcher:2131363341:2)
 V  computeExpectedState() of 5 for EditPostSettingsFragment{} (id=0x7f0a060d tag=android:switcher:2131363341:1)
 V  computeExpectedState() of 6 for GutenbergEditorFragment{} (id=0x7f0a060d tag=android:switcher:2131363341:0)
+V  computeExpectedState() of 5 for EditPostPublishSettingsFragment{} (id=0x7f0a060d tag=android:switcher:2131363341:2)
 V  computeExpectedState() of 5 for HistoryListFragment{} (id=0x7f0a060d tag=android:switcher:2131363341:3)
 V  SpecialEffectsController: For fragment GutenbergEditorFragment{} (id=0x7f0a060d tag=android:switcher:2131363341:0) mFinalState = VISIBLE -> VISIBLE. 
 V  SpecialEffectsController: For fragment EditPostSettingsFragment{} (id=0x7f0a060d tag=android:switcher:2131363341:1) mFinalState = VISIBLE -> VISIBLE. 
@@ -944,11 +944,11 @@ V  computeExpectedState() of 5 for EditPostSettingsFragment{} (id=0x7f0a060d tag
 V  computeExpectedState() of 5 for EditPostPublishSettingsFragment{} (id=0x7f0a060d tag=android:switcher:2131363341:2)
 V  computeExpectedState() of 5 for HistoryListFragment{} (id=0x7f0a060d tag=android:switcher:2131363341:3)
 V  computeExpectedState() of 7 for SupportRequestManagerFragment{}
-V  computeExpectedState() of 5 for EditPostPublishSettingsFragment{} (id=0x7f0a060d tag=android:switcher:2131363341:2)
 V  computeExpectedState() of 5 for EditPostSettingsFragment{} (id=0x7f0a060d tag=android:switcher:2131363341:1)
-V  computeExpectedState() of 7 for SupportRequestManagerFragment{}
 V  computeExpectedState() of 7 for GutenbergEditorFragment{} (id=0x7f0a060d tag=android:switcher:2131363341:0)
+V  computeExpectedState() of 5 for EditPostPublishSettingsFragment{} (id=0x7f0a060d tag=android:switcher:2131363341:2)
 V  computeExpectedState() of 5 for HistoryListFragment{} (id=0x7f0a060d tag=android:switcher:2131363341:3)
+V  computeExpectedState() of 7 for SupportRequestManagerFragment{}
 V  computeExpectedState() of 4 for PostListFragment{} (id=0x7f0a066a)
 D  movefrom STARTED: PostListFragment{} (id=0x7f0a066a)
 V  computeExpectedState() of 4 for PostListFragment{} (id=0x7f0a066a)
@@ -962,8 +962,8 @@ V  computeExpectedState() of 4 for SupportRequestManagerFragment{}
 D  movefrom STARTED: SupportRequestManagerFragment{}
 V  computeExpectedState() of 4 for SupportRequestManagerFragment{}
 V  computeExpectedState() of 4 for PostListFragment{} (id=0x7f0a066a)
-V  computeExpectedState() of 4 for PostListFragment{} (id=0x7f0a084f tag=search_fragment)
 V  computeExpectedState() of 4 for PostListFragment{} (id=0x7f0a066a)
+V  computeExpectedState() of 4 for PostListFragment{} (id=0x7f0a084f tag=search_fragment)
 V  computeExpectedState() of 4 for SupportRequestManagerFragment{}
 V  SpecialEffectsController: Forcing all operations to complete
 V  SpecialEffectsController: Forcing all operations to complete
@@ -974,13 +974,13 @@ V  Saving view state for fragment PostListFragment{}
 V  Saved state of PostListFragment{} (id=0x7f0a066a): null
 V  saveAllState: no fragments!
 V  Saving view state for fragment PostListFragment{}
-V  Saved state of PostListFragment{} (id=0x7f0a084f tag=search_fragment): null
+V  Saved state of PostListFragment{} (id=0x7f0a066a): null
 V  saveAllState: no fragments!
 V  Saving view state for fragment PostListFragment{}
-V  Saved state of PostListFragment{} (id=0x7f0a066a): null
+V  Saved state of PostListFragment{} (id=0x7f0a084f tag=search_fragment): null
 V  saveAllState: no fragments!
 V  Saved state of SupportRequestManagerFragment{}: null
-V  saveAllState: adding fragment (cbbc3d7f-64c7-458a-9863-07c40f670b30): PostListFragment{} (id=0x7f0a066a)
-V  saveAllState: adding fragment (548b9d9e-8525-4f26-9f55-e2b159364fca): PostListFragment{} (id=0x7f0a066a)
-V  saveAllState: adding fragment (7a80c17a-da70-421a-a66d-0c72a3ca76fc): PostListFragment{} (id=0x7f0a084f tag=search_fragment)
-V  saveAllState: adding fragment (1c4b5996-32a6-4301-aca1-305cd31f90dc): SupportRequestManagerFragment{}
+V  saveAllState: adding fragment (8f3e595e-ab7c-4fe6-bbe8-a6e13910034d): PostListFragment{} (id=0x7f0a066a)
+V  saveAllState: adding fragment (109644eb-c330-4de2-890f-ab17d7517ddf): PostListFragment{} (id=0x7f0a066a)
+V  saveAllState: adding fragment (e91e222e-a787-4b6e-9e19-5e4c359a2579): PostListFragment{} (id=0x7f0a084f tag=search_fragment)
+V  saveAllState: adding fragment (bab6a47c-91dd-479c-a0ea-1ccd1d32c737): SupportRequestManagerFragment{}

but the only differences I observed were slightly different orders of some operations. It turns out this occurs even without modifying the theme in xml, as evidently the order that FragmentManager operations occur is not "stable" or deterministic. Doing the same kind of comparison with a different run without an xml theme yields similar diff:

Without xml theme vs. Without xml theme 2
diff --git a/without-theme-truncated b/without-theme2-truncated
index 3b14446..4c2fdb7 100644
--- a/without-theme-truncated
+++ b/without-theme2-truncated
@@ -295,8 +295,8 @@ V  computeExpectedState() of 5 for PostListFragment{} (id=0x7f0a066a)
 V  computeExpectedState() of 6 for PostListFragment{} (id=0x7f0a066a)
 V  computeExpectedState() of 6 for PostListFragment{} (id=0x7f0a066a)
 V  computeExpectedState() of 5 for PostListFragment{} (id=0x7f0a066a)
-V  computeExpectedState() of 5 for PostListFragment{} (id=0x7f0a066a)
 V  computeExpectedState() of 6 for PostListFragment{} (id=0x7f0a066a)
+V  computeExpectedState() of 5 for PostListFragment{} (id=0x7f0a066a)
 V  SpecialEffectsController: For fragment PostListFragment{} (id=0x7f0a066a) mFinalState = VISIBLE -> VISIBLE. 
 V  SpecialEffectsController: For fragment PostListFragment{} (id=0x7f0a066a) mFinalState = VISIBLE -> VISIBLE. 
 V  SpecialEffectsController: For fragment PostListFragment{} (id=0x7f0a066a) mFinalState = VISIBLE -> VISIBLE. 
@@ -355,9 +355,9 @@ V  computeExpectedState() of 6 for PostListFragment{} (id=0x7f0a084f tag=search_
 V  computeExpectedState() of 7 for PostListFragment{} (id=0x7f0a066a)
 V  computeExpectedState() of 5 for PostListFragment{} (id=0x7f0a066a)
 V  computeExpectedState() of 6 for PostListFragment{} (id=0x7f0a084f tag=search_fragment)
-V  computeExpectedState() of 5 for PostListFragment{} (id=0x7f0a066a)
-V  computeExpectedState() of 6 for PostListFragment{} (id=0x7f0a084f tag=search_fragment)
 V  computeExpectedState() of 7 for PostListFragment{} (id=0x7f0a066a)
+V  computeExpectedState() of 6 for PostListFragment{} (id=0x7f0a084f tag=search_fragment)
+V  computeExpectedState() of 5 for PostListFragment{} (id=0x7f0a066a)
 V  SpecialEffectsController: For fragment PostListFragment{} (id=0x7f0a084f tag=search_fragment) mFinalState = VISIBLE -> VISIBLE. 
 V  SpecialEffectsController: For fragment PostListFragment{} (id=0x7f0a084f tag=search_fragment) mFinalState = VISIBLE -> VISIBLE. 
 V  SpecialEffectsController: Executing pending operations
@@ -396,10 +396,10 @@ V  computeExpectedState() of 7 for PostListFragment{} (id=0x7f0a066a)
 V  computeExpectedState() of 5 for PostListFragment{} (id=0x7f0a066a)
 V  computeExpectedState() of 7 for PostListFragment{} (id=0x7f0a084f tag=search_fragment)
 V  computeExpectedState() of 7 for SupportRequestManagerFragment{}
-V  computeExpectedState() of 5 for PostListFragment{} (id=0x7f0a066a)
-V  computeExpectedState() of 7 for PostListFragment{} (id=0x7f0a084f tag=search_fragment)
-V  computeExpectedState() of 7 for PostListFragment{} (id=0x7f0a066a)
 V  computeExpectedState() of 7 for SupportRequestManagerFragment{}
+V  computeExpectedState() of 7 for PostListFragment{} (id=0x7f0a066a)
+V  computeExpectedState() of 7 for PostListFragment{} (id=0x7f0a084f tag=search_fragment)
+V  computeExpectedState() of 5 for PostListFragment{} (id=0x7f0a066a)
 V  computeExpectedState() of 4 for MySiteFragment{} (id=0x7f0a0355 tag=tag-mysite)
 D  movefrom STARTED: MySiteFragment{} (id=0x7f0a0355 tag=tag-mysite)
 V  computeExpectedState() of 4 for MySiteTabFragment{} (tag=f0)
@@ -417,13 +417,13 @@ V  SpecialEffectsController: Forcing all operations to complete
 V  saveAllState: no fragments!
 V  Saving view state for fragment MySiteTabFragment{}
 V  Saved state of MySiteTabFragment{} (tag=f0): null
-V  saveAllState: adding fragment (3c841893-2c2b-4e8f-9ba7-49c255c82e1b): MySiteTabFragment{} (tag=f0)
+V  saveAllState: adding fragment (c498d23d-b73b-441d-9af6-71765b0f934a): MySiteTabFragment{} (tag=f0)
 V  Saving view state for fragment MySiteFragment{}
 V  Saved state of MySiteFragment{} (id=0x7f0a0355 tag=tag-mysite): null
 V  saveAllState: no fragments!
 V  Saved state of SupportRequestManagerFragment{}: null
-V  saveAllState: adding fragment (daf4f399-aa04-4e11-92e5-1371305fbd3a): MySiteFragment{} (id=0x7f0a0355 tag=tag-mysite)
-V  saveAllState: adding fragment (786e06ac-2173-475f-9cef-03f55c268764): SupportRequestManagerFragment{}
+V  saveAllState: adding fragment (879623ee-3f43-4ead-922d-14f7dd5d74b0): MySiteFragment{} (id=0x7f0a0355 tag=tag-mysite)
+V  saveAllState: adding fragment (3758ed9d-3c27-42f2-a1d8-87ffb4e6de38): SupportRequestManagerFragment{}
 V  computeExpectedState() of 5 for PostListFragment{} (id=0x7f0a066a)
 D  movefrom RESUMED: PostListFragment{} (id=0x7f0a066a)
 V  computeExpectedState() of 5 for PostListFragment{} (id=0x7f0a066a)
@@ -437,10 +437,10 @@ V  computeExpectedState() of 5 for SupportRequestManagerFragment{}
 D  movefrom RESUMED: SupportRequestManagerFragment{}
 V  computeExpectedState() of 5 for SupportRequestManagerFragment{}
 V  computeExpectedState() of 5 for SupportRequestManagerFragment{}
+V  computeExpectedState() of 5 for SupportRequestManagerFragment{}
 V  computeExpectedState() of 5 for PostListFragment{} (id=0x7f0a066a)
 V  computeExpectedState() of 5 for PostListFragment{} (id=0x7f0a084f tag=search_fragment)
 V  computeExpectedState() of 5 for PostListFragment{} (id=0x7f0a066a)
-V  computeExpectedState() of 5 for SupportRequestManagerFragment{}
 V  SpecialEffectsController: Forcing all operations to complete
 V  SpecialEffectsController: Forcing all operations to complete
 V  Run: BackStackEntry{}
@@ -457,7 +457,7 @@ D  moveto ATTACHED: GutenbergEditorFragment{} (id=0x7f0a060d tag=android:switche
 V  computeExpectedState() of 7 for GutenbergEditorFragment{} (id=0x7f0a060d tag=android:switcher:2131363341:0)
 D  moveto CREATED: GutenbergEditorFragment{} (id=0x7f0a060d tag=android:switcher:2131363341:0)
 D  StrictMode violation in org.wordpress.android.editor.gutenberg.GutenbergContainerFragment
-   androidx.fragment.app.strictmode.SetRetainInstanceUsageViolation: Attempting to set retain instance for fragment GutenbergContainerFragment{} (95786a23-2970-42ed-bb40-f3e74fc68315)
+   androidx.fragment.app.strictmode.SetRetainInstanceUsageViolation: Attempting to set retain instance for fragment GutenbergContainerFragment{} (4066fe64-8319-425b-9742-15a0a8fe25ac)
    	at androidx.fragment.app.strictmode.FragmentStrictMode.onSetRetainInstanceUsage(FragmentStrictMode.kt:99)
    	at androidx.fragment.app.Fragment.setRetainInstance(Fragment.java:1246)
    	at org.wordpress.android.editor.gutenberg.GutenbergEditorFragment.onCreate(GutenbergEditorFragment.java:201)
@@ -885,10 +885,10 @@ V  computeExpectedState() of 6 for GutenbergEditorFragment{} (id=0x7f0a060d tag=
 V  computeExpectedState() of 5 for EditPostSettingsFragment{} (id=0x7f0a060d tag=android:switcher:2131363341:1)
 V  computeExpectedState() of 5 for EditPostPublishSettingsFragment{} (id=0x7f0a060d tag=android:switcher:2131363341:2)
 V  computeExpectedState() of 5 for HistoryListFragment{} (id=0x7f0a060d tag=android:switcher:2131363341:3)
+V  computeExpectedState() of 5 for HistoryListFragment{} (id=0x7f0a060d tag=android:switcher:2131363341:3)
 V  computeExpectedState() of 5 for EditPostPublishSettingsFragment{} (id=0x7f0a060d tag=android:switcher:2131363341:2)
-V  computeExpectedState() of 5 for EditPostSettingsFragment{} (id=0x7f0a060d tag=android:switcher:2131363341:1)
 V  computeExpectedState() of 6 for GutenbergEditorFragment{} (id=0x7f0a060d tag=android:switcher:2131363341:0)
-V  computeExpectedState() of 5 for HistoryListFragment{} (id=0x7f0a060d tag=android:switcher:2131363341:3)
+V  computeExpectedState() of 5 for EditPostSettingsFragment{} (id=0x7f0a060d tag=android:switcher:2131363341:1)
 V  SpecialEffectsController: For fragment GutenbergEditorFragment{} (id=0x7f0a060d tag=android:switcher:2131363341:0) mFinalState = VISIBLE -> VISIBLE. 
 V  SpecialEffectsController: For fragment EditPostSettingsFragment{} (id=0x7f0a060d tag=android:switcher:2131363341:1) mFinalState = VISIBLE -> VISIBLE. 
 V  SpecialEffectsController: For fragment EditPostPublishSettingsFragment{} (id=0x7f0a060d tag=android:switcher:2131363341:2) mFinalState = VISIBLE -> VISIBLE. 
@@ -944,11 +944,11 @@ V  computeExpectedState() of 5 for EditPostSettingsFragment{} (id=0x7f0a060d tag
 V  computeExpectedState() of 5 for EditPostPublishSettingsFragment{} (id=0x7f0a060d tag=android:switcher:2131363341:2)
 V  computeExpectedState() of 5 for HistoryListFragment{} (id=0x7f0a060d tag=android:switcher:2131363341:3)
 V  computeExpectedState() of 7 for SupportRequestManagerFragment{}
-V  computeExpectedState() of 5 for EditPostPublishSettingsFragment{} (id=0x7f0a060d tag=android:switcher:2131363341:2)
-V  computeExpectedState() of 5 for EditPostSettingsFragment{} (id=0x7f0a060d tag=android:switcher:2131363341:1)
+V  computeExpectedState() of 5 for HistoryListFragment{} (id=0x7f0a060d tag=android:switcher:2131363341:3)
 V  computeExpectedState() of 7 for SupportRequestManagerFragment{}
+V  computeExpectedState() of 5 for EditPostPublishSettingsFragment{} (id=0x7f0a060d tag=android:switcher:2131363341:2)
 V  computeExpectedState() of 7 for GutenbergEditorFragment{} (id=0x7f0a060d tag=android:switcher:2131363341:0)
-V  computeExpectedState() of 5 for HistoryListFragment{} (id=0x7f0a060d tag=android:switcher:2131363341:3)
+V  computeExpectedState() of 5 for EditPostSettingsFragment{} (id=0x7f0a060d tag=android:switcher:2131363341:1)
 V  computeExpectedState() of 4 for PostListFragment{} (id=0x7f0a066a)
 D  movefrom STARTED: PostListFragment{} (id=0x7f0a066a)
 V  computeExpectedState() of 4 for PostListFragment{} (id=0x7f0a066a)
@@ -961,15 +961,17 @@ V  computeExpectedState() of 4 for PostListFragment{} (id=0x7f0a084f tag=search_
 V  computeExpectedState() of 4 for SupportRequestManagerFragment{}
 D  movefrom STARTED: SupportRequestManagerFragment{}
 V  computeExpectedState() of 4 for SupportRequestManagerFragment{}
+V  computeExpectedState() of 4 for SupportRequestManagerFragment{}
 V  computeExpectedState() of 4 for PostListFragment{} (id=0x7f0a066a)
 V  computeExpectedState() of 4 for PostListFragment{} (id=0x7f0a084f tag=search_fragment)
 V  computeExpectedState() of 4 for PostListFragment{} (id=0x7f0a066a)
-V  computeExpectedState() of 4 for SupportRequestManagerFragment{}
 V  SpecialEffectsController: Forcing all operations to complete
 V  SpecialEffectsController: Forcing all operations to complete
 V  SpecialEffectsController: Forcing all operations to complete
 V  SpecialEffectsController: Forcing all operations to complete
 V  saveAllState: no fragments!
+V  Saved state of SupportRequestManagerFragment{}: null
+V  saveAllState: no fragments!
 V  Saving view state for fragment PostListFragment{}
 V  Saved state of PostListFragment{} (id=0x7f0a066a): null
 V  saveAllState: no fragments!
@@ -978,9 +980,7 @@ V  Saved state of PostListFragment{} (id=0x7f0a084f tag=search_fragment): null
 V  saveAllState: no fragments!
 V  Saving view state for fragment PostListFragment{}
 V  Saved state of PostListFragment{} (id=0x7f0a066a): null
-V  saveAllState: no fragments!
-V  Saved state of SupportRequestManagerFragment{}: null
-V  saveAllState: adding fragment (cbbc3d7f-64c7-458a-9863-07c40f670b30): PostListFragment{} (id=0x7f0a066a)
-V  saveAllState: adding fragment (548b9d9e-8525-4f26-9f55-e2b159364fca): PostListFragment{} (id=0x7f0a066a)
-V  saveAllState: adding fragment (7a80c17a-da70-421a-a66d-0c72a3ca76fc): PostListFragment{} (id=0x7f0a084f tag=search_fragment)
-V  saveAllState: adding fragment (1c4b5996-32a6-4301-aca1-305cd31f90dc): SupportRequestManagerFragment{}
+V  saveAllState: adding fragment (167bf89d-0a79-4197-a119-89cfdaa6be21): PostListFragment{} (id=0x7f0a066a)
+V  saveAllState: adding fragment (3e90467d-7f1a-44b9-8ea7-d24f48cf3377): PostListFragment{} (id=0x7f0a066a)
+V  saveAllState: adding fragment (96035b41-441f-4937-94d5-edac2abb5b6b): PostListFragment{} (id=0x7f0a084f tag=search_fragment)
+V  saveAllState: adding fragment (8c31d851-c34e-4a2b-bf82-c882852c2ca3): SupportRequestManagerFragment{}

I'm a bit puzzled about what is changing that would result in the images disappearing. I also tried adding some logs to see whether there are differences about when the capabilities are updated:

Logging capabilities update
diff --git a/libs/editor/src/main/java/org/wordpress/android/editor/gutenberg/GutenbergEditorFragment.java b/libs/editor/src/main/java/org/wordpress/android/editor/gutenberg/GutenbergEditorFragment.java
index 8b2656c13b..239b3fe6e0 100644
--- a/libs/editor/src/main/java/org/wordpress/android/editor/gutenberg/GutenbergEditorFragment.java
+++ b/libs/editor/src/main/java/org/wordpress/android/editor/gutenberg/GutenbergEditorFragment.java
@@ -10,6 +10,7 @@ import android.os.Handler;
 import android.os.Looper;
 import android.text.Editable;
 import android.text.TextUtils;
+import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.Menu;
 import android.view.MenuInflater;
@@ -1074,10 +1075,13 @@ public class GutenbergEditorFragment extends EditorFragmentAbstract implements
     }
 
     public void updateCapabilities(GutenbergPropsBuilder gutenbergPropsBuilder) {
+        Log.d("GuEdFrag", "updateCapabilities");
         mCurrentGutenbergPropsBuilder = gutenbergPropsBuilder;
         if (isAdded()) {
+            Log.d("GuEdFrag", "isAdded was true");
             getGutenbergContainerFragment().updateCapabilities(gutenbergPropsBuilder);
         } else {
+            Log.d("GuEdFrag", "isAdded was false");
             mUpdateCapabilitiesOnCreate = true;
         }
     }
* Unmerged path libs/editor/src/main/res/layout/fragment_gutenberg_editor.xml

But this did not reveal anything different.

@geriux
Copy link
Member Author

geriux commented Aug 17, 2022

Hey @mkevins 👋 thank you for investigating the issue! your findings will be helpful when we continue this effort.

I will create a PR to disable FastImage on Android while we work on a fix for this.

Thanks again!

@dcalhoun
Copy link
Member

I was unable to reproduce this issue while testing wordpress-mobile/WordPress-Android#16968 (comment).

I tested pr16968-2b98958 with a Samsung Galaxy S20 (Android 12). I added both Image and Gallery blocks a few times, and rotated the device orientation. I am unsure if I misunderstood the reproduction case, or if my particular device and OS may have impacted the outcome.

@fluiddot
Copy link
Contributor

@mkevins based on the comments from David, I'm wondering if this issue might be related to a particular device and/or OS. It would be great if you share more details like the device and OS you used for reproducing it, thanks!

@mkevins
Copy link
Contributor

mkevins commented Aug 22, 2022

@mkevins based on the comments from David, I'm wondering if this issue might be related to a particular device and/or OS. It would be great if you share more details like the device and OS you used for reproducing it, thanks!

Good idea! I just realized I hadn't done that originally 🤦‍♂️ . I originally encountered this on a Pixel 3a (physical device) on Android 12.

@dcalhoun
Copy link
Member

dcalhoun commented Mar 7, 2023

Leaving a note that I experienced disappearing images on iOS (iPhone SE, iOS 16.4) while testing the Gallery block.

I had my network throttled so that I could cancel/retry/resume image uploads. Rotating the device in certain circumstances would cause images to become invisible — the gallery layout presented as though an image where there, but it was empty space. It makes me wonder if certain upload states can exasperate the issue.

@jordesign jordesign added the [Type] Bug An existing feature does not function as intended label Sep 4, 2023
@geriux geriux removed the [Priority] High Used to indicate top priority items that need quick attention label Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

5 participants