Skip to content
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

Show Error When OTP is About to be Reused #18

Open
gestrich opened this issue Sep 13, 2023 · 2 comments
Open

Show Error When OTP is About to be Reused #18

gestrich opened this issue Sep 13, 2023 · 2 comments

Comments

@gestrich
Copy link
Collaborator

Loop will not allow an OTP to be reused. When submitting bolus + carbs, you need to send 2 OTPs. Rather than Caregivers needing to remember to wait between commands and not knowing until it fails on the Loop side, it would be nice if we showed an error as soon as we detect they are reusing an OTP.

ex: "You have already used the current OTP code. Wait at least 30 seconds between commands.."

@gestrich
Copy link
Collaborator Author

Just an implementation idea thinking about this..

  • In NightscoutDataSource, store the lastUsedOTP after each succesful OTP usage.
  • Instead of getting the current OTP like we do currently: credentialService.otpCode, we could have a throwing convenience method in NightscoutDataSource like the following:
func getValidOTP() throws -> String {
//Get the current code from credentialService.otpCode
//If it matches the last one sent, throw a presentable LocalizedError. That will propagate back to the client UI and show
//otherwise, return the OTP
}

@aug0211
Copy link
Contributor

aug0211 commented Jan 6, 2024

One UI concept I’ve dreamed of has been a visual countdown/timer showing the current OTP and its TTL. Once a command is sent with that OTP, it could be visually marked to show “you need to wait for the next one.”

Not sure how much OTP info is available (specifically, TTL) but I supposed the “status” of the OTP (already used by this device) could be at least helpful to see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants