Skip to content

Fix retain cycles in Login-related classes#21092

Merged
staskus merged 7 commits intotrunkfrom
fix/21075-memory-not-deallocated-after-logging-in
Jul 17, 2023
Merged

Fix retain cycles in Login-related classes#21092
staskus merged 7 commits intotrunkfrom
fix/21075-memory-not-deallocated-after-logging-in

Conversation

@staskus
Copy link
Copy Markdown
Contributor

@staskus staskus commented Jul 13, 2023

Fixes #21075

Fix retain cycles in Login-related classes. The majority of changes are made in WordPress-Authenticator updates. We can merge those and then we can confirm that there're no more memory leaks after logging in in the JP-iOS app.

To test:

Memory deallocation

  1. Launch WordPress/Jetpack
  2. Login
  3. Open Memory Debugger
  4. Confirm there're no login-related objects allocated (Note: JetpackPrologueViewController will still be allocated because it's assigned to WordPressAuthenticatorStyle, I didn't want to change authenticator architecture)

Regression Notes

  1. Potential unintended areas of impact

Breaking login flows

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

UI tests, manual testing

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

Added in the scope of WordPress-Authenticator changes

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.

staskus added 3 commits July 13, 2023 10:43
…Controller

Problem:
- LoginNavigationController holds LoginEpilogueViewController and SignUpViewController
- LoginEpilogueViewController and SignUpViewController captures LoginNavigationController strongly in the closure

Solution:
- Weak capture LoginNavigationController
@wpmobilebot
Copy link
Copy Markdown
Contributor

wpmobilebot commented Jul 13, 2023

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 Numberpr21092-d065812
Version22.8
Bundle IDorg.wordpress.alpha
Commitd065812
App Center BuildWPiOS - One-Offs #6366
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@wpmobilebot
Copy link
Copy Markdown
Contributor

wpmobilebot commented Jul 13, 2023

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 Numberpr21092-d065812
Version22.8
Bundle IDcom.jetpack.alpha
Commitd065812
App Center Buildjetpack-installable-builds #5391
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@staskus
Copy link
Copy Markdown
Contributor Author

staskus commented Jul 13, 2023

No further changes are necessary here besides integrating WordPress-Authenticator, updating release notes, and possibly adding a unit test to confirm the deallocation.

@staskus staskus requested a review from guarani July 13, 2023 19:28
@staskus
Copy link
Copy Markdown
Contributor Author

staskus commented Jul 14, 2023

I see some similar issues are also being fixed #21064 so there might be some duplications, either way it proves this is problematic

Copy link
Copy Markdown
Contributor

@guarani guarani left a comment

Choose a reason for hiding this comment

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

Changes look good, tested login and sign-up on JP and WP.

@staskus staskus marked this pull request as ready for review July 17, 2023 08:14
@staskus staskus enabled auto-merge July 17, 2023 08:19
@staskus staskus merged commit 8a8aac5 into trunk Jul 17, 2023
@staskus staskus deleted the fix/21075-memory-not-deallocated-after-logging-in branch July 17, 2023 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Memory not deallocated after logging in

3 participants