felixkmh / StartPage-for-Playnite

MIT License
37 stars 6 forks source link

Configured views not set correctly after updating #125

Closed darklinkpower closed 2 years ago

darklinkpower commented 2 years ago

I've had this issue two times already where the configured views don't show as I've previously configured. The two times it has happened has been right after updating to a new StartPage version.

This is how it looks after updating:

image

The view that is on the upper left, was in the panel below like this before the bug. This is after moving it to the previous place.

image

Notice that even after moving, there is another Game Shelve in that same panel. So it seems that for some reason, the plugin placed two different `Game Shelvesviews in the same Panel:

image

This is the the configured panels before the bug happened: image

After the bug, the configuration I had for the Game Shelves panel below got reverted to a configuration I had before and not the latest one so some shelves went missing, filters got reverted, etc.. This happened the previous time too:

image

There's nothing in the logs about the StartPage extension.

darklinkpower commented 2 years ago

Does the plugin have some sort of config backup system? Because both times it has reverted back to the same old configuration

felixkmh commented 2 years ago

Not really. I just stored a default layout that is loaded if there is no layout present. Otherwise users would be greeted with an empty screen when they installed the extension.

felixkmh commented 2 years ago

Could you provide your config.json files for StartPage? Either broken ones or the ones that broke after an update. I never had an issue like that when updating.

darklinkpower commented 2 years ago

That's weird. Do you have any idea why it could be reverting back to that specific configuration then?

I recreated how I remember I had it before the bug happened the two times:

config.zip

felixkmh commented 2 years ago

Also, for game shelves, the config is not stored as part of the layout. It is stored separately in a dictionary with an Guid as the key. Maybe that leads to the effect of it reverting when the layout breaks.

felixkmh commented 2 years ago

I cannot replicate this behavior. I loaded your config with v2.3.1, then updated to v2.3.2. Everything looks the same. But I may have an idea what happens when your layout is broken. What it sounds like is, that multiple nodes of the layout tree have a shelve view with the same instance id. Also, only leaf nodes are supposed to have views, but apparantly in your case, also non-leaf nodes have views, leading to the stacking of views. Although I was sure that even if a non-leaf node had a view, it should not be visible. Maybe I will put more validation in place when loading and saving the layout tree, but I don't really know why this happened when updating.

felixkmh commented 2 years ago

Was there maybe something else causing Playnite to crash when exiting/updating which could have corrupted the config file?

darklinkpower commented 2 years ago

No, it has not crashed. But even if that was the case, I've closed/restarted Playnite several times after initially configuring the views so the saved config file should be there, which makes me wonder why it is reverting to this specific, old views configuration. There's also the issue that when this happens, there are two Game Shelves place in the same panel. I'll see if I can find something the next time it happens.

darklinkpower commented 2 years ago

It happened once again. Nothing special happened, I just have closed and started Playnite normally.

image

The config file without moving anything: config - 1.zip

https://user-images.githubusercontent.com/1389286/166190355-60cca741-082d-41a9-89fb-c9decdd7886d.mp4

darklinkpower commented 2 years ago

I just noticed that in the video above, it seems to think that the Clock is the active view in the panel?

image

felixkmh commented 2 years ago

I just noticed that in the video above, it seems to think that the Clock is the active view in the panel?

image

Items that cannot be added are disabled. In this case, there is already a clock in the panel to the right and clocks cannot have multiple instances, so it is disabled. Everything else can be added because it allows multiple instances (Game Shelves) or does not exist yet in any panel. So this is the expected behavior.

felixkmh commented 2 years ago

I at least know why it looks like that. For some reason the dictionary that stores the shelve config for each shelve instance is empty. If a shelve with no config is requested, the first one that is always stored as the default one is used. So the one in the top right apparantly requests its view first, giving it the view that would usually be below it. Every request after that just gets an empty shelve.

felixkmh commented 2 years ago

Also I suspect that it happens whenever the settings view is canceled instead of saved.

felixkmh commented 2 years ago

Also there is no issue of stacked views. You simply swapped the empty shelve view with a non-empty one. It just looks like the one on the bottom is an empty panel because the buttons are too far down. You can tell that there must be a shelve view attached to that panel by the settings icon in the top right corner.

felixkmh commented 2 years ago

You can try this and see if it happens again. Like I said, I think it was happening whenever the settings view was closed without saving. felixkmh_StartPage_Plugin_2_3_2.zip

darklinkpower commented 2 years ago

Does the new update include that fix? Now that I remember I have opened the settings window and canceled so it could very well be the cause of the issue. I'll let you know if it happens again

darklinkpower commented 2 years ago

It happened again :(

I was checking something and was starting and closing Playnite in a few seconds, other than that I can't think of anything since I didn't even open the StartPage view image

felixkmh commented 2 years ago

I didn't even open the StartPage view

Which is probably the reason that happened again xD To prevent unused instances from being stored, I only save those that have actually been loaded when Playnite exits. But if StartPage is never opened, nothing will have loaded and all instances are discarded. Should be an easy fix.

darklinkpower commented 2 years ago

Yeah I can reproduce it now by Start Playnite -> Exit Playnite (Without opening Start Page) -> Start Playnite again and go to Start Page.

I'll see if it happens with the new version and report.

darklinkpower commented 2 years ago

It seems to be fixed with 2.3.4 so I think the issue can be closed. If it happens again I'll let you know.