Getting Expired Dialog Session Based Upon Context_Expiry Column

Hi
I was working on my custom module and one of my use case is to get all expired rows based upon context_expiry column from dialog_sessions table
The thing is context_expiry as well as session_expiry column data gets updated everytime, Its always in the future, doesn’t matter if user is talking to bot or not.

Where we can check when was the first time user session gets expired or is expired or how can I get all the rows where context has been expired?

Lets say in this scenario the context_expiry (highlighted in the image) will get updated again at that time.
Do you save this info anywhere in the database, the first time when context was expired ?

Hi,
ı got the same problem . I have 3 - 4 month session in dialog_session table. While db has big data dialoge engine responds late sometimes. How can we set expiry session ?
If session got the timeout it should be cleared or removed. But i couldn’t it. Have any idea ?

Well… I check the code written in src\bp\core\services\dialog\janitor.ts which is processing the timeout,
There is a method “_processSessionTimeout” which is resetting context expiry and session expiry in the future of all the expired contexts rows everytime. That is why the session is also not getting deleted!!
The function that is resetting the contexts and sessions expiry is written in the finally block, May be its a bug, lets hear from them.

Thx man… You are right . Why is this method used , can anyone help for this ?
Should we update or remove the method named “_processSessionTimeout” ?
Is it really bug or etc ?