Replies: 1 comment
-
Hey, Replay recording data is only stored in memory (it can become quite large!), so when navigating to a new page, it will be cleared out. When an error occurs, we send all currently buffered data, which in the case of a Multi-Page-App (MPA) will usually only be what has happened since the current page was loaded. So yes, you will not get recording data for what happened before in this case, sadly. If we wanted to handle this differently, we'd have to store the buffered recording data somewhere, which is rather complex and error prone (as replay recording data depends on incremental changes). The risk of running into missing segments / inconsistent frame updates is rather high, and persisting such data always comes with quite a large risk of potential problems that can come up. I will cc @bruno-garcia & @jas-kas here as well, as they may have more info to share in regards to the roadmap for these challenges. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to get Sentry Replay to work with Razor cshtml pages for C# MVC NET Core. I posted this here since it is more on the JavaScript side of things than the C# NET. We have Sentry for C# NET attached already to our project but would like to try to incorporate the JavaScript session replay to razor cshtml(this page allows javascript and other frameworks). The session replay does work on a per page basis at the moment. It will record a session replay for a javascript issue per page and one minute after that. My goal is to have the Sentry Object persist through page loads and to have Session replay buffer throughout multiple pages without the Sentry object being wiped out. This way I should be able to diagnose what a user was doing prior to hitting backend errors for C# along with being able to see JavaScript issue. It looks like C# MVC constantly refreshes each page when loading, this destroys the Sentry Object.
My thought is that the Sentry Javascript object is supposed to sit on top of the application layer at all times so that the Sentry object does not get wiped out and that modern frameworks(javascript/Vue/React/etc) only swap out components when needed on switching urls/tabs. Razor Cshtml for MVC C# is not designed in this way. In Razor cshtml for C# MVC NET Core the whole page is constantly reloaded which cleans out the old Sentry object, either a new Sentry object has to be created with the Init or there will be none, the old replay buffer is wiped out. I can create a new Sentry Init, which allows recording to start buffering on the current page, but would like to try to get the Sentry object to stay around so I can buffer through out all pages. Does Sentry have a workaround in this instance?
Note that if I start the session replay for recording all instances instead of errors there are no issues since the recording can hop to the next tab. The issue only comes when buffering and switching pages in MVC which cleans out the old Sentry object/replay buffer.
Beta Was this translation helpful? Give feedback.
All reactions