Wordpress-ios: Editor is slow to refresh (and sometimes crashes) when returning to the app

Created on 14 Jun 2016  Â·  7Comments  Â·  Source: wordpress-mobile/WordPress-iOS

Expected behavior

I expect the app to quickly resume where I left off when I leave the app and come back to it.

Actual behavior

In some cases, the app is very slow to load when I come back to it — this happens most often when I was using the editor before I left the app, and the editor view is slow to refresh.

Steps to reproduce the behavior

  1. Start a new post in the app
  2. Go to iOS Settings > WP Internal
  3. Toggle the Photos, Microphone, and/or Camera settings on or off
  4. Go back to the app

Result: Every time I do this, there is a noticeable period of time where the screen is frozen with the status bar showing at the top of the screen. The app then sometimes crashes, or the view refreshes and I can use the editor again.

This is most noticeable/troubling if you add content to the editor first:

  1. Start a new post in the app
  2. Add a title and content to the editor
  3. Go to iOS Settings > WP Internal
  4. Toggle the Photos, Microphone, and/or Camera settings on or off
  5. Go back to the app

Result: When you return to the app, the editor is blank and frozen (same as above, so the content you added doesn't appear immediately). The content only reappears after the view refreshes (assuming it doesn’t crash) with an alert about unsaved changes.

Screenshots

2016-06-13 14 52 20

2016-06-13 16 13 03

Tested on iPhone 6, iOS 9.3.2, WPiOS 6.3.0.20160608
PostinEditing [Type] Bug [Type] Crash

All 7 comments

Adding some information that I found online. It seems that when changing permissions, the affected apps are effectively restarted (after saving their state). When you go back to the app the state is restored, as if the app had been manually closed. (see this stackoverflow answer).

This may explain the freeze we're seeing, considering the whole app is starting up there. It doesn't explain the crashes though.

In any case I think we could split the discussion and start focusing on the crashes, which feel more important.

@rachelmcr - Do you think you can come up with a large post that can reproduce the crash you were seeing? I wasn't able to reproduce the crash on my end so far.

I am now able to reproduce this crash with only 5 images in a post. However, I first tried with about 20 images and a video, which crashed, and I'm not sure if that initial crash has an impact on subsequent posts I create and test with.

I added the images from my media library, changed the microphone setting in iOS settings, and the app crashed when I returned to it.

The app also crashed on the loading screen the second time I tried to open it after that, and opened successfully to the My Sites screen on the third try.

@rachelmcr - I just had an interesting chat about how Optimizely does a synchronized network request on startup. What this means is that it's quite possible that the freeze we're seeing is related to that issue since the network request blocks the app until the reply returns.

I'll keep an eye on it.

@aerych - Could Optimizely be causing this issue?

@diegoreymendez, Optimizely was removed. We never shipped an app store build that contained it. If the issue is still occurring its due to something else but if we can't repro now, yah, maybe Optimizely was to blame.

@aerych - Thanks! From the version number it seems to be an internal release.

@rachelmcr - Could you confirm if this is still an issue in the latest internal?

I haven't been able to repro this issue since we removed Optimizely, so it seems very likely that was the cause. I think it's safe to close this issue as resolved now.

Was this page helpful?
0 / 5 - 0 ratings