Skip to content
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

Script reloading during package manager usage and popups bugs #210

Open
regorxxx opened this issue May 2, 2023 · 4 comments
Open

Script reloading during package manager usage and popups bugs #210

regorxxx opened this issue May 2, 2023 · 4 comments

Comments

@regorxxx
Copy link

regorxxx commented May 2, 2023

WshShell.Popup instances keep running after closing package manager and SMP panel, which turns into weird bugs since the panel gets reloaded after closing the later.

For ex. this popup fires as soon as the package manager is closed:
image

But then the script is reloaded when the SMP panel window is closed again. That behavior is totally prone to errors when using packages, since the script is loaded multiple times while the window is opened.

The problem comes when popups are present. They are spanned multiple times (since the script keeps reloading everytime you click ok). And the window doesn't close while there is a popup box asking for user input.

When you close one of the popups, since it's trying to reference a script variable no longer present (due to reloading), it crashes.
plm3

In other words, if the user keeps trying to close the SMP window before closing the popups.... it may well get 10 copies of the same popup and 10 crashes of the same panel in a row.

@regorxxx
Copy link
Author

regorxxx commented May 2, 2023

All this makes popup calling totally incompatible with package loading, since it will always break the panels on first installation unless the user is pointed to first close all popups.

@regorxxx
Copy link
Author

regorxxx commented May 2, 2023

Attached the recording of another user with this problem.

Grabacion.de.pantalla.desde.2023-05-02.23-35-39.mp4

https://hydrogenaud.io/index.php/topic,120979.msg1026417.html#msg1026417

@regorxxx
Copy link
Author

regorxxx commented May 2, 2023

As shown here with irony, there is no way to stop script execution at that point:
https://hydrogenaud.io/index.php/topic,120979.msg1026438.html#msg1026438

const infoPopup = WshShell.Popup('This script has been installed as a package.\nBefore closing the \'Spider Monkey Panel configuration window\' all popups must be closed, take your time reading them and following their instructions.\nAfterwards, close the SMP window.', 0, window.Name, popup.info + popup.ok);
if (getPropertiesValues(properties, 'plm_').filter(Boolean).length === 0) {
	throw new Error('READ THE POPUPS AND STOP CLICKING ON BUTTONS WITHOUT READING!!!\nOtherwise TT, aka GeoRrGiA-ReBorN\'s master, will try\nto kill you with their bad jokes.\n\nReally, read the popups and make our lives easier.\n\nThanks :)');
}

I check after the popup if the properties are accessible (they don't) and I'm able to identify when the panel has been reloaded before closing a popup, but at that point there is no way to do anything but throwing. There is no window.stop(), or any way to simply stop running anything more or silently crash the script instance (and continue with the main one).

@regorxxx
Copy link
Author

regorxxx commented May 19, 2023

So essentially did something like this:
https://hydrogenaud.io/index.php/topic,120979.msg1027526.html#msg1027526
plm

Forcing the user to click a button after installing the script (and that would start the standard loading of the script, with popups, etc.). And since the mouse callbacks are disabled while SMP windows are opened, that's fine. Anyway this is just a workaround.

regorxxx added a commit to regorxxx/Playlist-Manager-SMP that referenced this issue May 29, 2023
…foobar2000.

- UI: script will be completely disabled after installing for the first time until user clicks on the setup button (which will initiate a serie of popups). This is a workaround for a [SMP bug](TheQwertiest/foo_spider_monkey_panel#210) during the installation process.
Resolve #41
regorxxx added a commit to regorxxx/Playlist-Manager-SMP that referenced this issue May 29, 2023
…st time until user clicks on the setup button (which will initiate a serie of popups). This is a workaround for a [SMP bug](TheQwertiest/foo_spider_monkey_panel#210) during the installation process.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant