element-web icon indicating copy to clipboard operation
element-web copied to clipboard

Clicking on the jump to unreads button throws a `Failed to load timeline position` error and dumps me in a blank timeline

Open MadLittleMods opened this issue 3 years ago • 16 comments

Clicking on the jump to unreads button throws a Failed to load timeline position error and dumps me in a blank timeline

Related to:

  • https://github.com/vector-im/element-web/issues/20397
  • https://github.com/vector-im/element-web/issues/4257

Steps to reproduce

  1. Visit a room

  2. Click the "Jump to first unread message." ^ up-arrow

  3. Failed to load timeline position error modal is thrown up

    Failed to load timeline position

    Tried to load a specific point in this room's timeline, but was unable to find it.

  4. After exiting out of the modal, the timeline is blank and no way to scroll

  5. Have to switch rooms to get the timeline again


Reproduction/rage-shake logs: https://github.com/matrix-org/element-web-rageshakes/issues/10392

I was in the !ltpmbfSHehPTwnLDNS:jki.re room and clicked on the "Jump to first unread message." arrow and got the Failed to load timeline position error modal. With the following error in the devtools console.

Relevant code for the error: src/components/structures/TimelinePanel.tsx#L1219-L1244

Error loading timeline panel at $iR-8DJRGNhmIpDFDHmRy70gUTurU77eCba-Jt5YIXbo: Error: getEventTimeline result didn't include requested event
overrideMethod @ react_devtools_backend.js:4061
consoleObj.<computed> @ rageshake.ts:65
(anonymous) @ instrument.js:111
(anonymous) @ logger.ts:50
onError @ TimelinePanel.tsx:1181
Promise.then (async)
loadTimeline @ TimelinePanel.tsx:1243
(anonymous) @ TimelinePanel.tsx:1003
(anonymous) @ RoomView.tsx:1659
...

I'm not sure what room the $iR-8DJRGNhmIpDFDHmRy70gUTurU77eCba-Jt5YIXbo event pertains to. Is there a way to look it up and tell which room it actually belongs to?

Outcome

What did you expect?

Jump to first unread button jumps me to whatever the unreads are for that room. Or not be shown if it was for another room and this room doesn't have any unreads.

What happened instead?

Error modal is shown for a situation that probably shouldn't occur in the first place.

Operating system

Windows 10

Browser information

Chrome 97.0.4692.99

URL for webapp

https://develop.element.io/

Application version

Element version: 64242a004eb7-react-78e78292cb62-js-b07457726bf5 Olm version: 3.2.8

Homeserver

matrix.org

Will you send logs?

Yes ->

  • Reproduction from @MadLittleMods, https://github.com/matrix-org/element-web-rageshakes/issues/10392
  • Reproduction from @MadLittleMods, https://github.com/matrix-org/element-web-rageshakes/issues/10919
  • Reproduction from @MadLittleMods, https://github.com/matrix-org/element-web-rageshakes/issues/10920
  • Reproduction from @MadLittleMods, https://github.com/matrix-org/element-web-rageshakes/issues/11235
  • Reproduction from @MadLittleMods, https://github.com/matrix-org/element-web-rageshakes/issues/12429
  • Reproduction from @davidmehren, https://github.com/matrix-org/element-web-rageshakes/issues/10677
  • Reproduction from @MadLittleMods, https://github.com/matrix-org/element-web-rageshakes/issues/20281

MadLittleMods avatar Feb 05 '22 02:02 MadLittleMods

I just experienced this issue on Desktop Nightly and rageshaked, I think @thegcat also encountered it recently.

davidmehren avatar Feb 12 '22 14:02 davidmehren

This just happened to me again, and I think the situation was that I had unread messages in a thread in the room where this happened. The "up arrow" on iOS would take me to the room history position where said thread is (I wasn't able to open and read the thread though because that part seems to be currently broken on iOS…), the "up arrow" on desktop tries to take me somewhere, fails and shows a blank timeline as reported above. Reading the thread makes the read marker/"up arrow" disappear.

Is it possible that the "up arrow" links to a message that is not shown in the timeline per se but is part of a thread, which then confuses Element Desktop, which then just gives up because it can't comprehend where it should jump back to?

thegcat avatar Feb 21 '22 09:02 thegcat

This just happened to me (rageshake-sent the logs), but interestingly, clicking out of the room, back into the room and then clicking the "jump to first unread message" button worked fine on the second try, even though the unread-messages count had reset to 0. Strange.

axelsimon avatar Jun 30 '22 16:06 axelsimon

Isn't this a duplicate of https://github.com/vector-im/element-web/issues/20397 ?

colans avatar Nov 30 '22 20:11 colans

@colans See https://github.com/vector-im/element-web/issues/20397#issuecomment-1075406093

MadLittleMods avatar Nov 30 '22 20:11 MadLittleMods

The same thing happens to me on the gitter.im homeserver.

Elliria avatar Feb 21 '23 14:02 Elliria

@Elliria Give the issue a 👍 reaction if you don't have new further details to add.

MadLittleMods avatar Feb 21 '23 16:02 MadLittleMods

@Elliria Give the issue a +1 reaction if you don't have new further details to add.

The new,further detail was that it was on the gitter.im home-server, whereas the OP saw the issue on the matrix.org home-server. From now on, if I come across another similar situation, should I just do the thumbs-up emoji and not mention the difference?

Elliria avatar Feb 21 '23 18:02 Elliria

@Elliria This issue wasn't suspected of being a homeserver problem and is probably reproducible across any homeserver since it's most likely a problem in Element. In general, if you're just reproducing as described in the issue, it's best to just 👍

MadLittleMods avatar Feb 21 '23 21:02 MadLittleMods

@Elliria This issue wasn't suspected of being a homeserver problem and is probably reproducible across any homeserver since it's most likely a problem in Element. In general, if you're just reproducing as described in the issue, it's best to just +1

Okay, will do in the future. Thanks for all the help.

Elliria avatar Feb 21 '23 22:02 Elliria

Reproduced this again but this time the error is a little different when clicking the jump to unread action (same user-facing reproduction steps and symptoms though): Error loading timeline panel [...] No timeline given to initFields

Error loading timeline panel at !ZCWYLfAKXolsPWObuZ:matrix.org/$ZNo074wZp4TX6L0rfMCbfvKHNPNqSp-fjeN0PtF-Rck Error: No timeline given to initFields
    at initFields (timeline-window.ts:101:23)

I noticed that there is a warning for this event that happened earlier in the logs. Why does this even happen?

Event $ZNo074wZp4TX6L0rfMCbfvKHNPNqSp-fjeN0PtF-Rck in room !ZCWYLfAKXolsPWObuZ:matrix.org is live, but it does not have a timeline

According to this debug output, the problem event we're trying to jump to ($ZNo074wZp4TX6L0rfMCbfvKHNPNqSp-fjeN0PtF-Rck) is part of this thread parent $Cz4e5HLNYUP1efNxbbC99znQXgENaLMuSOuAZDPWP3c

TimelinePanel(Room): Debugging info for !ZCWYLfAKXolsPWObuZ:matrix.org
	events(0)=[]
	renderedEventIds(0)=[]
	serializedEventIdsFromTimelineSets=[{"1":[],"liveTimeline":["$-z-PqimA9h7hQfrv_cSRBcJqm2OTBBqWv8pIndwdk3g","$wIr4S0tlphuoClByuu83mhXP8FrJ65occUUmGDDBLoc","$uXFM1vYpipF2tE5P5CvEO9caJDmspFUa4VNfEQrJKv4","$Xcq4JN0P7dIk3pHem29id7AtDfy-YRumHvzUiQ9aZSY","$4lAB_vulUJ2KYuJNnQoBIAqG39kr7FLOCJzCmclT5i0","$uI7CwFwKz8DA17-zrOaG09n7ExVBi2jxGitDaJFjwzM","$bNJBpp5TT45TIUZqAa7pg11FTZKNmWhrH9529RNq5ZY","$EgyhVKAuktWR20Oz7dg7IuQ4V-kNrKL7dWPVooDdoe0","$6QsEhLZ0RUHFwR231MhuKRBqeWm1-cWS4m_Ppc6oCYA","$sFd58my3qPFI9idFfianeC5bOET2XEx2g_gfRWCY72E","$VUVcWF49ra0MgxP2MgVDyIesSAVLfTZcgm3XaRzDUts","$P4BfNyn8-tD8y--z890wVy2cAKEfGhL3uUUFAAt-Zak","$FsO2im6ulJJIQPwqcmjVkXRbWTup9t7qElixNq6XMsg","$ifRFhXkvd3LBoWC2vYgfKYoM9WfYhUcuoGM5csFsyz0","$FkbKeUzRBQHG2n1CAJN6pDP2CdsaAc6GMAvfK1oHKjw","$T8tgW2mVRjAs8N7P4YNZxBsoWJgUm-T7ob1RBDS2GyE","$2yyK7l4zUoGKm_E7uV3akGBNk_R1UkE3HYhW6vNlpgw","$bXhKSpzhIud5YGVMxMJVJxt2dzetsBJZFYiuR3euhSA","$vnhb-3QhRH26Moo-gzmjBnLRmfdt5IugkQbZ0iNsQKc","$YmkKmCf2DV3lt0LXIrBEXWphsSBUhh7yaeNvXWy5Eus","$iepeNGNAk2dF2rYIHmlAzqrRivtaeRmBqZULwAFRhkg","$_5YrG_EV-ZUb2daoDvDSZDXlIrq2cLinm7PvZJCZSP8","$CwggCFGFhC2Qu0PDG7mgRuruo88SaNwyjBex2KkGZcE","$Ny-dzOT9nCB_takCLAe_fUwg-53ULGwTkzar64U86dg","$O6GxTJrThVLvjxKp3zrghkIlLyP-NH2aEeRTdqShO_M","$VylRerMd7u-lEH7yowX_eonoIm2gpUZ1dXs7lr85aKs","$4ee9xSToEInk7oKgo50j1sCUuecwsUu_gpGhRVyGdvs","$xr4vdHg30pzBMPe0gY5O_aI2U2qHFVl8ElTlbUE2mjc","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ZF6ahWVTxHlAHuVfq8","$YKR4sOlbDG--tkloLgSlqdzEyDaIo32k9dxpTHwcrVA","$3cspdQGVD4Jus7xmfyIYzXdsEtdXUQuuer9zEJ2HC1Q","$ypn-LEuYqU30P0MDo3ceMjUqxIMP29zee6GrSMl7CBA","$3B60kS2xtRE1hsK91JzVOm3sbLT0fTYg71zUMN5IU8E","$-RFUu47yQGsaJIhXtOcSUD7l62cFOayVipbBLCVBgD0","$MxW6AvKkQuYvYrHRXYKWTfwRlwzSmlm_LgYMpOcctX8","$xbtB9CQaOviYKQE-AF30Q5JFujh-iI6FdnJi3yM8vDc","$Rkc15Nwgu2rh9JN2wQhKbxG3ZUFNZ5DTcaRQFG5US1Q","$vf6bZ0maC8uTl_M4K7dfIsxOC8HxRJmueQcUkU6oK_E","$2f9YSW3gcaNtMBQ9NwFq8EvEV9IKilfx2w2rLccYzwM"]}]
	serializedEventIdsFromThreadsTimelineSets=[]
	serializedThreadsMap={"$Cz4e5HLNYUP1efNxbbC99znQXgENaLMuSOuAZDPWP3c":{"events":["$Cz4e5HLNYUP1efNxbbC99znQXgENaLMuSOuAZDPWP3c","$I4JYX_OMzvmuehfF-OwL8DP9N9B4kcFA0Cy68yd21dU","$SzLHKseTRD0gHsI2GuWftukdE0urGfNpCtc0-4Bab34","$APBFL6eS9RpagarKdpCQeG_F6uKVCp0ZQZkRNu8ITJM","$-aiIF1kEqn7wrGDk4C3c9xdEuyIwHCiwdRzgK1XQ9OM","$cqt5IYY75FmG4Y8A6WZuGz6kT4MWimSpuptjijD5aTg","$1zDioZNXcKKuSm7TvyO3RuUV-3oBDfsHdsTD1M78RYY","$EPNYYYYidrzwD7DbzvO316VJawOlrztKwTJhd9DmS3E","$cufmafH4V2CUJBUmjZXxwkmi7mKkCOcUL7kegFuMrU8","$jC97tLM-EZ76EHKeje5VQ0_aLs4nWGDYbqOH8DIfYgE","$0UW0_TQozIkXJ65lIeDleYG65Di2ki6QWf8axXt1qF4","$ip84JL9EqwVV1kiGuibl2-l4BSe42F8jmRFZRArchyA","$meIIFb9z730jiBpYbs3YwkEVFO68mTNVfp2EbCudXkM","$_R_8229rQOtM5J7ihT_i32oTietE38eNz_jcB7FRi24","$7ZUaDH8pXLM4pmRkVn-ryzD5RoEWxPv2ZQsmEHsd4AI","$wiuPwChq5fUbJJkDahv9re2hjkZOHfElXw0tMYEAEUI","$ZNo074wZp4TX6L0rfMCbfvKHNPNqSp-fjeN0PtF-Rck"],"numTimelines":1,"liveTimeline":17},"$vnhb-3QhRH26Moo-gzmjBnLRmfdt5IugkQbZ0iNsQKc":{"events":["$vnhb-3QhRH26Moo-gzmjBnLRmfdt5IugkQbZ0iNsQKc","$R7GFk9VLIJPd4nmhqbxYhyf2GqDKDXnYM0bGTl_qUPM","$Mhw8FK_kLTUQG76MCOTPh_80evg9Mb5JBo9p9noDY60","$qAyj_ZA67E-zT0BIoe-rT8f5Iq4xeu9Y5_DRZxwaBeU","$YmkKmCf2DV3lt0LXIrBEXWphsSBUhh7yaeNvXWy5Eus"],"numTimelines":1,"liveTimeline":5}}
	timelineWindowEventIds(0)=[]
	pendingEventIds(0)=[]

Full rageshake logs: https://github.com/matrix-org/element-web-rageshakes/issues/20281

MadLittleMods avatar Feb 23 '23 17:02 MadLittleMods

I rageshook from a few rooms exhibiting this behaviour.

davidegirardi avatar Jul 24 '23 08:07 davidegirardi

I think this boils down to bugs in the threads code that will necessitate quite large (likely breaking) changes in the API surface around the context API. Currently you call the context API on a given timeline set and sometimes it fails if the event doesn't fit within that timeline set, e.g. in a different thread. The API needs to be able to return a timeline set rather than just a timeline within the given set to be able to jump between threads/main.

t3chguy avatar Nov 21 '23 08:11 t3chguy

This issue occurs when your RM m.fully_read is pointing at an event which is not in the main timeline (e.g. in a thread) - this is especially easy to hit when using a threads-incapable client (e.g. Element X).

Not sure what the desired UX here would be, given threads don't have RMs so one would not expect clicking Jump to unread in the main timeline to open a thread instead.

Needs P&D

t3chguy avatar Nov 22 '23 11:11 t3chguy

I think this boils down to bugs in the threads code that will necessitate quite large (likely breaking) changes in the API surface around the context API. Currently you call the context API on a given timeline set and sometimes it fails if the event doesn't fit within that timeline set, e.g. in a different thread. The API needs to be able to return a timeline set rather than just a timeline within the given set to be able to jump between threads/main.

Until a proper fix is available could there be a workaround that, after dismissing the error, dumps users to the last scroll position (or even just the bottom)?

Currently the most annoying element of this issue is having to fix the broken room view.

Caspy7 avatar Jun 25 '24 06:06 Caspy7

Please fix this. Very annoying. On my Element Chat Client I dont have it but on by Web Browser I have that

suse-coder avatar Jun 16 '25 16:06 suse-coder

Please fix this. Very annoying. On my Element Chat Client I dont have it but on by Web Browser I have that

agreed

gmanskibiditoilet avatar Jun 24 '25 08:06 gmanskibiditoilet