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

Overhaul Client State Handling #3050

Merged
merged 11 commits into from
Nov 30, 2023
Merged

Overhaul Client State Handling #3050

merged 11 commits into from
Nov 30, 2023

Conversation

Sheikah45
Copy link
Member

@Sheikah45 Sheikah45 commented Nov 18, 2023

Currently the client maintains most state in the various UI controllers. This results in the view elements needing to be cached so as to not lose state. This is suboptimal because it has lead to memory leaks where some ui elements cannot be garbage collected even when they are removed from the scene.

Additionally there is no cleanup of elements and their listeners when they are removed from the UI which also contributes to memory leaks.

This PR aims to overhaul the state maintenance of the client such that views are just displays and can be created and discarded at will.

Tasks

  • Remove Google Event Bus (Deprecated Global Event Bus)
  • Don't force chat controller to be initialized
  • Remove controller caching
  • Remove controller memory leaks
  • Introduce simple controller initialization and cleanup
  • Cleanup circular dependencies
  • Make UI population lazy

Closes #2994
Closes #3016
Closes #3018

@Sheikah45 Sheikah45 force-pushed the maintenance/state-overhaul branch from 2a75335 to 9c9a89f Compare November 18, 2023 18:41
Copy link

codecov bot commented Nov 18, 2023

Codecov Report

Merging #3050 (f9cceb2) into develop (7e39b73) will decrease coverage by 0.16%.
The diff coverage is 62.59%.

Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #3050      +/-   ##
=============================================
- Coverage      58.88%   58.72%   -0.16%     
+ Complexity      4461     4459       -2     
=============================================
  Files            558      560       +2     
  Lines          20201    20458     +257     
  Branches        1035     1036       +1     
=============================================
+ Hits           11895    12014     +119     
- Misses          7757     7900     +143     
+ Partials         549      544       -5     
Files Coverage Δ
...client/achievements/AchievementItemController.java 100.00% <ø> (ø)
.../main/java/com/faforever/client/api/IceServer.java 100.00% <100.00%> (ø)
.../java/com/faforever/client/audio/AudioService.java 100.00% <100.00%> (ø)
...ava/com/faforever/client/avatar/AvatarService.java 100.00% <100.00%> (+18.18%) ⬆️
...orever/client/chat/ChatCategoryItemController.java 65.51% <100.00%> (-0.59%) ⬇️
...ava/com/faforever/client/chat/ChatChannelUser.java 93.93% <100.00%> (+4.75%) ⬆️
...om/faforever/client/chat/TrustEveryoneFactory.java 25.00% <ø> (ø)
...r/client/chat/UserListCustomizationController.java 100.00% <ø> (ø)
...ever/client/chat/emoticons/EmoticonController.java 100.00% <ø> (ø)
...lient/chat/emoticons/EmoticonsGroupController.java 100.00% <ø> (ø)
... and 193 more

... and 20 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7e39b73...f9cceb2. Read the comment docs.

@Sheikah45 Sheikah45 force-pushed the maintenance/state-overhaul branch from de871a9 to 918098f Compare November 30, 2023 00:39
@Sheikah45 Sheikah45 merged commit 395201e into develop Nov 30, 2023
4 of 5 checks passed
@Sheikah45 Sheikah45 deleted the maintenance/state-overhaul branch November 30, 2023 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant