You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a bug in libWrapper, as it prevents libWrapper's "Settings" menu from appearing.
Describe the bug
If a package attempts to wrap a (previously libWrap'd) function without using libWrapper, libWrapper will attempt to automatically wrap the function anyway, assigning it the package ID of «unknown». While this kind of function is registered, attempting to open libWrapper's settings fails. The settings logic throws the following stack trace:
22:46:54.990 Uncaught (in promise) TypeError: can't assign to property "message" on "libWrapper: Invalid package ID '\xABunknown\xBB'": not an object
[Detected 2 packages: settings-extender, lib-wrapper]
render foundry.js:2012
promise callback*render foundry.js:2011
_onClickSubmenu foundry.js:31552
jQuery 9
activateListeners foundry.js:31536
activateListeners settings-extender.js:404
_render foundry.js:2077
call_wrapped libWrapper-wrapper.js:467
<anonymous> listeners.js:111
_render#0 libWrapper-wrapper.js:162
_render foundry.js:2736
render foundry.js:2011
_onSettingsButton foundry.js:34974
jQuery 2
dispatch
handle
Varriount
changed the title
[BUG]
libWrapper's settings application is unable to handle "improper" wrappers.
Oct 10, 2021
Varriount
changed the title
libWrapper's settings application is unable to handle "improper" wrappers.
The Settings Application is Unable to Handle "improper" Wrappers.
Oct 10, 2021
Thanks for the report! I have pushed a fix in version 1.10.8.0.
This issue was actually more in depth than the report. There were 3 bugs here:
In certain situations, the error message of libWrapper.register would not rely on the package ID provided by the caller when auto-detection failed,
The handling of "unknown" packages (i.e. those that fail auto-detection) was broken in the refactoring done for v10.
Foundry VTT 0.8.x does not like it when exceptions are thrown as a string, rather than as an error object (which is why the stack trace above is inside foundry.js).
Most users/devs wouldn't have noticed this, since in most cases the package ID would have auto-detected correctly and thus the issue wouldn't trigger. For the issue to trigger, it was necessary for the ID auto-detection to fail, which (except for very particular exceptions) should only happen when wrapping from the JS console.
v1.10.8.0 fixes all of these, and does some other code refactoring to improve maintainability and try and avoid similar issues in the future.
With these fixes, the settings dialog now opens as expected, even when doing non-libWrapper wrapping.
I'm closing this now, but feel free to re-open if you notice any remaining issues.
ruipin
changed the title
The Settings Application is Unable to Handle "improper" Wrappers.
The Settings Application is unable to handle manual wrappers when package ID auto-detection fails.
Oct 10, 2021
This is a bug in libWrapper, as it prevents libWrapper's "Settings" menu from appearing.
Describe the bug
If a package attempts to wrap a (previously libWrap'd) function without using libWrapper, libWrapper will attempt to automatically wrap the function anyway, assigning it the package ID of
«unknown»
. While this kind of function is registered, attempting to open libWrapper's settings fails. The settings logic throws the following stack trace:(
\xAA
and\xAB
are the double-arrow marks)To Reproduce
Steps to reproduce the behavior:
Expected behavior
libWrapper's settings application opens.
Screenshots
If applicable, add screenshots to help explain your problem.
Technical Details (please complete the following information):
The text was updated successfully, but these errors were encountered: