TreyWW / MyFinances

MyFinances is a web application that can help you as an individual, or team, manage your finances!
https://docs.myfinances.cloud
GNU Affero General Public License v3.0
85 stars 121 forks source link

bug: After logging in page is not fully loaded #413

Closed Domejko closed 3 weeks ago

Domejko commented 3 weeks ago

What version of MyFinances are you currently using?

v0.4.5

What device type are you currently facing the issue on?

Desktop

Describe the bug

After logging in seams that page is not fully loaded, Dajngo debug toolbar is not visible, "Logged is as", and notifications as well, but profile picture is loaded and all invoices, clients etc are in place. When you press notification button all notifications are also there. You can swap to different tabs like Invoice, Clients and nothing change, only after refreshing whole page debug toolbar show up along with notifications and as who we are logged in.

Before refreshing the page: Screenshot from 2024-06-13 13-53-54

After refreshing: Screenshot from 2024-06-13 13-57-28

TreyWW commented 3 weeks ago

Related to #320

Domejko commented 3 weeks ago

Related to #320

Ah sorry I was searching through topic but apparently wasn't searching good enough... You want me to delete this one or keep it due to some more details ?

I think that it's possible that in backend/views/core/auth/login.py

    try:
        resolve(next)
        response["HX-Location"] = next
    except Resolver404:
        response["HX-Location"] = "/dashboard/"

    return response

is not fully loading the page and that's why only after refreshing page when we get redirected through different function page is fully loaded and we are able to see everything.

With some free time I will take a closer look on that.

TreyWW commented 3 weeks ago

Great catch! Yeah I'll close my issue, you've provided more details. I can assign you to this too and you have no rush to take a look at it. Appreciate it!

TreyWW commented 3 weeks ago

I have swapped HX-Location with HX-Redirect, this way everything is still HX-Boosted, the user notices nothing different, and all content is re-fetched this way. There's no content on the login page that would be useful anyways, so I feel this is a simple yet effective fix.