Wednesday, February 22, 2023
Have you ever had those moments when an end-user calls you out of the blue with a disturbing message about your app?
It happened to me last week; an end-user called in a panic with the message, "all my inspections are gone!"
FYI: This Oracle APEX application manages all inspections a company is doing. Those inspections are grouped into different categories.

Records don't disappear automatically, so my mind immediately started to think about the potential reasons why this might have happened:
- Did we update the app with an invalid WHERE clause or a bad JOIN?
- Did a user do a bulk delete action or delete a parent record that caused the child records to go?
- Did we have a DELETE process that didn't have a condition?
On the call, I asked the user to tell me what he saw. It was weird indeed; the categories showed there were zero inspections.

But this one category (Thermography) still had two inspections... bizarre.
I asked a few more questions and got the answers that parents or children were not deleted, bulk actions were not executed, and the records were there in the morning but were gone in the afternoon.
As we didn't deploy a new version of the app, and it worked before, it was a bit of a mystery to me.

I love to use APEX Project Eye (APE) to bring my theories to life. APE is a powerhouse of tools that helps any Oracle APEX developer and project manager. For me, APEX Project Eye is for Oracle APEX, what Enterprise Manager is for the Oracle Database. APE is the most advanced tool to give you insight into your Oracle APEX applications, from how it was developed to how it is being used.
Back to our investigation on the disappearance of the records... I focused on the window from the morning when the records were there till the records disappeared. In APE, I used Session Flow to see who accessed the application during this period and accessed a page where a delete could have been done. I saw an unusually high number of going back and forth between a report and a form... In Session Flow, it shows lines between pages. The bigger the line between the pages, the more that path was taken. Session Flow also allows you to replay a session. The path gets highlighted, and you get the details of the request.

This way, I knew exactly what happened... somebody went into the records individually and deleted them. APE gave me the power to present the end-users precisely when somebody made an action visually.
We use APEX Project Eye a lot; during development (e.g., quality assurance), during testing, e.g., to review performance and error investigation, and during production to monitor our applications. Session Flow, in particular, is beneficial when APE shows an end-user got an error.

For the error, we see the Session ID, and based on this Session ID, we can replay their session until the error pops up. We know exactly what they did and don't have to ask for a reproducible case.