Output from R and Python is dropped during a reload or browser tab close
System details:
Positron and OS details:
Positron Version: 2024.08.0 (Universal) build 77
Code - OSS Version: 1.92.0
Commit: 430d0dca91193cc49af89c1a6ad3bbd38bf14492
Date: 2024-08-28T02:36:14.522Z
Electron: 30.1.2
Chromium: 124.0.6367.243
Node.js: 20.14.0
V8: 12.4.254.20-electron.0
OS: Darwin arm64 23.5.0
Describe the issue:
Any output emitted while no browser is actively connected to the R or Python kernels is silently discarded and cannot be recovered.
Steps to reproduce the issue:
Run the following R code:
for (i in seq_len(50)) { Sys.sleep(0.5); print(i) }
Let it run a few seconds, then reload the window (or browser tab). Note that all the numbers emitted during the reload are lost; the first number that appears after reconnecting is much larger than the last number emitted before disconnecting.
For instance, numbers 8-12 are dropped in this recording.
https://github.com/user-attachments/assets/9dcf5d8f-bd81-4ce4-8adb-659d80dc4794
Expected or desired behavior:
No output should be dropped. These can be important computational results that take minutes or hours to generate.
Ideally, the entire prompt and any output it emitted should be visible.
While this example uses console output, the same is true of other kinds of outputs (for example, plots).
This is fixed in my testing when using the new supervisor (not yet on main), but the user experience is not superb because we currently don't preserve any output on reload. So using the example above, we don't drop any numbers any more, but the stream of numbers just picks up where it left off.
This is ready to verify (you will need to enable the new supervisor). Note that even though no output should be dropped you will still only see new output; this will probably not feel done until we implement #4925.
New output is preserved!