Skip to content

Commit 46cf944

Browse files
authored
Merge pull request #819 from nextcloud-libraries/artonge/fix/clear_user_sessions_on_restore
fix: Clear saved sessions in restoreState()
2 parents 14795cb + 91464e7 commit 46cf944

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

lib/commands/state.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,10 @@ export function restoreState(snapshot: string = 'init') {
2020
runCommand(`rm -vfr ./data/*`)
2121
runCommand(`tar -xf '/var/www/html/data-${snapshot}.tar'`)
2222

23+
// Any user sessions created between saveState() and restoreState()
24+
// are not present in the database, but exist in the web server.
25+
// Using them leads to unknown behavior, so we clear them all to prevent session errors.
26+
Cypress.session.clearAllSavedSessions()
27+
2328
cy.log(`Restored snapshot ${snapshot}`)
2429
}

0 commit comments

Comments
 (0)