If we have account data in local storage but nothing in the crypto store, it
generally means the browser has evicted IndexedDB out from under us. This adds a
modal to explain the situation and offer to completely clear storage to get
things back to normal.
Fixes https://github.com/vector-im/riot-web/issues/9109
This adds a storage consistency check just before creating a client on login.
Each data store we use is checked for data and any problems are logged to the
console.
Fixes https://github.com/vector-im/riot-web/issues/9271
Splits UserActivity into a tristate of 'active' (last < 1s), 'passive' (lasts a
couple of mins) and neither. Read receipts are sent when 'active', read markers
are sent while 'passive'.
Also fixed a document / window mix-up on the 'blur' handler.
Also adds a unit test for UserActivity because it's quite complex now
(and changes UserActivity to make it testable by accessing the singleton
via sharedInstance() rather than exporting it directly).
Fixes https://github.com/vector-im/riot-web/issues/9023
Fixes https://github.com/vector-im/riot-web/issues/6875
Instead of overwriting what we have, we'll load the session we have and try to warn the user that they have verified an address for someone else.
When I was talking to Matthew about this the other day, we couldn't think of a
good reason why we should preserve the HS URL at logout. It introduces the
problem that, if a client is redirected after login as per MSC1730, and then
you log out, you'll then get a login screen for the wrong server.
So basically there's no reason to have an mx_hs_url/mx_is_url without an access
token, and we can remove the stuff which preserves it, and the stuff that
attempts to restore it.
ActiveWidgetStore is now reponsible for removing the current
persistent widget from the store if it's been removed from whatever
room it was in. As per comment, this leaves us with the store updating
itself in this case but in all other cases, views call setters on the
store to update its state. We should make it so the store keeps itself
up to date and views aren't responsible for keeping the store up to date.
The store now emits events so it can notify PersistentApp when it changes.
Fixes https://github.com/vector-im/riot-web/issues/7076
The user might (probably does) have a session even if we haven't actually tried
to load it yet, so wrap the whole loadSession code in the error handler we were
using for restoring sessions so we gracefully handle exceptions that happen
before trying to restore sessions too.
Remove the catch in MatrixChat that sent you to the login screen. This is
never the right way to handle an error condition: we should only display the
login screen if we successfully determined that the user has no session, or
they explicitly chose to blow their sessions away.
Fix a number of failures that meant the excellent error handling
we had for failing to restore a session didn't work.
1. .catch on the promise rather than try/catch: it's async
2. Explicit cancel method in SessionRestoreErrorDialog that invokes
onFinished with `false` because even with the catch fixed, this
was getting the event as its first arg which is truthy, so
clicking cancel still deleted your data.
3. DialogButtons: Don't pass onCancel straight into the button event
handler as this leaks the MouseEvent through as an argument.
Nothing is using it and it exacerbates failures like this
because there are surprise arguments.
Fixes https://github.com/vector-im/riot-web/issues/6616
We used to show a special error message when we got this error; however
https://github.com/matrix-org/matrix-react-sdk/pull/783 made that not work.
You'll only hit it if you're upgrading from some ancient version of Olm, and
I'm quite happy for us to fall back to the generic 'couldn't restore: vape your
storage?' flow in that case. (In any case that's preferable to dumping you at
the login prompt with no warning that we've just vaped your storage).
* don't just log errors without any context as to where they came from or what
they mean
* avoid the use of '%s' and multi-argument console.log because it looks awful
under karma.
Fixes riot-web#4334
When we do a token login, don't carry on with the normal app startup
(transitioning to the loggedIn state etc) - instead tell the app about the
successful login and wait for it to redirect.
Replace onLoadCompleted with onTokenLoginCompleted so that the app can see what
it's supposed to be doing.
This fixes an unintuitive behaviour where, if you follow a link to
riot.im/app/#/login, we take you to the login page, but not before we've
registered a guest account (or restarted the MatrixClient with the stored
creds).
This actually ends up simplifying some of the startup dance, as we special-case
the registration flows earlier on.
In order to get ILAG internationalised
Conflicts:
src/components/structures/LoggedInView.js
src/components/structures/MatrixChat.js
src/components/views/dialogs/ChatCreateOrReuseDialog.js
src/components/views/dialogs/SetDisplayNameDialog.js
src/createRoom.js
src/i18n/strings/en_EN.json
This reverts commit c3d37c1ff9.
This commit was introducing a bug where no rooms would be shown if
you want straight to /#/login and logged in (because this causes
a guest session to be created but the indexeddb store not to be
cleared, so the new login picks up the stale indexedb sync data.