mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-17 16:37:43 +00:00
test(e2e): block WS-triggered downloads in non-WS supersync tests
routeWebSocket() can't prevent notifications that slip through in the brief window before a connection is closed. __SP_E2E_BLOCK_WS_DOWNLOAD was already checked by WsTriggeredDownloadService but never set by the test infrastructure, leaving a race condition where background downloads would race with explicit syncAndWait() calls and resurrect archived tasks.
This commit is contained in:
parent
91658f1230
commit
af7c7687e2
1 changed files with 6 additions and 0 deletions
|
|
@ -191,8 +191,14 @@ export class SuperSyncPage extends BasePage {
|
|||
// piggybacked ops in the response, causing data to sync between clients
|
||||
// outside of explicit syncAndWait(). Set here (not in createSimulatedClient)
|
||||
// so tests using enableWebSocket:true still get immediate uploads.
|
||||
// 3. Block WsTriggeredDownloadService: Even when routeWebSocket() closes the
|
||||
// connection, a WS notification can slip through the moment the connection
|
||||
// opens (before it's closed). Setting __SP_E2E_BLOCK_WS_DOWNLOAD ensures
|
||||
// WsTriggeredDownloadService ignores any such notifications, preventing
|
||||
// uncontrolled background syncs that race with explicit syncAndWait() calls.
|
||||
await this.page.evaluate(() => {
|
||||
(globalThis as any).__SP_E2E_BLOCK_IMMEDIATE_UPLOAD = true;
|
||||
(globalThis as any).__SP_E2E_BLOCK_WS_DOWNLOAD = true;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue