Scirra / Construct-bugs

Public bug report submissions for Construct 3 and Construct Animate. Please read the guidelines then click the 'Issues' tab to get started.
https://www.construct.net
104 stars 83 forks source link

UI state changes when going back to free edition and doesn't get changed back when logging back in #8095

Open skymen opened 3 weeks ago

skymen commented 3 weeks ago

Problem description

If I have a UI layout with paid features in it (like the Z order bar), logging out removes them from my layout, but logging back in doesn't add them back

Attach a .c3p

n/a

Steps to reproduce

  1. Add z order bar
  2. log out
  3. log back in

Observed result

z order bar doesn't get added again

Expected result

the layout should be back to what I have it set up to

More details

This is painful because account disconnects happen all the time in C3 when opening different versions and so it makes it very painful to setup custom UI layouts because if I use any of the bars that are hidden by default, they will get randomly reset whenever C3 decides I'm not logged in anymore.

Affected browsers/platforms:

First affected release:

System details

View details PASTE HERE
Kashin-Ginn commented 3 weeks ago

+1

F3der1co commented 3 weeks ago

hot take: to fix this you could just remove the ui restrictions from the free versions, I don't really think they are relevant as they wouldn't allow you to suddenly make games in the free version, but instead would be a selling point as the person trying might really like and need that feature in case they go for the subscription.

AshleyScirra commented 3 weeks ago

Why are you getting logged out? Switching versions of Construct should not cause your login to be forgotten. It's all on the same origin so if your login is remembered for one version, it should be remembered for all versions. This works for me - I can switch between r388.2 and r397 for example, and it remembers my login whichever one I'm on.

I'm not sure this will be feasible to fix - if you have the Z order bar docked somewhere, log out, rearrange the panes, and then log in, I don't think it's reasonable for the editor to know how to put the Z order back, unless it completely changes your UI, which I don't think it should do either. Meanwhile the Z order bar being a subscription-only feature means it is not displayed to free edition users, unless we completely overhaul the way the free edition restrictions work, which I don't think is feasible to do in response to a relatively minor issue like this, as such overhauls usually just end up running in to some other issue. So the easiest approach is to make sure you stay logged in.

F3der1co commented 3 weeks ago

I often accidentally log myself out as I use c3 both on my desktop PC and Laptop. There is also the 7 day log-out which might be an issue for people not using c3 super regularly.

skymen commented 3 weeks ago

Why are you getting logged out?

This has always been an issue, switching from beta to stable will almost always log me out in the process, and logging into the other branch updates which branch I'm logged into, I've just gotten used to it at this point, but I've had the issue for the past 3 or 4 years, and I remember the issue being reported multiple times in the past including by me.

IIRC, back in the days the bug would happen when switching from any version to any other version, but nowadays it only happens when changing from beta branch to stable branch or vice-versa.

Here's a video, it happens almost every single time:

https://github.com/Scirra/Construct-bugs/assets/11213825/53091f59-4476-4aca-a1f7-dd965f5f6f5f

if you have the Z order bar docked somewhere, log out, rearrange the panes, and then log in, I don't think it's reasonable for the editor to know how to put the Z order back

I agree with the reasoning and I'm not asking for the Z order bar to get added back in case I make changes to the editor layout while in free version. Just in case I don't change it at all and all I do is log out and log back in. Here is a video showing the problem:

https://github.com/Scirra/Construct-bugs/assets/11213825/3a9fc6f1-6662-4833-a0b3-abf89d800ab1

Since I work on stable when possible, this mostly means that just checking out the new weekly beta update would affect my UI. I've experimented with new UI layouts, but I've always given up in the end in big part due to this bug. However, this is now very important since I really really want the new Instance bar to always be open, but I can't if it's gonna disappear at least once a week.

EDIT:

More info about the branch switching log in state.

I think, the two branches hold log in info separately, because when I log out of a branch and log into another branch, I'm still logged out of the first branch. Now in theory what this would mean is that I should just stay logged in on both branch and I'll be fine, however I'm pretty sure there is a timeout and it feels like the timeout is pretty short, because after a few days (or maybe even a few hours? I can't really tell), the last branch I logged into will stay logged in, but the other one logs out, and so when I go back to it, it'll ask me to log back in, even though I'm logged in on the other branch.

Anyway, I don't know exactly why this happens and how the issue works, but it's been happening very consistently for years, and I know it happens to other people who also switch back and forth between beta and stable a lot.

skymen commented 3 weeks ago

Dug some more, and yeah it's normal that it's holding login info separately, because it is.

Main branch logs in through https://account.construct.net and beta branch logs in through https://accountbeta.construct.net, and so the keyvaluepair for each domain is not shared

It's all on the same origin so if your login is remembered for one version, it should be remembered for all versions.

Maybe your account goes through a different thing, but on my end it's not shared.

Reading through the auto login code, since the storage is not shared, the only thing that can trigger the autologin to fail on a branch but not the other is for the server to reject the token on one of them.

A few guesses:

Anyway, I've set a debugger on the piece of code that fails auto login, hoping I'll get some more info in the future. If I manage to reproduce this and have a server error message, I'll send it over as well