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

Switching custom overlays don't update the rendering #655

Closed
RubenKelevra opened this issue Sep 16, 2024 · 9 comments · May be fixed by #566
Closed

Switching custom overlays don't update the rendering #655

RubenKelevra opened this issue Sep 16, 2024 · 9 comments · May be fixed by #566
Labels
bug Something isn't working

Comments

@RubenKelevra
Copy link

Switching between custom overlays doesn't update the rendering of them, and they will show still the rendering before.

Hacky workaround: click on a standard overlay while switching updates them properly.

Screenshot

InShot_20240916_212447120.mp4

How to Reproduce

  • create two different custom overlays
  • switch between them
  • observe bug

Expected Behavior

  • rendering should work fine

Does it happen in normal StreetComplete?
No, because there are no custom overlays

Versions affected
Android 12
SCEE 58.22

@RubenKelevra RubenKelevra added the bug Something isn't working label Sep 16, 2024
@rusty-snake
Copy link

Hacky workaround

Triple tap, much faster.

@RubenKelevra
Copy link
Author

Yeah I noticed that too. But I think it was more interesting, that the switching between regular and custom overlays have different effect than between custom ones.

@mnalis
Copy link
Collaborator

mnalis commented Sep 17, 2024

I can confirm the bug on SCEE 59.0-beta1 too. Few notes:

  • using regular overlay selector (instead of quick overlay) do not have any effect (i.e. bug still appears)
  • turning overlay off before switching to other custom overlay avoids the bug
  • Download data here also fixes the display
  • panning (by significant [non-cached?] amount) or zooming also fixes the display
  • Settings / Quests / Create quests dynamically does not seem to have any effect (i.e. bug still appears)

@tiptoptom
Copy link

See #566 (comment)

@mnalis
Copy link
Collaborator

mnalis commented Dec 30, 2024

@RubenKelevra (and everybody else) Is this still a problem for you in SCEE 60.0?
It seems to be working fine for me now (on Android 14):

Video (click to expand)
small_Screen_Recording_20241230_025133_SCEE.mp4

@rusty-snake
Copy link

Testing this moved me to a crash loop again, yeah.

Details

type: crash
osVersion: google/oriole/oriole:15/AP4A.241205.013/2024121200:user/release-keys
package: de.westnordost.streetcomplete.expert:6003, targetSdk 34
process: de.westnordost.streetcomplete.expert
processUptime: 875 + 206 ms
installer: dev.imranr.obtainium

java.lang.NumberFormatException: Expected a hexadecimal digit at index 0, but was -
	at kotlin.text.HexExtensionsKt.throwInvalidDigitAt(HexExtensions.kt:1247)
	at kotlin.text.HexExtensionsKt.parseByteAt(HexExtensions.kt:1213)
	at kotlin.text.HexExtensionsKt.hexToByteArrayShortByteSeparatorNoPrefixAndSuffix(HexExtensions.kt:444)
	at kotlin.text.HexExtensionsKt.hexToByteArrayNoLineAndGroupSeparator(HexExtensions.kt:421)
	at kotlin.text.HexExtensionsKt.hexToByteArray(HexExtensions.kt:407)
	at kotlin.text.HexExtensionsKt.hexToByteArray(HexExtensions.kt:367)
	at de.westnordost.streetcomplete.util.ktx.ColorKt.toRGB(Color.kt:48)
	at de.westnordost.streetcomplete.screens.main.map.components.StyleableOverlayMapComponent.getDarkenedColor(StyleableOverlayMapComponent.kt:385)
	at de.westnordost.streetcomplete.screens.main.map.components.StyleableOverlayMapComponent.toFeatures(StyleableOverlayMapComponent.kt:334)
	at de.westnordost.streetcomplete.screens.main.map.components.StyleableOverlayMapComponent.set(StyleableOverlayMapComponent.kt:226)
	at de.westnordost.streetcomplete.screens.main.map.components.StyleableOverlayMapComponent$set$1.invokeSuspend(StyleableOverlayMapComponent.kt:0)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:101)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:589)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:832)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:720)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:707)
	Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@ae81b19, Dispatchers.Default]

@Helium314
Copy link
Owner

Testing this moved me to a crash loop again, yeah.

Weird thing: this bug must have existed since implementing the "randomized" (hash-based) colors for custom overlays. Apparently it's really rare that a string's hashcode is negative.

Helium314 added a commit that referenced this issue Dec 30, 2024
@rusty-snake
Copy link

Ok, somehow managed it out of it.

Switching custom overlays works.

@mnalis
Copy link
Collaborator

mnalis commented Dec 30, 2024

Switching custom overlays works.

Great, so I'll close this as fixed!

@mnalis mnalis closed this as completed Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants