Page MenuHomePhabricator

#invoke do not record the main module in package.loaded
Open, Needs TriagePublic

Description

Begining around the first week of december 2015, I have some difficulties to manage versions of modules. For this I use package.loaded.

Each require() records well the module in package.loaded, but #invoke do not that. Before, this was working fine.

To verify this, I just make 2 modules in french wikisource, used in their discussions: Module:TestRequire and Module:TestpackG

Event Timeline

Rical created this task.Jan 2 2016, 10:08 PM
Rical updated the task description. (Show Details)
Rical raised the priority of this task from to Needs Triage.
Rical added a subscriber: Rical.
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald TranscriptJan 2 2016, 10:08 PM

Each require is well recorded in package.loaded

Where exactly can this be seen if I wanted to reproduce the problem?

Rical added a comment.Jan 4 2016, 12:04 PM

The 2 test modules, TestRequire and TestpackG list the content of package.loaded (and of the global _G space for my own use). Exactly with the same code.
The only difference is the require() in TestRequire.
To increase the confidence in the test, I use twice the same instruction to list, one to detect "ext", the other to detect "Module".
The result lists 1 module when it is require(), and no module when it is #invoke, which denotes the bug.
Thanks for your attention, and sorry for this difference hiden between many others.

Rical renamed this task from #invoke seems do not record the module, for some weeks. to #invoke seems do not record the module.Feb 19 2016, 9:27 PM
Rical updated the task description. (Show Details)
Rical added a comment.Feb 19 2016, 9:42 PM

To restore the main module in my case, I use:
local gettitle = mw.getCurrentFrame():getTitle() -- to get the mainmodule title
module = centre.pcallrequire(gettitle) -- require() must not fail in case of error.

For many other uses, this bug have no impact, but we need to repair that.
Find the origin or the bug is probably longer than repair it.

Rical added a comment.EditedFeb 20 2016, 9:17 AM

The bug appears probably around 2015-11-25 to 2015-11-28 if we look at my comments in history, when I begin to search the main module date and time.
To better understand what happens, I edit my file in local Jedit and try the module 20 to 100 times a day.
I record the module only when I get enought stable running. History of the module:

  • (actu | diff) 2015-12-01T14:18:22‎ Rical . . (find_main_module OK ?) .................. [ when I realy found the main module, using mw.getCurrentFrame():getTitle() ]
  • (actu | diff) 2015-11-28T09:55:37‎ Rical . . (find_main_module) .................. [ when I probably understand that I have to search the main module, but without mw.getCurrentFrame():getTitle() ]
  • (actu | diff) 2015-11-25T11:43:11‎ Rical . . (The versions management seems OK) (annuler)
Anomie added a subscriber: Anomie.Feb 20 2016, 1:39 PM

Before, this was working fine.

Please indicate the specific version of Scribunto in which this was "working fine". I can't manage to reproduce it locally, even reverting much farther back than you've specified. As far as I can determine the module from the #invoke was never included in package.loaded.

Rical added a comment.Feb 20 2016, 2:37 PM

Sorry for the ambiguity. I edit the module in local Jedit, and for each try I copy the code of the module in the standard edit window,
in the standard public page https://fr.wikisource.org/wiki/Module:Central or some other.
The version of Scribunto is the standard version in standard MediaWiki at each date, for fr.wikisource.
I never look at this version.

The version of Scribunto is the standard version in standard MediaWiki at each date, for fr.wikisource.

Unfortunately, as I said, I can't manage to reproduce your old behavior locally with the relevant versions.

Rical renamed this task from #invoke seems do not record the module to #invoke do not record the main module in package.loaded.Apr 26 2016, 6:58 AM
jayvdb added a subscriber: jayvdb.Apr 27 2016, 6:41 PM