test: e2eテストがCIで失敗していた問題をいくつか修正 (#8642)
* test: indexeddbをテスト毎に初期化するように * fix: metaが無いときにfetch-metaを同時に呼ぶと死ぬことがある問題を修正 * test: ログイン後のクライアント側処理を待たずにリロードされてログイン出来ないことがあったのを修正
This commit is contained in:
@ -20,9 +20,16 @@ export async function fetchMeta(noCache = false): Promise<Meta> {
|
||||
cache = meta;
|
||||
return meta;
|
||||
} else {
|
||||
const saved = await transactionalEntityManager.save(Meta, {
|
||||
id: 'x',
|
||||
}) as Meta;
|
||||
// metaが空のときfetchMetaが同時に呼ばれるとここが同時に呼ばれてしまうことがあるのでフェイルセーフなupsertを使う
|
||||
const saved = await transactionalEntityManager
|
||||
.upsert(
|
||||
Meta,
|
||||
{
|
||||
id: 'x',
|
||||
},
|
||||
['id'],
|
||||
)
|
||||
.then((x) => transactionalEntityManager.findOneByOrFail(Meta, x.identifiers[0]));
|
||||
|
||||
cache = saved;
|
||||
return saved;
|
||||
|
Reference in New Issue
Block a user