eduvpn/android

session expiry time double

efef opened this issue · 5 comments

efef commented

signal-2020-10-15-232204

When eduVPN server has session time set to 1 day, the android app gives the expiry time in both hours and minutes. So it shows the session is 2 days. I guess it would be better to show only hours, and last hour count in minutes or so

val minutes = context.resources.getQuantityString(R.plurals.certificate_status_minutes, timeDifferenceInSeconds.div(60).toInt(), timeDifferenceInSeconds.div(60).toInt())

I think .div(60) should be .rem(3600), twice. I am not sure if all the others are correct either, needs more review.

It seems the // Expires within 30 days is also wrong.

As I don't have Android Studio or similar I'm just coding blind, please review the commit... time calculation is always difficult. Do we have unit tests for this?

Reviewed, looks good. Included in my PR (#313).

Fixed in 2.0.2