Scripts being deleted when updated #2274

Closed
silverwind opened this Issue Sep 15, 2015 · 15 comments

Projects

None yet

3 participants

@silverwind
Contributor

Since 3.4, when I increment the version of a script like this and run the manual update check, I see a download bar and then the script seems to be deleted from the user's list with no way to restore, except a manual reinstallation.

When it happens a TypeError: oldItem is null is shown in the error console, pointing to this line.

@silverwind
Contributor

In case it matters: test.meta.js is symlinked to test.user.js on the server.

@janekptacijarabaci
Contributor

In case it matters: test.meta.js is symlinked to test.user.js on the server.

  • This setting has no effect.

Confirmed on:
GM 3.4

Not confirmed on:
GM 3.4beta3-

The problem is that commit: 47fac82

P.S. This probably is not good:
arantius@ed61cac#diff-4f75402aea01b39c35f95610c9571405R199
(this._script => script)

@silverwind
Contributor

Also, for what it's worth: If I try to reinstall the script, I can't get past the installation popup and the TypeError is seen on every click of the 'Install' button.

@janekptacijarabaci
Contributor

You must manually edit the file config.xml in the Firefox profile (and "gm_scripts") folder.
Delete this section: <Script basedir="null"...</Script>
(Firefox must be closed)

@arantius arantius added this to the 3.5 milestone Sep 15, 2015
@janekptacijarabaci
Contributor

One option might be to quickly release a new version, e.g. 3.4.1. But it's just a suggestion...

@arantius
Collaborator

Error seen in console:

1442434265425   addons.manager  WARN    InstallListener threw exception when calling onInstallStarted: TypeError: install.addon is null (resource:///modules/experiments/Experiments.jsm:871:1) JS Stack trace: 
Experiments.Experiments.prototype.onInstallStarted@Experiments.jsm:871:1 
< AMI_callInstallListeners@AddonManager.jsm:1744:15 
< AMP_callInstallListeners@AddonManager.jsm:2724:1 
< ScriptInstall.prototype.install/<@addons4.js:307:1 
< hitch/<@hitch.js:27:12 
< RemoteScript.prototype._downloadDependencies/<@remoteScript.js:527:7 
< hitch/<@hitch.js:27:12 
< timeout/observer.observe@timeout.js:17:7
@arantius
Collaborator

I'm not seeing the same failure. Can someone produce a detailed set of steps to reproduce please?

@arantius
Collaborator

Ah, possibly the same error, different STR:

  1. Open any page with a link to a user script.
  2. Open a separate window to the AOM.
  3. Install the script.
  4. Install the script a second time.

Step 4 implicitly uninstalls the existing script, to install the second copy. Update does effectively the same thing. Seems to trigger this issue. In the console:

TypeError: oldItem is null
observer_notifyEvent()     addons4-overlay.js:100
Config.prototype._notifyObservers()     config.js:39
Config.prototype._changed()     config.js:48
Config.prototype.install()     config.js:164
RemoteScript.prototype.install()     remoteScript.js:359
onOk()     install.js:77
anonymous()     dialog.xml line 375 > Function:1
_fireButtonEvent()     dialog.xml:376
_doButtonCommand()     dialog.xml:344
_handleButtonCommand()     dialog.xml:332
@arantius arantius added a commit to arantius/greasemonkey that referenced this issue Sep 16, 2015
@arantius arantius Update the AOM UI based on the kind of uninstall happening.
Refs #2274
780682d
@arantius
Collaborator
@janekptacijarabaci
Contributor

The original bug is fixed - for me.

This problem persists:
#2274 (comment)
...but, this doesn't apply to this version (GM 3.4).
Firefox 40.0.0 - 43.0a1 (2015-09-16)
GM 2.1.1 - 3.4.1beta1
...this error is still present for me.
Not confirmed on:
Firefox 39.0.3-

@janekptacijarabaci
Contributor

Unfortunately, I found another problem (if just one script is installed):

Confirmed on:
3.4.1beta1

1

Not confirmed on:
3.4beta3-

2

One option might be:

case 'uninstall'
...
setEmptyWarningVisible();
case 'install'
...
setEmptyWarningVisible();

and insert it (setEmptyWarningVisible();) after statement switch{}

@arantius
Collaborator

Did 3b621bc just after cutting the build for this fix.

@arantius arantius modified the milestone: 3.4.1, 3.5 Sep 17, 2015
@arantius
Collaborator

@janekptacijarabaci I really appreciate all the effort you put in, but wow you're hard to understand sometimes! I'm going to take "The original bug is fixed - for me." to mean it's worth moving forward with this dot release.

As far as the "just one script" thing you've mentioned just above, please report a distinct issue. And please include steps to reproduce; I don't know how to trigger it.

@arantius
Collaborator

Pushing 3.4.1 release with just this fix now.

@arantius arantius closed this Sep 17, 2015
@silverwind
Contributor

The fix looks to be working, thanks for the quick turnaround!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment