openhab-android icon indicating copy to clipboard operation
openhab-android copied to clipboard

Fix icons sometimes not being loaded correctly

Open maniac103 opened this issue 5 months ago • 1 comments

When scrolling through a widget list, an icon WidgetImageView sometimes goes through a lifecycle like this 1 onAttachedToWindow 2 onLayout 3 onDetachedFromWindow 4 onAttachedToWindow 5 onLayout

If step 2 saw a pending load job and launched a coroutine to execute it, it could happen that step 3 canceled the coroutine scope before the coroutine was executed. Make sure not to forget about the pending request, so it's reexecuted in step 5.

maniac103 avatar May 31 '25 11:05 maniac103

Looks like this still doesn't suffice. Icon loading is better with it, but still I sometimes get permanent loading indication (skeleton). I'll investigate more.

maniac103 avatar Jun 01 '25 06:06 maniac103

I'll investigate more.

Do you want to get this merged anyway?

mueller-ma avatar Jul 02 '25 16:07 mueller-ma

It probably makes sense, yes. It's certainly better now, and I also believe the change itself is correct.

maniac103 avatar Jul 02 '25 19:07 maniac103

Is this the same as https://github.com/openhab/openhab-android/issues/3747 for sitemaps?

dilyanpalauzov avatar Jul 20 '25 09:07 dilyanpalauzov

Can cancelling the coroutine⇔HTTP request in OH-Android lead to this error on the server: https://github.com/openhab/openhab-core/issues/4792? I do see it pretty often.

dilyanpalauzov avatar Jul 20 '25 10:07 dilyanpalauzov

Maybe. You can check it in version 3.17.12-beta.

mueller-ma avatar Jul 21 '25 15:07 mueller-ma