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

Offline Mode: Integrate "Media Uploads" with a sync engine for drafts #23103

Merged
merged 2 commits into from
May 7, 2024

Conversation

kean
Copy link
Contributor

@kean kean commented Apr 26, 2024

There needed to be a way to somehow inform the user why the sync fails in case of a terminal error with media uploads.

  • Integrate PostMediaUploadsView with draft sync engine
  • Perform sync retries on terminal error but with longer delay (otherwise there is no retry mechanism)

To test:

  • Mock one of the terminal media failures (e.g. change var maxUploadSize: NSNumber?)
  • Follow the steps from the video:
Screen.Recording.2024-04-26.at.11.18.36.AM.mov

Regression Notes

  1. Potential unintended areas of impact: Post Media
  2. What I did to test those areas of impact (or what existing automated tests I relied on): manual
  3. What automated tests I added (or what prevented me from doing so): n/a

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding unit tests for my changes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

Testing checklist:

  • WordPress.com sites and self-hosted Jetpack sites.
  • Portrait and landscape orientations.
  • Light and dark modes.
  • Fonts: Larger, smaller and bold text.
  • High contrast.
  • VoiceOver.
  • Languages with large words or with letters/accents not frequently used in English.
  • Right-to-left languages. (Even if translation isn’t complete, formatting should still respect the right-to-left layout)
  • iPhone and iPad.
  • Multi-tasking: Split view and Slide over. (iPad)

worker.setLongerDelay()
}

let delay = worker.nextRetryDelay
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's safer to retry (but with a longer delay) than to never retry again.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It also helps if you have a draft post where sync is failing due to the media uploads and you go to "Context Menu / Publish / Media Uploads" and remove the upload for there – it doesn't trigger re-sync (now that I wrote it maybe it also should?)

@kean kean changed the title Task/offline mode integrate uploads view in more places Offline Mode: Integrate "Media Uploads" with a sync engine for drafts Apr 26, 2024
@kean kean requested a review from momo-ozawa April 26, 2024 15:21
@wpmobilebot
Copy link
Contributor

wpmobilebot commented Apr 26, 2024

Jetpack Alpha📲 You can test the changes from this Pull Request in Jetpack Alpha by scanning the QR code below to install the corresponding build.
App NameJetpack Alpha Jetpack Alpha
ConfigurationRelease-Alpha
Build Numberpr23103-d70876e
Version24.8
Bundle IDcom.jetpack.alpha
Commitd70876e
App Center Buildjetpack-installable-builds #8846
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Apr 26, 2024

WordPress Alpha📲 You can test the changes from this Pull Request in WordPress Alpha by scanning the QR code below to install the corresponding build.
App NameWordPress Alpha WordPress Alpha
ConfigurationRelease-Alpha
Build Numberpr23103-d70876e
Version24.8
Bundle IDorg.wordpress.alpha
Commitd70876e
App Center BuildWPiOS - One-Offs #9800
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@dvdchr dvdchr modified the milestones: 24.8, 24.9 Apr 29, 2024
@dvdchr
Copy link
Contributor

dvdchr commented Apr 29, 2024

Hi @kean 👋 , I'm bumping this PR's milestone to 24.9 since I'm starting code freeze. Feel free to re-target this to the release branch if this is a blocker or intended for 24.8.

Copy link
Contributor

@momo-ozawa momo-ozawa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bit unexpected for the warning icon to still be there after I take an action to cancel the upload. What do you think of showing a spinner?

@kean kean modified the milestones: 24.9, 24.8 ❄️ Apr 29, 2024
@kean kean force-pushed the task/offline-mode-add-remove-upload-feature branch from 1541b73 to 4dba16a Compare April 29, 2024 14:52
@kean
Copy link
Contributor Author

kean commented Apr 29, 2024

I'm going to move the target back to 24.9 – it's not needed for the current release, and there are some enhancements still needed.

Base automatically changed from task/offline-mode-add-remove-upload-feature to release/24.8 April 29, 2024 15:46
@dvdchr dvdchr modified the milestones: 24.8 ❄️, 24.9 Apr 29, 2024
@kean kean force-pushed the task/offline-mode-integrate-uploads-view-in-more-places branch from 998a240 to d70876e Compare May 4, 2024 17:31
@kean kean requested a review from a team as a code owner May 4, 2024 17:31
@kean kean changed the base branch from release/24.8 to trunk May 4, 2024 17:31
@kean
Copy link
Contributor Author

kean commented May 4, 2024

It's a bit unexpected for the warning icon to still be there after I take an action to cancel the upload. What do you think of showing a spinner?

I agree, and I think it's not the only scenario where the spinner is missing.

I changes the PostCoordinator code to always show it and to also do nothing if the worker doesn't exist or doesn't have an error:

if let worker = workers[post.objectID], worker.error != nil {

@kean kean requested a review from momo-ozawa May 4, 2024 17:33
@kean kean merged commit 1325dba into trunk May 7, 2024
24 of 25 checks passed
@kean kean deleted the task/offline-mode-integrate-uploads-view-in-more-places branch May 7, 2024 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants