Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Room scroll state is broken mk2 #26759

Closed
greentore opened this issue Dec 13, 2023 · 1 comment · Fixed by matrix-org/matrix-react-sdk#12055
Closed

Room scroll state is broken mk2 #26759

greentore opened this issue Dec 13, 2023 · 1 comment · Fixed by matrix-org/matrix-react-sdk#12055
Assignees
Labels
A-Room A-Timeline O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect X-Regression X-Release-Blocker

Comments

@greentore
Copy link

Steps to reproduce

Follow-up to #25810
Room scroll position isn't properly maintained again since Element v1.11.50 (matrix-react-sdk v3.85.0). I confirmed it works properly in v1.11.49.
Regressed by matrix-org/matrix-react-sdk@01e7e01 / matrix-org/matrix-react-sdk#11799
More specifically, the issue goes away if you comment out dis.dispatch<ActionPayload>({ action: Action.RoomLoaded }); in src/components/structures/RoomView.tsx, but obviously the real bug is somewhere deeper.

Outcome

What did you expect?

The room's scroll position is restored.

What happened instead?

The room's scroll position is restored only to scroll to the bottom a moment later.

Operating system

No response

Browser information

No response

URL for webapp

No response

Application version

No response

Homeserver

No response

Will you send logs?

No

@t3chguy t3chguy added X-Regression S-Major Severely degrades major functionality or product features, with no satisfactory workaround X-Release-Blocker O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience A-Room A-Timeline labels Dec 13, 2023
@florianduros
Copy link
Member

florianduros commented Dec 14, 2023

My analysis:

  1. The Allow adding extra icons to the room header matrix-org/matrix-react-sdk#11799 PR added the dispatch of a new event Action.RoomLoaded
  2. This event is catched by the RoomViewStore and the RoomViewStore is updated
  3. This update triggers an extra call of RoomView#onRoomViewStoreUpdate.
  4. However RoomView#onRoomViewStoreUpdate was already called when the RoomView component was mount. The newState.initialEventId field is computed only on the first call of RoomView#onRoomViewStoreUpdate
  5. RoomView#state.initialEventId is undefined and the TimelinePanel position is set to the end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Room A-Timeline O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect X-Regression X-Release-Blocker
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants