WordPress-iOS icon indicating copy to clipboard operation
WordPress-iOS copied to clipboard

Fix MediaRequestAuthenticator Core Data threading issue

Open kean opened this issue 1 year ago • 2 comments

Fixes an issue discovered when testing private Atomic sites.

There is a threading violation in this line that's being called from the background.

try? WPAccount.lookupDefaultWordPressComAccount(in: ContextManager.shared.mainContext)

I moved it to the main thread as a quick fix, but it really needs to be redesigned together with how session dependencies are managed in the app.

To test:

  • Open a private Atomic site
  • Open Media
  • Verify that Xcode doesn't report any Core Data threading violations

Regression Notes

  1. Potential unintended areas of impact

  2. What I did to test those areas of impact (or what existing automated tests I relied on)

  3. What automated tests I added (or what prevented me from doing so)

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)

kean avatar May 10 '24 14:05 kean

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 Numberpr23189-78189d1
Version24.8
Bundle IDcom.jetpack.alpha
Commit78189d13c01a288b835ed370c2e9b539be6313fb
App Center Buildjetpack-installable-builds #8920
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

wpmobilebot avatar May 10 '24 14:05 wpmobilebot

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 Numberpr23189-78189d1
Version24.8
Bundle IDorg.wordpress.alpha
Commit78189d13c01a288b835ed370c2e9b539be6313fb
App Center BuildWPiOS - One-Offs #9872
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

wpmobilebot avatar May 10 '24 14:05 wpmobilebot