-
Notifications
You must be signed in to change notification settings - Fork 4
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
Multi-user Support #59
Comments
For anyone who want to test out the new feature. Give it a try and let me know your feedbacks: Branch: NOTE that this is a breaking change, requiring a new env var to be set (see README). Please backup your data/ directory in case you want to rollback. |
Some initial feedback this change now seems to require https. When running under http HabitTrove no longer loads with the following error: TypeError: crypto.randomUUID is not a function I added a simple https proxy to put things and the interface loaded but when I got to pressing login I started getting other certificate errors in the console and a 500 error on the request sent when pressing the login button. I don't currently have certificate stuff set up to easily get proper ssl certs set up on this server that I have available to test currently. I can work on getting that set up and then I can come back to this and give you more feedback. |
Interesting, I believe this I could be wrong but I don't think the error is related to the http certs. |
I am running the dohsimpson/habittrove:dev docker container which is node v18.20.6. As per the Mozilla web dev docs crypto is only available in secure contexts. See note at the top of this page: https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API I’m not the most familiar with node apps so forgive me if I’m wrong or missing nuance here but it appears that the actions/data.ts file that’s has had the crypto.randomUUID call the whole time is on the server side (it has the ‘use server’ directive at the top) while the lib/types.ts doesn’t have that same directive at the top of the file which I assume is where the browser is having issues where before that call wasn’t exposed to the browser. When I looked at it in the browser dev tools it is somewhat minified and/or I’m missing a good way to correlate exactly which file it’s failing on so I’m not positive but this is just my guess without having taken the time to build/run the app in a dev environment to debug it directly. |
yeah, that makes sense. types.ts is imported by both server side and client side. And since crypto is a node only module, importing from client side would cause a problem. In particular, I think it might be the import here that throw the error. |
I replaced the crypto.randomUUID function with the browser-compatible uuid library, which should fix this issue. Feel free to try out the latest docker image. |
That’s working now! Thanks! From a quick initial test it is looking great! I’ll dive in deeper and get you some more detailed feedback. |
Overall it’s a really great start. The overall user experience of multiple users is really good and the feature set is solid! Here are some more detailed findings though. Shared item Coin event issuesThere seem to be some inconsistencies with how coins are handled when it comes to shared items. My assumption would have been that the item state was shared but the redemption or completion of items would only affect the balance of the user clicking the button. The following things came up that didn’t seem to act as I would have expected.
Password related findings
Random nitpicks
|
latest commit and dev image addressed the following:
|
I guess one thing missing is admin doesn't have a way to view the transactions of other users. Probably want to fix this before release. |
Giving everything a good run through currently and I’ll report back more details but on this note the coins transactions page does show all transactions by all users when logged in as admin. It has the indicator with who did each transaction. Are you thinking like a view to see their daily habit status or summaries of how many coins users have? I’m trying to think through my use cases and for the most part it’s good enough for me to switch user into the user I want to look at. Maybe an impersonate button would be nice for password enabled users? The UI/UX is really good as is and I don’t know that I would want it polluted with too much extra information in the same interface but maybe there is room for a separate page for advanced administration or something. |
Ignore my comment here about it being there. It was there previously but I hadn’t updated to the very latest before commenting. Which was silly of me. On the latest it is not showing transactions if other users. Things are looking really solid. Just a few notes now I’ve walked through the different error cases seen before:
|
Overall, thanks so much for the through review!! Really appreicate your help in opening the issue for this feature and making this release better! @AsocPro |
Add multi user support as described in #9
The text was updated successfully, but these errors were encountered: