Infinite recursion on incorrect password attempt when importing PDF
anandubajith opened this issue · 4 comments
Describe your Environment
OS: Mac Ventura Apple Silicion
Paisa Version: 0.5.1
Browser: Arc
App Variant: N/A
Describe the bug
If we accidentally try to open a password protected PDF file which we don't know the password for, there is no way to exit out of the same.
To Reproduce
Steps to reproduce the behavior:
- Go to Ledger -> Import
- Open a password protected PDF file
- Enter incorrect password
- Keeps prompting again and again for password with no way to exit out of this ( there is option to prevent page from creating more alerts , but it's not ideal )
Expected behavior
Should stop prompting for password after N attempts, or allow the user to choose a different file
Screenshots
https://github.com/ananthakumaran/paisa/assets/3852827/b64db59f-8828-4d9a-91a5-0d84de74b15f
Journal
N/A
Related PR: #119
I noticed the issue during the first implementation and didn't fix it because the underlying library didn't provide a clean API to solve this problem. I will have another look at the issue
@ananthakumaran Thanks!
According to this discussion, throwing error inside the onPassword
callback seems to be the way to go
Cancel should now actually cancel the prompt.