Skip to content

After sending hot reload with pause: true isolate unexpectedly resumes immediately after PausePostRequest #10934

@DanTup

Description

@DanTup

I'm using flutter run --machine and sending a hot reload with pause: true in order to allow me to resend breakpoints after the reload completes (by handling PausePostRequest). However it seems that the isolate is immediately unpausing after the PausePostRequest.

I've managed to reproduce this in a small script (attached). It runs the example stocks app and after 10secs issues a hot reload, logging flutter and observatory communications. It does not set any breakpoints and it does not --start-paused.

restart_pause.ts (typescript)
restart_pause.txt (log)

The interesting part of the log is this:

// Send hot reload
FLUTTER: ==> [{"id":1,"method":"app.restart","params":{"appId":"ea01d925-b17a-48bc-8f25-d8ef8e1043ac","fullRestart":false,"pause":true}}]

// Hot reload starts
FLUTTER: <== [{"event":"app.progress","params":{"appId":"ea01d925-b17a-48bc-8f25-d8ef8e1043ac","id":"2","progressId":"hot.reload","message":"Initializing hot reload..."}}]

// PausePostRequest comes in (this is when I plan to re-send breakpoints and then issue a resume)
<== {"jsonrpc":"2.0","method":"streamNotify","params":{"streamId":"Debug","event":{"type":"Event","kind":"PausePostRequest","isolate":{"type":"@Isolate","...

// #################
// But wait..., why did this happen?!
// #################
<== {"jsonrpc":"2.0","method":"streamNotify","params":{"streamId":"Debug","event":{"type":"Event","kind":"Resume","isolate":{"type":"@Isolate","fixedId":t...

// Hot reload completes
FLUTTER: <== [{"event":"app.progress","params":{"appId":"ea01d925-b17a-48bc-8f25-d8ef8e1043ac","id":"2","progressId":"hot.reload","finished":true}}]

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions