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

Player UI list to kotlin #11829

Open
wants to merge 3 commits into
base: refactor
Choose a base branch
from

Conversation

Profpatsch
Copy link
Contributor

@Profpatsch Profpatsch commented Dec 26, 2024

Small helper module

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

  • record videos
  • create clones
  • take over the world

Before/After Screenshots/Screen Record

  • Before:
  • After:

Fixes the following issue(s)

  • Fixes #

Relies on the following changes

APK testing

The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR. You can find more info and a video demonstration on this wiki page.

Due diligence

@github-actions github-actions bot added the size/medium PRs with less than 250 changed lines label Dec 26, 2024
And simplify the code a little
@Profpatsch Profpatsch force-pushed the PlayerUIList-to-kotlin branch from 9030ef5 to 2e23e77 Compare December 26, 2024 11:39
In Kotlin, dealing with nulls works better so we don’t need optional.
@Profpatsch Profpatsch force-pushed the PlayerUIList-to-kotlin branch from 2e23e77 to 5b92de4 Compare December 26, 2024 11:50
@ShareASmile ShareASmile added codequality Improvements to the codebase to improve the code quality rewrite Issues and PRs related to rewrite labels Dec 26, 2024
@github-actions github-actions bot added size/large PRs with less than 750 changed lines and removed size/medium PRs with less than 250 changed lines labels Dec 26, 2024
@Profpatsch Profpatsch force-pushed the PlayerUIList-to-kotlin branch from 15d5174 to 15eca50 Compare December 26, 2024 14:46
@Profpatsch
Copy link
Contributor Author

Okay I noticed a funny thing where threads would compete for modifying our UI list, so I added a Mutex around it.

@Profpatsch Profpatsch force-pushed the PlayerUIList-to-kotlin branch 3 times, most recently from e8409e1 to 2f32929 Compare December 26, 2024 14:53
The new implementation would throw `ConcurrentModificationExceptions`
when destroying the UIs. So let’s play it safe and put the list behind
a mutex.

Adds a helper class `GuardedByMutex` that can be wrapped around a
property to force all use-sites to acquire the lock before doing
anything with the data.
@Profpatsch Profpatsch force-pushed the PlayerUIList-to-kotlin branch from 2f32929 to cbade0b Compare December 26, 2024 14:53
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
B Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
codequality Improvements to the codebase to improve the code quality rewrite Issues and PRs related to rewrite size/large PRs with less than 750 changed lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants