Supply a server config to the component and adjust the wait logic to be less of a race. The Login component will noop onPasswordLogin if it is "busy", and it is busy when it requests the login flows.
The new storage consistency work expects a crypto store exist together with
local storage. This updates the loading tests to create them together.
Needed for https://github.com/vector-im/riot-web/issues/9109
This changes the way tests wait for login to complete from a timer-based system
(which can cause intermittent failures) to an action-based system. The lifecycle
code dispatches the action `on_logged_in` when login completes which we can wait
for in the tests as a much better indication that work is done.
`Promise.defer` is deprecated in Bluebird and it logs loudly each time it's
called. This cleans up testing logs significantly by converting away from it.
Chrome seems to take ages (like, 1500ms regularly) to clear out the indexeddbs,
and that's causing test timeouts. Bump the timeout to hack around it.
Also: clear both dbs in parallel (can't hurt, right?) and improve diagnostics
on the process.
Mostly this is just making it look at the `view` state rather than the
individual boolean flags.
One other tweak merits explanation: we now implement the initial
couldn't-register-as-guest login with an explicit switch to the LOGIN view,
which means that the URL gets updated to #/login.
This used to exist to reproduce the functionality in the window.onload handler
in vector/index.js -- which got removed in 31915db. Having it here is confusing
at best.
* Do we show the last room correctly on resume?
* Do we show the home page if we have no last room?
* If we follow a login link, and re-log-in, do we correctly vape the
mx_last_room_id (#4283)
The q.delay is needed to make sure (or at least reasonably
sure...) that the login component has appeared by that point. The
done handler needs to be the error callback too otherwise failures
result in timeouts rather than the actual failure.
This time the test wasn't being flaky, but it does inspect a lot of the internal of RoomView, which has had some modifications recently. I've updated the test to reflect this and it passes locally.
Also, fix a bug in HomePage with an undeclared "error" which should be "err".
Let's see what Travis thinks of this!