capacitor-community / safe-area

Capacitor Plugin that exposes the safe area insets from the native iOS/Android device to your web project.
MIT License
57 stars 16 forks source link

Infinite android logs #35

Open ahmafi opened 1 week ago

ahmafi commented 1 week ago

Hi, after enabling this plugin I'm getting infinite logs in android LogCat which looks like the screenshot below. Is this normal?

image

tafelnl commented 5 days ago

Which version are you on?

ahmafi commented 5 days ago
"@capacitor-community/safe-area": "6.0.0-alpha.7"
"@capacitor/core": "5.3.0"
"react": "18.2.0"
frederikheld commented 5 days ago

Might be related to #25

ahmafi commented 4 days ago

The callback of setOnApplyWindowInsetsListener is getting called non-stop.

image

NaterGator commented 1 day ago

This behavior is triggered by this call.... there's no public API to query if decorFitsSystemWindows has been set so maybe we set once and leave it?

image

Edit: I can confirm protecting that call with an nonce breaks this feedback loop. Also drops my app's idle CPU usage from ~22% to 0%, so this is a pretty critical bug to fix.

frederikheld commented 9 hours ago

drops my app's idle CPU usage from ~22% to 0%

This would explain why my phone gets way too warm while the app is running. I always suspected the geo map to be too heavy to handle.

@NaterGator You seem to have found a fix. Could you please make a PR out of this so it get's fixed soon?

NaterGator commented 5 hours ago

@NaterGator You seem to have found a fix. Could you please make a PR out of this so it get's fixed soon?

Sure. @tafelnl #36 is ready for your review.