Commit graph

347 commits

Author SHA1 Message Date
Travis Ralston
3dcc92b79d Add some logging/recovery for lost rooms
Zero inserts is not normal, so we apply the same recovery technique from the categorization logic above this block: insert it to be the very first room and hope that someone complains that the room is ordered incorrectly.

There's some additional logging to try and identify what went wrong because it should definitely be inserted. The `!== 1` check is not supposed to be called, ever.

Logging for https://github.com/vector-im/riot-web/issues/11303
2019-11-12 15:39:03 -07:00
Travis Ralston
fa6e02fafb Revert "Add some logging/recovery for lost rooms"
This reverts commit 1aa0ab13e6.
2019-11-12 15:38:45 -07:00
Travis Ralston
1aa0ab13e6 Add some logging/recovery for lost rooms
Zero inserts is not normal, so we apply the same recovery technique from the categorization logic above this block: insert it to be the very first room and hope that someone complains that the room is ordered incorrectly.

There's some additional logging to try and identify what went wrong because it should definitely be inserted. The `!== 1` check is not supposed to be called, ever.

Logging for https://github.com/vector-im/riot-web/issues/11303
2019-11-12 15:38:29 -07:00
J. Ryan Stinnett
3f2b77189e Simplify dispatch blocks 2019-11-12 13:29:01 +00:00
J. Ryan Stinnett
d72dedb0ce Cache room alias to room ID mapping in memory
This adds very basic cache (literally just a `Map` for now) to store room alias
to room ID mappings. The improves the perceived performance of Riot when
switching rooms via browser navigation (back / forward), as we no longer try to
resolve the room alias every time.

The cache is only in memory, so reloading manually or as part of the clear cache
process will start afresh.

Fixes https://github.com/vector-im/riot-web/issues/10020
2019-11-12 11:54:41 +00:00
Michael Telatynski
3fdaeea3a2 allow rooms we were banned from into Historical also
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2019-09-15 22:24:23 +01:00
Michael Telatynski
4fb4c5b744 Only put a room in Historical if === 'leave' not peeked
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2019-09-15 22:19:07 +01:00
Michael Telatynski
ef2ff31a46 Fix replying from search results for this and all rooms
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2019-09-09 09:34:08 +01:00
Michael Telatynski
cd6a980c7e Only Destroy the expected persistent widget, not *ANY*
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2019-08-22 16:57:51 +01:00
Travis Ralston
42e6287bdb Implement basic soft logout handling
Fixes https://github.com/vector-im/riot-web/issues/10235

CSS and copy are left as an exercise for a later iteration.

Login page handling is left for https://github.com/vector-im/riot-web/issues/10236

This implementation reuses as much of the Lifecycle flow as it can without causing problems. Most importantly, it requires https://github.com/matrix-org/matrix-js-sdk/pull/975 to be able to detect a soft logout and react to it. When it comes time to starting/stopping the Lifecycle, additional parameters are provided so that the auxiliary services can (re)start themselves without the client starting to sync.
2019-07-03 16:46:37 -06:00
Travis Ralston
c2ad9d4f53 Attach timer finished state once 2019-06-28 12:29:03 -06:00
Travis Ralston
17ed62de7d Move MessageComposer typing timeout to TypingStore 2019-06-27 10:35:44 -06:00
Travis Ralston
eb1f911d15 Use a Timer 2019-06-27 10:29:27 -06:00
Travis Ralston
67ecf9db62 expireMs -> expireTs 2019-06-27 09:44:13 -06:00
Travis Ralston
1546cb2923 You win this time, linter. 2019-06-26 22:40:08 -06:00
Travis Ralston
cd089a3f95 Track the user's own typing state external to the composer
Fixes https://github.com/vector-im/riot-web/issues/9986

There's a few reasons for pushing this out to its own place:
* In future, we might want to move WhoIsTyping here.
* We have multiple composers now, and although they don't send typing notifications, they could (see https://github.com/vector-im/riot-web/issues/10188)
* In future we may have status for where/what the user is typing (https://github.com/matrix-org/matrix-doc/issues/437)
* The composer is complicated enough - it doesn't need to dedupe typing states too.

Note: This makes use of the principles introduced in https://github.com/vector-im/riot-web/issues/8923 and https://github.com/vector-im/riot-web/issues/9090
2019-06-26 22:36:55 -06:00
David Baker
d7509dd4c4 comment consistency 2019-04-08 19:12:04 +01:00
David Baker
670f6e4f99 Simplify settings dialog CSS
Stop the settings dialogs from requiring special styles on the
mx_Dialog which required passing in a classname from anywhere the
settings dialogs were opened (although this still requires
static=true). Some of the things have now been adopted for all dialogs
(border-radius), others have been moved to within the dialog content.
2019-04-08 16:48:42 +01:00
Travis Ralston
f2b7042a33 misc cleanup 2019-04-04 09:30:15 -06:00
Travis Ralston
10369170ed Use a static prop on Stickerpicker to track the current widget 2019-04-03 17:16:56 -06:00
Travis Ralston
51750cf153 General cleanup of handling for WidgetMessaging instances
When setting, delete the old one. Because delete checks if it exists first, we can safely call this.

The change in FromWidgetPostMessageApi is just something noticed while debugging.
2019-04-01 19:50:05 -06:00
Travis Ralston
a4f76670c4 Don't re-init the stickerpicker unless something actually changes
Fixes https://github.com/vector-im/riot-web/issues/9354

https://github.com/matrix-org/matrix-react-sdk/pull/2801 introduced a change which tried to make sure that when the widget URL was changed that the picker would be re-mounted, however it accidentally introduced a regression. While it effectively did the task it wanted to, it failed to keep the previously-mounted sticker picker alive. This is because the Stickerpicker component is remounted when opened, and the _updateWidget function is called. This results in this.state not having the "current" widget, meaning a URL change is always detected when the component is remounted (room changes, open sticker picker). 

Instead of remounting always, we'll instead track which sticker picker widget is being used out of band. This therefore means that whenever the Stickerpicker component is mounted it doesn't create a whole new widget, and the existing (background) picker can be used. This also fixes the loading screen that people would see when opening the sticker picker after switching rooms, something which the persistent widget stuff is supposed to solve.
2019-04-01 19:48:05 -06:00
Travis Ralston
a5b4d4ba95 Include tag name when warning about rooms running off lists 2019-03-04 10:56:18 -07:00
Travis Ralston
7d9e58b3c3
Merge pull request #2735 from matrix-org/travis/duplicated-people
Don't duplicate direct chats from other tags
2019-03-04 10:34:32 -07:00
Travis Ralston
49f506cef4 More clearly fix issues with room insertion to lists
Instead of having a catch-all insert, try and fix the common cases with a bit more care.
2019-03-01 17:18:16 -07:00
Travis Ralston
43d099836b Always insert rooms into lists when they get lost
Room upgrades, direct chats, etc all end up being lost in these scenarios. Instead of losing them to the list, try and put them into a relevant spot of the list.

Fixes https://github.com/vector-im/riot-web/issues/9020
2019-03-01 15:48:10 -07:00
Travis Ralston
3c2403ca54 Don't duplicate direct chats from other tags
Fixes https://github.com/vector-im/riot-web/issues/8971
2019-03-01 15:29:24 -07:00
Travis Ralston
0978ab3da0 Support stacking dialogs to prevent unmounting
Fixes https://github.com/vector-im/riot-web/issues/8371
2019-02-28 15:55:58 -07:00
Travis Ralston
805676a511 Don't lose invites when multiple are pending 2019-02-28 14:03:28 -07:00
Travis Ralston
872cdaa9b3 Use the already available state for checking if custom tags are enabled 2019-02-28 14:03:28 -07:00
Travis Ralston
b1e16e9f49 Fix stacktrace when starting riot up with rooms
Settings can trigger before we're ready, so don't generate the room list. This also includes a comment to signify to future people that we need to track settings still.
2019-02-28 13:55:20 -07:00
Travis Ralston
a3342a5790 Standardize on "Category" being the canonical term for room list sections 2019-02-28 13:24:05 -07:00
Travis Ralston
bafe59fe28 Appease the linter 2019-02-27 18:29:48 -07:00
Travis Ralston
c908a6cf1e Move complex part of room sorting to a dedicated function
Pretty much cut/pasting it in, as there's not really a whole much to help make the code more understandable here.

This also includes a comment block longer than the code it describes in hopes it explains away the problem of understanding what it does.

Should fix https://github.com/vector-im/riot-web/issues/8861
2019-02-27 15:55:16 -07:00
Travis Ralston
2c2685a3ea
Merge pull request #2705 from matrix-org/travis/fix-monitored-settings
Use a global WatchManager for settings
2019-02-27 08:02:27 -07:00
Travis Ralston
143f218e08 Make sure direct chat invites are treated as invites
Fixes https://github.com/vector-im/riot-web/issues/8966

The DMRoomMap updates before we accept the invite, so make sure to check if it is an invite before checking if it is a direct chat.
2019-02-26 23:40:07 -07:00
Travis Ralston
93673eff12 Use a global WatchManager for settings
Fixes https://github.com/vector-im/riot-web/issues/8936

Watchers are now managed by the SettingsStore itself through a global/default watch manager. As per the included documentation, the watch manager dispatches updates to callbacks which are redirected by the SettingsStore for consumer safety.
2019-02-26 12:52:59 -07:00
Travis Ralston
f82cc28f96
Merge pull request #2701 from matrix-org/travis/fix-invites
Change the room list algo to eagerly delete and carefully insert
2019-02-26 09:26:32 -07:00
Michael Telatynski
8d149575ea Merge branches 'develop' and 't3chguy/room_context_menu_settings' of github.com:matrix-org/matrix-react-sdk into t3chguy/room_context_menu_settings 2019-02-25 23:12:06 +00:00
Michael Telatynski
d4b6ce6932 Apply PR feedback, don't change room to go to its settings
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2019-02-25 23:08:51 +00:00
Travis Ralston
3d152da822 Support custom tags in the new algorithm 2019-02-25 13:39:08 -07:00
Travis Ralston
e083d50e31 Merge branch 'develop' into travis/fix-invites 2019-02-25 12:41:19 -07:00
Travis Ralston
5f760fbf4a Change the room list algo to eagerly delete and carefully insert
Previously it made some complicated assumptions about the contexts it was called in (it generally assumed it just had to shuffle rooms between tags and didn't really handle new rooms very well).

The algorithm now eagerly tries to drop rooms from tags and carefully inserts them. The actual insertion logic is mostly untouched: the only part changed is how it handles failure to insert into tag. It shouldn't be possible for this algorithm to completely skip a room unless the tag is empty, so we special case that.

There are several TODO comments to be addressed here. Namely, it doesn't handle manually ordered tags (favourites, custom, etc) and doesn't check if tags are even enabled. Changes in this area are waiting for https://github.com/matrix-org/matrix-react-sdk/pull/2686 to land to take advantage of monitoring the settings flag for tags.
2019-02-24 19:45:23 -07:00
Travis Ralston
b0cc69bca9 Add an option to sort the room list by recents first
Fixes https://github.com/vector-im/riot-web/issues/8892
2019-02-22 17:09:07 -07:00
Travis Ralston
e7b3cbfdf4 Fix categorization of favourites and new rooms
New rooms (joined, invited, created, etc) were being ignored because they matched the check as soon as the iterator hit a non-recents section. This fixes the check to ensure there's a positive ID on the room being in the tag (or not, in the case of new rooms) before lying to the rest of the function.

Additionally, a fix for favourites has been included to stop the list expanding to fill the void - turns out it was inserting the room twice into the list, and this was breaking the tile rendering. The room sublist would allocate space for the tile, but React would prevent the tile from showing up because of duplicate keys.

Fixes https://github.com/vector-im/riot-web/issues/8868
Fixes https://github.com/vector-im/riot-web/issues/8857 correctly
2019-02-21 19:21:32 -07:00
Travis Ralston
d662dccfba Fix favourites losing rooms and sorting weirdly
By not flagging the room as inserted, we end up sorting it.

Fixes https://github.com/vector-im/riot-web/issues/8857
2019-02-21 09:17:35 -07:00
Travis Ralston
64103b7af4 More micro optimizations to make the hot paths faster 2019-02-19 15:15:39 -07:00
Travis Ralston
561d1f37ec Stick a couple micro optimizations into the setRoomCategory hot path 2019-02-19 14:56:56 -07:00
Travis Ralston
cb15bc968c Remove excessive dispatch binding 2019-02-15 23:41:48 -07:00
Travis Ralston
53fa59f5a4 Remove old debugging code
The algorithm is correctly applied when these are removed.
2019-02-15 23:40:23 -07:00