Closed yogat3ch closed 1 year ago
Taking a screenshot requires a roundtrip from R --> JS --> R. Whether or not this is all possible within the on.error
handler is not a question I can answer, that's a technical question for the shiny team. I don't think there's much that can be done on {shinyscreenshot}'s end -- I would try to ask in the RStudio Community forum if something like this is possible, and hopefully someone from the shiny team would respond.
I'm closing this issue as it's not really a shinyscreenshot issue.
Hi @daattali, We've been experimenting with this package and wondering about the feasibility of something.
We're attempting to use
screenshot
to save a screenshot inside theshiny.error
callback before a shiny session full break in order to capture rich error logs in a zip file that is written to an S3 bucket for debugging purposes. We've observed thatscreenshot
when using theserver_dir
doesn't actually save the file to the server while theshiny.error
callback executes and given the app dies right after the callback concludes, occasionally the screenshot doesn't seem to save at all and isn't available when the files arezip
ped. Is it possible to force immediate writing of that file to disk? I see thatsession$sendCustomMessage
is used internally to call the JS function that runshtml2canvas
, is there an alternative that will run immediately? We found a partial workaround by adding thezip
and S3 bucket write portions of the logic as a callback tosession$onSessionEnded
, but occasionally the screenshot won't be available yet. I've asked about this on R4DS if it's easier to discuss there.Thank you!