diff --git a/bin/todo_desktop.dart b/bin/todo_desktop.dart index c9ad10c..63beb65 100644 --- a/bin/todo_desktop.dart +++ b/bin/todo_desktop.dart @@ -181,15 +181,17 @@ Future _provisionSyncAccount(String home) async { '--headless=new', '--disable-gpu', '--user-data-dir=${_profileDir(home)}', - '--virtual-time-budget=15000', - '--dump-dom', + // Surface the page's own log() output, so a failure inside the app is + // visible in the terminal that started the provisioning run. + '--enable-logging=stderr', 'http://localhost:$_port', ]); - final code = await process.exitCode; - if (code != 0) { - stderr.writeln('Headless provisioning run exited with $code.'); - return false; - } + // No --virtual-time-budget: it makes Chrome SIGKILL itself when the budget + // expires, which both reads as a failure (exit -9) and can cut the sync + // short. Give the page a real window of wall-clock time, then close it. + await Future.delayed(const Duration(seconds: 30)); + process.kill(); + await process.exitCode; stdout.writeln( 'Provisioning run complete. Launch normally to confirm it is connected.', );