-
Notifications
You must be signed in to change notification settings - Fork 354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add refresh AccountCache from VoucherRedeemer #5345
Add refresh AccountCache from VoucherRedeemer #5345
Conversation
DROID-429 Account expiry time not updated after redeeming voucher
After redeeming a voucher in the account screen the expiry date is not updated until leaving the screen and coming back again. |
6117d59
to
bae5554
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should wait with merging until Albin is back though.
Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's go ahead with this workaround 👍
Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Rawa)
android/service/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/VoucherRedeemer.kt
line 43 at r1 (raw file):
if (result is VoucherSubmissionResult.Ok) { val accountExpiry = AccountExpiry.Available(result.submission.newExpiry.parseAsDateTime()!!)
Is the intention to crash if the date parsing fails? Would probably be nice to avoid crashing the service if possible, since that would also kill the tunnel.
Code quote:
parseAsDateTime()!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @albin-mullvad)
android/service/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/VoucherRedeemer.kt
line 43 at r1 (raw file):
Previously, albin-mullvad wrote…
Is the intention to crash if the date parsing fails? Would probably be nice to avoid crashing the service if possible, since that would also kill the tunnel.
I see what you mean with crashing the service, but at the same time if we get something that is not able to be parsed to a DateTime we really want it to crash because the interface between service and daemon is faulty. If we just fail silently with some log it might be that we miss it and let it sneak out as a bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Pururun)
android/service/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/VoucherRedeemer.kt
line 43 at r1 (raw file):
Previously, Rawa (David Göransson) wrote…
I see what you mean with crashing the service, but at the same time if we get something that is not able to be parsed to a DateTime we really want it to crash because the interface between service and daemon is faulty. If we just fail silently with some log it might be that we miss it and let it sneak out as a bug.
As we discussed offline, using !!
comes with a certain risk so we'll create a separate issue to look into this further. @Pururun let's add null safety to this PR.
@Rawa please create an issue and share here 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Pururun)
android/service/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/VoucherRedeemer.kt
line 43 at r1 (raw file):
Previously, albin-mullvad wrote…
As we discussed offline, using
!!
comes with a certain risk so we'll create a separate issue to look into this further. @Pururun let's add null safety to this PR.@Rawa please create an issue and share here 🙏
After internal discussions we have decided lift this change out of this PR and make an issue for the future since it needs more testing and aligning with the internals of the daemon. For now we will try and allow it to be nullable.
9dbd3c4
to
6868f83
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved
6868f83
to
64f3900
Compare
This PR includes a temporary workaround to allow VoucherRedeemer to update the AccountCache (expiryTime) once the user has redeemed a voucher through the app.
This change is