capella-collab-manager icon indicating copy to clipboard operation
capella-collab-manager copied to clipboard

Display time until session will be terminated

Open MoritzWeber0 opened this issue 10 months ago • 2 comments

Users want to see the time left to termination because of inactivity to be able to react e.g. by performing some action in the session to avoid termination.

Originally reported in https://github.com/DSD-DBS/capella-collab-manager/issues/621.

MoritzWeber0 avatar Apr 03 '24 13:04 MoritzWeber0

I had a quick look at this and just wanted to provide some thoughts.

First of all, it seems that we currently do the idletime processing in the backend, i.e. we take the idletime and return a human readable string. For example, for idletime 45 we would return 45 mins ago and for 65 we would return 1.1 hrs ago. This does not seem like a good idea as it reduces the flexibility to handle such data in the frontend and other places. Therefore I would return the idletime as it is or convert it to a proper date format, see my next comment.

To me, the name last_seen suggests that we are returning the datetime when the session was last seen, and idletime would be a much better name for the current meaning. This can also be seen in some stories where a date has been used for this field. I see two options here that we can choose from. We can either keep the name last_seen, but in this case I would transform the idletime into a proper datetime, or I would rename this field to idletime and return the corresponding value directly. In both cases, it might be a good idea to add a custom angular pipe that converts the value to a human-readable format, which is what is currently done in the backend.

Finally, to implement showing the user the time until termination, I see two possibilities. Either we can return something like terminate_at or terminate_in which returns either the termination datetime or the time until termination in minutes, or we have to somehow propagate the maximum session idle time.

dominik003 avatar May 06 '24 16:05 dominik003

First of all, it seems that we currently do the idletime processing in the backend, i.e. we take the idletime and return a human readable string. For example, for idletime 45 we would return 45 mins ago and for 65 we would return 1.1 hrs ago. This does not seem like a good idea as it reduces the flexibility to handle such data in the frontend and other places. Therefore I would return the idletime as it is or convert it to a proper date format, see my next comment. To me, the name last_seen suggests that we are returning the datetime when the session was last seen, and idletime would be a much better name for the current meaning. This can also be seen in some stories where a date has been used for this field. I see two options here that we can choose from. We can either keep the name last_seen, but in this case I would transform the idletime into a proper datetime, or I would rename this field to idletime and return the corresponding value directly. In both cases, it might be a good idea to add a custom angular pipe that converts the value to a human-readable format, which is what is currently done in the backend.

Agree, we should use a iso formatted string and make it human-readable in the frontend. idletime sounds like a better name.

Finally, to implement showing the user the time until termination, I see two possibilities. Either we can return something like terminate_at or terminate_in which returns either the termination datetime or the time until termination in minutes, or we have to somehow propagate the maximum session idle time.

terminate_in sounds good, I'd say. terminate_at sounds like it's a hard time that will not change.

MoritzWeber0 avatar May 06 '24 16:05 MoritzWeber0