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

Fix crashes #8410

Merged
merged 4 commits into from May 11, 2023
Merged

Fix crashes #8410

merged 4 commits into from May 11, 2023

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented May 9, 2023

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

Content

repeatOnLifecycle was not used properly. This PR does some cleanup.

Reviewer: please ignore spaces when comparing.

Motivation and context

Fixes #8409

Screenshots / GIFs

Tests

  • I have manaully tested the impacted code without any issue.

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

@bmarty bmarty added the Z-NextRelease For issues and PRs which should be included in the NextRelease. label May 9, 2023
@bmarty bmarty requested review from a team and Florian14 and removed request for a team May 9, 2023 13:02
if (positionOfReadMarker == null) {
false
withResumed {
viewLifecycleOwner.lifecycleScope.launch {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it expected to have this line twice?

Copy link
Contributor

Choose a reason for hiding this comment

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

it seems since this is done at several places

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, we are not in a coroutine scope in the withResumed block.

@sonarcloud
Copy link

sonarcloud bot commented May 9, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@@ -81,9 +79,7 @@ class LocationPreviewFragment :
views.mapView.onCreate(savedInstanceState)

viewLifecycleOwner.lifecycleScope.launch {
viewLifecycleOwner.repeatOnLifecycle(Lifecycle.State.CREATED) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know if this code was here for a certain reason, but I agree that it does not seem necessary since we're in the onViewCreated method

Copy link
Contributor

@Florian14 Florian14 left a comment

Choose a reason for hiding this comment

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

Changes LGTM, not tested

@bmarty bmarty merged commit f9f341e into develop May 11, 2023
16 of 17 checks passed
@bmarty bmarty deleted the feature/bma/fixCrashes branch May 11, 2023 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Z-NextRelease For issues and PRs which should be included in the NextRelease.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash when entering the "Protect access" screen.
2 participants