mirror of
https://github.com/microsoft/playwright-mcp.git
synced 2025-07-25 07:52:27 +08:00
Fix race condition bug in session file check
Co-authored-by: pavelfeldman <883973+pavelfeldman@users.noreply.github.com>
This commit is contained in:
parent
bb9de30ef9
commit
e35f0ac562
@ -148,13 +148,17 @@ export class Context {
|
||||
}
|
||||
|
||||
private async _logSessionEntry(toolName: string, params: Record<string, unknown>, snapshotFile?: string) {
|
||||
if (!this.config.saveSession || !this._sessionFile)
|
||||
if (!this.config.saveSession)
|
||||
return;
|
||||
|
||||
// Ensure session file is initialized before proceeding
|
||||
if (this._sessionFileInitialized)
|
||||
await this._sessionFileInitialized;
|
||||
|
||||
// After initialization, session file should always be defined when saveSession is true
|
||||
if (!this._sessionFile)
|
||||
throw new Error('Session file not initialized despite saveSession being enabled');
|
||||
|
||||
const entry = [
|
||||
`- ${toolName}:`,
|
||||
' params:',
|
||||
|
Loading…
x
Reference in New Issue
Block a user