Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Part 3 of 3: Apply today's changes to experimental again #2400

Merged
merged 8 commits into from
Jan 3, 2019

Conversation

turt2live
Copy link
Member

This re-applies #2383 and #2396 which were removed in part 1: #2398. They were removed because the conflict was complicated enough that it was just easier to back them out first.

Requires #2399

@turt2live turt2live requested a review from a team January 3, 2019 23:17
@jryans jryans self-assigned this Jan 3, 2019
Copy link
Collaborator

@jryans jryans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, this approach doesn't actually bring in the original commits from those PRs. Can we do something like merge your branches instead of using revert commits here?

@jryans jryans assigned turt2live and unassigned jryans Jan 3, 2019
All of the anchors were pointed at `#` which, when clicked, would trigger a hash change in the browser. This change races the change made by the screen handling where the screen handling ends up losing. Because the hash is then tracked as empty rather than `#/login` (for example), the state machine considers future changes as no-ops and doesn't do anything with them.

By using `preventDefault` and `stopPropagation` on the anchor click events, we prevent the browser from automatically going to an empty hash, which then means the screen handling isn't racing the browser, and the hash change state machine doesn't no-op.

After applying that fix, going between pages worked great unless you were going from /login to /home. This is because the MatrixChat state machine was now out of sync (a `view` of `LOGIN` but a `page` of `HomePage` - an invalid state). All we have to do here is ensure the right view is used when navigating to the homepage. 

Fixes element-hq/element-web#4061

Note: the concerns in 4061 about logging out upon entering the view appear to have been solved. Navigating to the login page doesn't obliterate your session, at least in my testing.
@turt2live turt2live force-pushed the travis/re-apply-exp-changes branch from e4e69d6 to 502288d Compare January 3, 2019 23:28
Copy link
Collaborator

@jryans jryans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This version looks good to me. Thanks for preserving the original history.

@turt2live turt2live merged commit 46aa543 into experimental Jan 3, 2019
@turt2live turt2live deleted the travis/re-apply-exp-changes branch January 3, 2019 23:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants