(core) Wrong userId in the team-success endpoint when multiple accounts are logged in

Summary:
In browser where user is logged in multiple times, she can start
creating a new site from docs org where user B is the default one, and end up on the
api endpoint where user A is the default one. This resulted in wrong userId in the handler.

Test Plan: New test

Reviewers: georgegevoian

Reviewed By: georgegevoian

Differential Revision: https://phab.getgrist.com/D4029
This commit is contained in:
Jarosław Sadziński 2023-09-06 13:37:57 +02:00
parent 18f7e255df
commit 775b94b15a

View File

@ -948,6 +948,9 @@ export async function waitForLabelInput(): Promise<void> {
* Sends UserActions using client api from the browser.
*/
export async function sendActions(actions: UserAction[]) {
await driver.manage().setTimeouts({
script: 1000 * 2, /* 2 seconds, default is 0.5s */
});
const result = await driver.executeAsyncScript(`
const done = arguments[arguments.length - 1];
const prom = gristDocPageModel.gristDoc.get().docModel.docData.sendActions(${JSON.stringify(actions)});