kryptokrona / hugin-desktop

A secure and private messaging desktop application.
https://hugin.chat
GNU General Public License v3.0
42 stars 12 forks source link

Login takes a very long time to process #92

Closed mjovanc closed 1 year ago

mjovanc commented 1 year ago

When logging in, it takes like 10 or more seconds to actually login which should be quick. But perhaps it's because it's waiting from response from the node before rendering the dashboard. Because as soon as the popup notification appears I'm logged in.

n9lsjr commented 1 year ago

This is probably not a bug. Could you provide a more accurate measurement using the performance.now() timer in node? My tests give about 3 seconds. And we have added a sleep of 2 seconds before startup as you can see right here: https://github.com/kryptokrona/hugin-desktop/blob/main/src/backend/electron.cjs#L575. I will lower it to 500ms.

Swepool commented 1 year ago

Can it be related to checkNodeStatus() maybe ?

n9lsjr commented 1 year ago

Yes probably, if the node, internet access or computer is slow, it will prolong the login process

Swepool commented 1 year ago

We could restructure and move checkNode to dash, to get the feeling it's quick :P and then prompt if no node. Not a huge issue tho.

Den lör 25 feb. 2023 kl 16:12 skrev n9lsjr @.***>:

Yes probably, if the node, internet access or computer is slow, it will prolong the login process

— Reply to this email directly, view it on GitHub https://github.com/kryptokrona/hugin-desktop/issues/92#issuecomment-1445139499, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIXZUK43DBQOYRVF3TCKTEDWZIONHANCNFSM6AAAAAAVHZH7QE . You are receiving this because you commented.Message ID: @.***>

n9lsjr commented 1 year ago

That is true, we can probably move it without too much work and make it feel alot faster! 👍

mjovanc commented 1 year ago

Is this function asynchronous? If yes, it should not hinder. Right?

n9lsjr commented 1 year ago

Right now, the user is prompted to choose a working node before logging in. This was by design to streamline the login process and avoid some confusion when connecting to a bad node and not noticing. We can change this to pop up in the dashboard instead.

mjovanc commented 1 year ago

Alright, fine and dandy sir.