[FIX] Requests being skipped after reconnecting on onboarding (#4429)
This commit is contained in:
parent
a607980840
commit
c4d3af0e00
|
@ -45,16 +45,15 @@ function connect({ server, logoutOnError = false }: { server: string; logoutOnEr
|
|||
if (sdk.current?.client?.host === server) {
|
||||
return resolve();
|
||||
}
|
||||
|
||||
// Check for running requests and abort them before connecting to the server
|
||||
abort();
|
||||
|
||||
disconnect();
|
||||
database.setActiveDB(server);
|
||||
|
||||
store.dispatch(connectRequest());
|
||||
|
||||
// It's not called anywhere else
|
||||
// if (this.connectTimeout) {
|
||||
// clearTimeout(this.connectTimeout);
|
||||
// }
|
||||
|
||||
if (connectingListener) {
|
||||
connectingListener.then(stopListener);
|
||||
}
|
||||
|
@ -374,7 +373,6 @@ function abort() {
|
|||
if (sdk.current) {
|
||||
return sdk.current.abort();
|
||||
}
|
||||
return new AbortController();
|
||||
}
|
||||
|
||||
function checkAndReopen() {
|
||||
|
|
|
@ -108,9 +108,6 @@ const handleSelectServer = function* handleSelectServer({ server, version, fetch
|
|||
const basicAuth = UserPreferences.getString(`${BASIC_AUTH_KEY}-${server}`);
|
||||
setBasicAuth(basicAuth);
|
||||
|
||||
// Check for running requests and abort them before connecting to the server
|
||||
Services.abort();
|
||||
|
||||
if (user) {
|
||||
yield put(clearSettings());
|
||||
yield put(setUser(user));
|
||||
|
|
|
@ -40,7 +40,6 @@ async function navigateToLogin(server) {
|
|||
await waitFor(element(by.id('login-view')))
|
||||
.toExist()
|
||||
.withTimeout(2000);
|
||||
await expect(element(by.id('login-view'))).toExist();
|
||||
}
|
||||
|
||||
async function navigateToRegister(server) {
|
||||
|
@ -195,6 +194,9 @@ const checkServer = async server => {
|
|||
.toBeVisible()
|
||||
.withTimeout(10000);
|
||||
await element(by.id('sidebar-close-drawer')).tap();
|
||||
await waitFor(element(by.id('sidebar-close-drawer')))
|
||||
.not.toBeVisible()
|
||||
.withTimeout(10000);
|
||||
};
|
||||
|
||||
function runCommand(command) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const { navigateToLogin, tapBack, platformTypes } = require('../../helpers/app');
|
||||
const { navigateToLogin, tapBack, platformTypes, navigateToWorkspace, login } = require('../../helpers/app');
|
||||
const data = require('../../data');
|
||||
|
||||
describe('Login screen', () => {
|
||||
|
@ -74,5 +74,13 @@ describe('Login screen', () => {
|
|||
.toBeVisible()
|
||||
.withTimeout(60000);
|
||||
});
|
||||
|
||||
it('should connect, go back, connect to the same server and login', async () => {
|
||||
await device.launchApp({ permissions: { notifications: 'YES' }, newInstance: true, delete: true });
|
||||
await navigateToWorkspace();
|
||||
await tapBack();
|
||||
await navigateToLogin();
|
||||
await login(data.users.regular.username, data.users.regular.password);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue