-
Notifications
You must be signed in to change notification settings - Fork 278
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
Fetch on demand #1076
Fetch on demand #1076
Conversation
In order to allow for more fine-grained control and better separation of concerns. The "enter password" part of DisplaySecret is now in it's own function.
This makes understanding the logic just a little easier and also avoid an if in `useEffect`.
Instead of loading a secret based on the key provided in the URL now load it only when we have a password. By doing this we all users to have a way to send YoPass links using systems that fetch each page that they deliver.
By move `setSecretInfo` into the `try` we ensure that the `finalize` call is also made fixing some edge case when reloading during development.
Codecov Report
@@ Coverage Diff @@
## master #1076 +/- ##
==========================================
- Coverage 80.00% 78.16% -1.84%
==========================================
Files 6 6
Lines 390 403 +13
==========================================
+ Hits 312 315 +3
- Misses 52 58 +6
- Partials 26 30 +4
Continue to review full report at Codecov.
|
Thanks for taking another stab at this! Will take a review in the coming days 👍 |
Signed-off-by: Johan Haals <[email protected]>
@boekkooi-lengoo I have not forgotten this PR, It's just been super busy with work/life lately. However I took a look at this PR last night and made some modifications. I want to give it another go later this week when I have some hack time at work. I think it looks a lot better now, have a look yourself and see if you could spot some ways of improving it. Perhaps the useEffect can be reduced now as well but I haven't tried it out yet. |
Hey @jhaals, Thanks again for your time and due diligence. |
Hey @jhaals So I finally got some time and found the issue that your commit re-introduces which is the following. Go to http://localhost:3000/#/ and create 2 secrets, the first one having
|
This adds a basic tests showing that a secret is fetched only after it is first entered.
Ensure that the password is reset when the key changes.
600f5d0
to
853dc08
Compare
Okay it feels like this has been waiting long enough, nice work adding some tests as well 👍 |
Hey,
This is my second stab at resolving one of the the issues described in #741.
This PR changes the way secrets are loaded by requiring the need of having a password before loading the secret.
Please let me know what you think and if I should move 6dd70b3 to another PR or not.
Cheers,
Warnar