Bug 477420 - Occasional duplicate received posts when there is a picture/video in it.
Summary: Occasional duplicate received posts when there is a picture/video in it.
Status: RESOLVED FIXED
Alias: None
Product: Tokodon
Classification: Applications
Component: general (other bugs)
Version First Reported In: 23.08.3
Platform: Ubuntu Other
: NOR minor
Target Milestone: ---
Assignee: Unassigned bugs
URL:
Keywords: wayland-only
Depends on:
Blocks:
 
Reported: 2023-11-23 14:05 UTC by Kevin Frost
Modified: 2025-01-20 01:07 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 25.04
Sentry Crash Report:


Attachments
Tokodon duplicate posts (1.04 MB, video/mp4)
2023-11-23 15:24 UTC, Kevin Frost
Details
Duplicate pictures (621.89 KB, image/png)
2024-11-28 11:50 UTC, Kevin Frost
Details
attachment-3371063-0.html (1.26 KB, text/html)
2024-11-28 13:33 UTC, Kevin Frost
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Frost 2023-11-23 14:05:30 UTC
SUMMARY
***
Occasionally, my Tokodon feed seems to have duplicate posts when there is a picture or video present in the post. It's only happening on Tokodon, if I look at the same feed via another client or web page, they only show one post. It happens about 40% of the time.
This is using the feed from mastodonapp.uk site.
***


STEPS TO REPRODUCE
1.  Open Tokodon
2.  Wait for the auto scroll of the posts on the feed

OBSERVED RESULT

Sometimes a post will appear with a duplicate post just above it. There doesn't seem to be any difference in the posts.

EXPECTED RESULT

Only one post visible.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.27.8
KDE Frameworks Version: 5.110.0
Qt Version: 5.15.10

The problem occurs under both Wayland and X11 on Kubuntu 23.10 (fully updated as of 23 November 2023).

ADDITIONAL INFORMATION
Comment 1 Kevin Frost 2023-11-23 15:24:52 UTC
Created attachment 163396 [details]
Tokodon duplicate posts

Although this recording was done on X11, the problem occurs on both X11 and Wayland.
Comment 2 Kevin Frost 2023-11-23 15:28:47 UTC
Comment on attachment 163396 [details]
Tokodon duplicate posts

furthermore, logging out and back in again clears the duplicate video.
Comment 3 Joshua Goins 2024-11-27 21:18:41 UTC
I still can't reproduce this, and I use Tokodon a lot and have media on my feed. Can you see if this happens in the latest version (24.08)? Thanks!
Comment 4 Kevin Frost 2024-11-28 11:50:18 UTC
Created attachment 176183 [details]
Duplicate pictures

I have been monitoring using two different apps plus the Mastondonapp.uk website and the duplication only exists on Tokodon 24.08.3.
Is there anyway of I can help debug this Flatpak version?
Comment 5 Joshua Goins 2024-11-28 13:32:00 UTC
Oh, so this is when the post is "streamed in" while you have the timeline open?
Comment 6 Kevin Frost 2024-11-28 13:33:25 UTC
Created attachment 176186 [details]
attachment-3371063-0.html

Yes it is.

On 28/11/2024 13:32, Joshua Goins wrote:
> https://bugs.kde.org/show_bug.cgi?id=477420
>
> Joshua Goins<josh@redstrate.com> changed:
>
>             What    |Removed                     |Added
> ----------------------------------------------------------------------------
>               Status|NEEDSINFO                   |CONFIRMED
>           Resolution|WAITINGFORINFO              |---
>
> --- Comment #5 from Joshua Goins<josh@redstrate.com> ---
> Oh, so this is when the post is "streamed in" while you have the timeline open?
>
Comment 7 Joshua Goins 2024-11-28 14:48:26 UTC
Awesome! I'm going to look into revamping the streaming soon, and will be on the lookout for this bug
Comment 8 Bug Janitor Service 2025-01-20 00:34:10 UTC
A possibly relevant merge request was started @ https://invent.kde.org/network/tokodon/-/merge_requests/693
Comment 9 Joshua Goins 2025-01-20 01:07:22 UTC
Git commit 8ec7279b9771cf1aa5701704e7795cc3c7d41b17 by Joshua Goins.
Committed on 20/01/2025 at 01:01.
Pushed by redstrate into branch 'master'.

Improve refreshing the main timeline, other misc fixes

Currently refreshing the main timeline involves throwing everything away
and starting fresh, but we don't need to do that. Now we use the
pagination to load all newer posts, and we're a bit smarter about it
too.

An additional bug that I think I fixed is receiving duplicate posts. Now
fetchedTimeline and handleEvent shouldn't add posts we have already.

A bug that I ran into but not sure if it's ever resulted in a crash is
not checking if posts is empty before calling first() on it, but good to
fix anyway.
Related: bug 495996

M  +1    -1    src/autotests/data/status-poll.json
M  +10   -4    src/autotests/timelinetest.cpp
M  +30   -11   src/timeline/maintimelinemodel.cpp
M  +15   -0    src/timeline/timelinemodel.cpp

https://invent.kde.org/network/tokodon/-/commit/8ec7279b9771cf1aa5701704e7795cc3c7d41b17