Wordpress-ios: Media upload is retried multiple times in sequence

Created on 4 Sep 2019  ·  5Comments  ·  Source: wordpress-mobile/WordPress-iOS

I'm not exactly sure of the severity of this since I haven't dug deeper yet.

Expected behavior

Media uploads are retried only once.

Actual behavior

Media uploads are retried multiple times.

Steps to reproduce the behavior

Here is a video which shows that multiple network requests are triggered for one media.

  1. Best to start by removing the app from the simulator first.
  2. Add a breakpoint in:

    https://github.com/wordpress-mobile/WordPress-iOS/blob/38b278b207fdeb2f409e378b25417dbf474d0c77/WordPress/Classes/Services/MediaService.m#L279-L282

  3. Run in Xcode. I used develop (38b278b207).

  4. Go offline.
  5. Create a draft.
  6. Add an image to the draft. Wait until the “failed” error is shown.
  7. Tap on X on the top left and save the draft.
  8. While in the Post List, go online. The auto-uploader should be triggered. Confirm that the breakpoint is called more than once.

I tried adding 2 images and the breakpoint was hit about 5 times. So it gets progressively worse.

Tested on iPhone XS Simulator, iOS 12.4, develop (38b278b207).

Media Offline Support [Type] Bug

All 5 comments

My guess (without looking into the coe) is that this is causes by both PostCoordinator and MediaCoordinator trying to upload them — PostCoordinator sees a post with failed Media, so it tries to upload it, but at the same time, the MediaCoordinator tried to do the same.

@leandroalonso , is this fixed with https://github.com/wordpress-mobile/WordPress-iOS/pull/12416 ?

@yaelirub I'm not able to reproduce it anymore in develop.

@shiki Do you want to double-check or can we just close this issue?

I'll look into it.

Seems to be fixed in develop (1cac04f61f). 😌

Was this page helpful?
0 / 5 - 0 ratings