Tusky icon indicating copy to clipboard operation
Tusky copied to clipboard

Timeline position reset when using notifications

Open Lakoja opened this issue 11 months ago • 5 comments

Detailed description

I post this because it is (always) reproducible for me, but maybe it also fixes other problems like some of the triggers posted in https://github.com/tuskyapp/Tusky/issues/3960

Steps to reproduce the problem

  1. Scroll to some position in the home timeline
  2. Get a notification
  3. Tap that notification which switches to the notification view (and reloads that)
  4. Switch to the home timeline

This reloads (refreshes completely?) the home timeline and leaves you at a random looking location.

It does not happen when the system notification is not tapped (but i. e. you switch to notifications yourself and reload them).

When doing this multiple times the new location is every time another one. Would be quite funny if it weren't a bug.

Push notifications help with step 2.

Debug information

Current develop Android 14

Lakoja avatar Jan 26 '25 08:01 Lakoja

That probably happens because MainActivity is restarted for each notification.

connyduck avatar Jan 26 '25 09:01 connyduck

When?

It does not occur (restart) if you are staying inside Tusky (not tap the system notification).

Lakoja avatar Jan 26 '25 10:01 Lakoja

When you click the notification, it opens a new instance of MainActivity. I think. That would explain that the timeline position is lost.

connyduck avatar Jan 26 '25 10:01 connyduck

When you click the notification, it opens a new instance of MainActivity. I think. That would explain that the timeline position is lost.

That would explain a lot of problem then, I guess. "Losing position on a new instance of MainActivity." Which happens rather frequently I guess. But why would it start at "some random looking position" and not the top?

Lakoja avatar Jan 26 '25 10:01 Lakoja

I think it starts at the top of the cached timeline, and then loads new stuff above. Depending on the circumstances that may look random. But I'm not sure.

connyduck avatar Jan 26 '25 10:01 connyduck