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

Replace direct QtScript usage with an isolating interface. #1200

Open
wants to merge 41 commits into
base: master
Choose a base branch
from

Conversation

odysseus654
Copy link
Contributor

@odysseus654 odysseus654 commented May 2, 2021

This is documenting my attempts to isolate QtScript to interfaces that we control, to enable us to add or replace scripting engines in the future.

@digisomni digisomni added do not merge do not merge due to issues or pending updates enhancement New feature or request labels May 3, 2021
@digisomni digisomni marked this pull request as draft May 3, 2021 01:56
@odysseus654 odysseus654 changed the title [incomplete][do not merge][do not compile] Attempt to isolate QtScript Attempt to isolate QtScript May 3, 2021
@odysseus654 odysseus654 force-pushed the feature/scripting branch 6 times, most recently from e20b6cd to 3308d06 Compare May 8, 2021 08:12
@daleglass
Copy link
Contributor

I've been looking this over a bit. Overall it looks good, but this is going to need documentation about what you're doing here, what's changing, and what the desired end state is.

So for instance:

  • What are the high level changes being made?
  • Why are we changing from QScriptValue to ScriptValuePointer?
  • Why QSharedPointer and not std::shared_ptr? Nothing against Qt, but we're going to be working with non-Qt scripting engines anyway, so any integration benefits with Qt may be moot there.
  • There's ScriptManager now. I take it manages scripts, what does that involve? Looking at it, I think there's stuff that doesn't seem to quite belong in it. That a ScriptManager loads scripts sounds reasonable, but why is resourcePath there? That seems like something that should be either an outside API (because it's not script management), or an interface implemented by each script engine (because perhaps different engines store stuff in different places).
  • What will a second scripting engine look like?
  • etc.

I think it's important to have a plan upfront here to be clear on what's changing, why, and to have a good idea of what's not done yet, what's intentional, and what's a bug.

@odysseus654
Copy link
Contributor Author

Currently there are three interfaces being introduced here:

  • ScriptEngine, to abstract access to QScriptEngine. It will only be creatable from a factory function.
  • ScriptValue, to abstract access to QScriptValue. It will only be creatable from a ScriptEngine.
  • ScriptContext, to abstract access to QScriptContext. It cannot be created but will be available through Scriptable or ScriptEngine.

These interfaces cannot be directly created and do not inherit from QObject (directly), so cannot have any slots or signals. All interfaces are pointers which is why ScriptValue is now a pointer (where QScriptValue is generally not a pointer). Using QSharedPointer for these objects also means that copying them doesn't involve calling into the scripting engine to make a copy of the actual value.

The choice of QSharedPointer over std::shared_ptr is mostly as our project is a Qt project. Choosing one over the other won't really affect much.

ScriptManager is a QObject containing most of the code that is common between the scripting engines. It will encapsulate the main Run() function as well as all the Vircadia objects that are shoved into globalObject().

@odysseus654 odysseus654 force-pushed the feature/scripting branch 2 times, most recently from a7191c6 to cbe608a Compare May 9, 2021 08:22
@odysseus654 odysseus654 force-pushed the feature/scripting branch 2 times, most recently from 975d390 to ab68c02 Compare May 15, 2021 08:07
@odysseus654
Copy link
Contributor Author

I'm unsure what to do to make sure "tests" and "tests-manual" work, offhand they don't appear to be part of the project that gets compiled.

@odysseus654 odysseus654 force-pushed the feature/scripting branch 3 times, most recently from b6c159c to cdfde39 Compare May 21, 2021 20:07
@odysseus654
Copy link
Contributor Author

If it helps, here are one-line descriptions for at least the classes in script-engine: http://protocol.odys.se/script-engine/annotated.html

[ScriptInterface] are new abstract classes to create engine-independent interfaces
[QtScript] are classes deemed qtscript-specific and can now only be accessed through a ScriptInterface object
ScriptManager has taken over all the duties possible that ScriptEngine used to have while not being QtScript-specific (which is quite a bit)

everything else is as minimally touched while having scripting references redirected to engine-independent interfaces.

Very surprisingly... I'm not seeing any linker dependencies from script-engine to other libraries (except perhaps shared)

@odysseus654
Copy link
Contributor Author

FWIW I'm not just updating the branch to HEAD, I am actually trying to develop patches here. Probably not quite ready yet though.

@namark
Copy link
Contributor

namark commented Mar 14, 2022

My recent PR #1622 has some conflicts with this, so wanted to give a heads up and context on it. There are a lot of files affected, but most of it should be straight forward to merge, since I didn't really change much, just moved things around, basically splitting the shared library in two.

@ksuprynowicz
Copy link
Contributor

I tested it thoroughly and noticed a few problems:

In voxels.js app on subtracting voxels:

[03/18 22:43:24] [WARNING] [hifi.scriptengine] run ---------- UNCAUGHT EXCEPTION --------
[03/18 22:43:24] [WARNING] [hifi.scriptengine] runInThread "TypeError: Native call of EntityScriptingInterface::callEntityMethod failed: Cannot convert parameter 3 from string to QStringList"
[03/18 22:43:24] [CRITICAL] [hifi.scriptengine] [controllerScripts.js] [UncaughtException run] Error: Native call of EntityScriptingInterface::callEntityMethod failed: Cannot convert parameter 3 from string to QStringList in file:///home/ksuprynowicz/overte/pr1200/vircadia/build/interface/scripts/system/controllers/grab.js:382
[03/18 22:43:24] [CRITICAL] [hifi.scriptengine] [Backtrace]
[03/18 22:43:24] [CRITICAL] [hifi.scriptengine]     <anonymous>(event = [object Object]) at file:///home/ksuprynowicz/overte/pr1200/vircadia/build/interface/scripts/system/controllers/grab.js:382
[03/18 22:43:24] [CRITICAL] [hifi.scriptengine]     releaseEvent(event = [object Object]) at file:///home/ksuprynowicz/overte/pr1200/vircadia/build/interface/scripts/system/controllers/grab.js:518
[03/18 22:43:24] [CRITICAL] [hifi.scriptengine]     <global>() at -1
[03/18 22:43:24] [DEBUG] [hifi.ui] setKeyboardRaised:  QQuickRootItem(0x5627a3d68160) , raised:  false , numeric:  false , password:  false
[03/18 22:43:24] [DEBUG] [hifi.ui] setKeyboardRaised:  Desktop_QMLTYPE_214(0x5627ab809770, name = "desktop") , raised:  false , numeric:  false , password:  false
[03/18 22:43:24] [DEBUG] [hifi.ui] setKeyboardRaised:  QQuickRootItem(0x5627a3d68160) , raised:  false , numeric:  false , password:  false
[03/18 22:43:24] [DEBUG] [hifi.ui] setKeyboardRaised:  Desktop_QMLTYPE_214(0x5627ab809770, name = "desktop") , raised:  false , numeric:  false , password:  false
[03/18 22:43:24] [CRITICAL] [hifi.scriptengine] [controllerScripts.js] [UncaughtException doWithEnvironment] Error: Native call of EntityScriptingInterface::callEntityMethod failed: Cannot convert parameter 3 from string to QStringList in file:///home/ksuprynowicz/overte/pr1200/vircadia/build/interface/scripts/system/controllers/grab.js:382
[03/18 22:43:24] [CRITICAL] [hifi.scriptengine] [Backtrace]
[03/18 22:43:24] [CRITICAL] [hifi.scriptengine]     <anonymous>(event = [object Object]) at file:///home/ksuprynowicz/overte/pr1200/vircadia/build/interface/scripts/system/controllers/grab.js:382
[03/18 22:43:24] [CRITICAL] [hifi.scriptengine]     releaseEvent(event = [object Object]) at file:///home/ksuprynowicz/overte/pr1200/vircadia/build/interface/scripts/system/controllers/grab.js:518
[03/18 22:43:24] [CRITICAL] [hifi.scriptengine]     <global>() at -1
[03/18 22:43:24] [CRITICAL] [hifi.scriptengine] [controllerScripts.js] [UncaughtException doWithEnvironment] Error: Native call of EntityScriptingInterface::callEntityMethod failed: Cannot convert parameter 3 from string to QStringList in file:///home/ksuprynowicz/overte/pr1200/vircadia/build/interface/scripts/system/controllers/grab.js:348
[03/18 22:43:24] [CRITICAL] [hifi.scriptengine] [Backtrace]
[03/18 22:43:24] [CRITICAL] [hifi.scriptengine]     <anonymous>(event = [object Object]) at file:///home/ksuprynowicz/overte/pr1200/vircadia/build/interface/scripts/system/controllers/grab.js:348
[03/18 22:43:24] [CRITICAL] [hifi.scriptengine]     pressEvent(event = [object Object]) at file:///home/ksuprynowicz/overte/pr1200/vircadia/build/interface/scripts/system/controllers/grab.js:510
[03/18 22:43:24] [CRITICAL] [hifi.scriptengine]     <global>() at -1

createCow.js fails with:

[03/18 22:54:18] [DEBUG] [hifi.scriptengine] loadURL "file:///home/ksuprynowicz/overte/pr1200/vircadia/build/interface/scripts/tutorials/createCow.js" "Success" QThread(0x5627a13eb3c0, name = "Main Thread")
[03/18 22:54:18] [DEBUG] [hifi.shared] SpatiallyNestable::setLocalPosition -- position contains NaN
[03/18 22:54:18] [WARNING] [default] Model size of -3 is less than 0
[03/18 22:54:20] [DEBUG] [hifi.audio] Processing sound file "moo.wav"
[03/18 22:54:20] [DEBUG] [hifi.audio] Setting ready state for sound file "moo.wav"
[03/18 22:54:26] [DEBUG] [hifi.modelformat] root node  "1532091263104"   has discarded parent  "1533480196848"
[03/18 22:54:26] [DEBUG] [hifi.modelformat]  fbx material Name: "lambert2"
[03/18 22:54:26] [DEBUG] [hifi.modelformat] root node  "1532091263104"   has discarded parent  "1533480196848"
[03/18 22:54:26] [DEBUG] [hifi.modelformat]  fbx material Name: "lambert2"
[03/18 22:54:28] [DEBUG] [hifi.ui] setKeyboardRaised:  RunningScripts_QMLTYPE_584(0x7fa34c0c82e0, name = "RunningScripts") , raised:  false , numeric:  false , password:  false
[03/18 22:54:28] [DEBUG] [hifi.ui] setKeyboardRaised:  Desktop_QMLTYPE_214(0x5627ab809770, name = "desktop") , raised:  false , numeric:  false , password:  false
[03/18 22:54:34] [DEBUG] [hifi.scriptengine] [defaultScripts.js] PEOPLE truncated notification data for processing: []
[03/18 22:54:58] [DEBUG] [hifi.ui] setKeyboardRaised:  RunningScripts_QMLTYPE_584(0x7fa34c0c82e0, name = "RunningScripts") , raised:  false , numeric:  false , password:  false
[03/18 22:54:58] [DEBUG] [hifi.ui] setKeyboardRaised:  QQuickListView_QML_133(0x5627c7565c10) , raised:  false , numeric:  false , password:  false
[03/18 22:54:58] [DEBUG] [hifi.ui] setKeyboardRaised:  QQuickFocusScope_QML_145(0x5627b9aa28f0) , raised:  false , numeric:  false , password:  false
[03/18 22:55:11] [DEBUG] [hifi.ui] setKeyboardRaised:  QQuickFocusScope_QML_145(0x5627bc5e8910) , raised:  false , numeric:  false , password:  false
[03/18 22:55:12] [DEBUG] [hifi.scriptengine] AssetScriptingInterface::AssetScriptingInterface ScriptManager(0x5627baf52070)
[03/18 22:55:12] [DEBUG] [hifi.scriptengine] loadURL "file:///home/ksuprynowicz/overte/pr1200/vircadia/build/interface/scripts/tutorials/createPingPongGun.js" "Success" QThread(0x5627a13eb3c0, name = "Main Thread")
[03/18 22:55:12] [DEBUG] [hifi.shared] SpatiallyNestable::setLocalPosition -- position contains NaN
[03/18 22:55:12] [WARNING] [default] Model size of -3 is less than 0

Blocks app fails with:

[03/18 23:02:56] [DEBUG] [hifi.interface] No matching url ""

Seems to appear randomly:

[03/18 23:03:44] [WARNING] [default] qrc:/qml/controls/+webengine/FlickableWebViewCore.qml:21:5: Unable to assign [undefined] to bool

Create App fails to create shapes, they appear at 0,0,0 and not near avatar:

[03/18 23:03:44] [DEBUG] [hifi.shared] SpatiallyNestable::setLocalPosition -- position contains NaN
[03/18 23:07:01] [DEBUG] [qml] [FlickableWebViewCore.qml] Web Entity JS message: file:///home/ksuprynowicz/overte/pr1200/vircadia/build/interface/scripts/system/create/entityList/html/entityList.html 497 Uncaught TypeError: EventBridge.forceHtmlAudioOutputDeviceUpdate is not a function

Create app emits these when switching between Create and Properties tabs:

[03/18 23:08:22] [WARNING] [default] qrc:/qml/controls/+webengine/FlickableWebViewCore.qml:21:5: Unable to assign [undefined] to bool

Create app emits these when switching between objects in Entity Lists:

[03/18 23:09:14] [DEBUG] [qml] [FlickableWebViewCore.qml] Web Entity JS message: file:///home/ksuprynowicz/overte/pr1200/vircadia/build/interface/scripts/system/create/entityList/html/entityList.html 497 Uncaught TypeError: EventBridge.forceHtmlAudioOutputDeviceUpdate is not a function
Selected objects don't appear in properties tab

On toggling grid visibility in create app:

[03/18 23:11:49] [DEBUG] [qml] [FlickableWebViewCore.qml] Web Entity JS message: file:///home/ksuprynowicz/overte/pr1200/vircadia/build/interface/scripts/system/html/gridControls.html 503 Uncaught TypeError: EventBridge.forceHtmlAudioOutputDeviceUpdate is not a function
Grid doesn't appear

Doppelganger app doesn't work.

After a crash and selecting to reset non-essential settings it immediately crashes with this message:

[03/18 23:18:08] [DEBUG] [hifi.scriptengine.module] require.fetchModuleSource:  "networkingConstants.js" QThread(0x55760a884610, name = "js:defaultScripts.js")
[03/18 23:18:08] [DEBUG] [hifi.scriptengine.module] "require.instantiateModule: networkingConstants.js / 735 bytes"
[03/18 23:18:08] [DEBUG] [vircadia.networking.external_resource] Requested URL for bucket  ExternalResource::Bucket::HF_Content , path  "/"
[03/18 23:18:08] [CRITICAL] [vircadia.networking.external_resource] External resource  QUrl("")  was requested from bucket  ExternalResource::Bucket::HF_Content  with an invalid path. Error:  ""
[03/18 23:18:08] [DEBUG] [vircadia.networking.external_resource] Requested URL for bucket  ExternalResource::Bucket::HF_Public , path  "/"
[03/18 23:18:08] [CRITICAL] [vircadia.networking.external_resource] External resource  QUrl("")  was requested from bucket  ExternalResource::Bucket::HF_Public  with an invalid path. Error:  ""
[03/18 23:18:08] [DEBUG] [hifi.scriptengine.module] //ScriptManager::require( "./libraries/networkingConstants.js" )
[03/18 23:18:08] [DEBUG] [hifi.scriptengine.module] ScriptManager::require( "https://cdn.vircadia.com/dist/launcher/vircadiaMeta.json?1647641888517" )
[03/18 23:18:08] [DEBUG] [hifi.scriptengine.module] newModule ""
[03/18 23:18:08] [DEBUG] [hifi.scriptengine.module] require.fetchModuleSource:  "vircadiaMeta.json" QThread(0x55760a884610, name = "js:defaultScripts.js")
[03/18 23:18:08] [FATAL] [default] ASSERT: "returnTypeId != QMetaType::UnknownType" in file /home/ksuprynowicz/overte/pr1200/vircadia/libraries/script-engine/src/qtscript/ScriptObjectQtProxy.cpp, line 492

Call stack:

#0 __GI_raise() at sysdeps/unix/sysv/linux/raise.c:49
#1 __GI_abort() at stdlib/abort.c:79
#2 qt_message_fatal() at src/corelib/global/qlogging.cpp:1,914
#3 QMessageLogger::fatal() at src/corelib/global/qlogging.cpp:893
#4 qt_assert() at src/corelib/global/qglobal.cpp:3,358
#5 ScriptMethodQtProxy::extension() at /home/ksuprynowicz/overte/pr1200/vircadia/libraries/script-engine/src/qtscript/ScriptObjectQtProxy.cpp:492
#6 QScript::ClassObjectDelegate::call() at src/script/bridge/qscriptclassobject.cpp:245
#7 QTJSC::NativeFuncWrapper::operator()() at src/3rdparty/javascriptcore/JavaScriptCore/runtime/CallData.cpp:46
#8 QTJSC::cti_op_call_NotJSFunction() at src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.cpp:1,780
#9 ??() at 
#10 ??() at 
#11 ??() at 
#12 ??() at 
#13 ??() at 
#14 ??() at 
#15 ??() at 
#16 ??() at 
#17 QTWTF::FastAllocBase::operator delete() at src/3rdparty/javascriptcore/JavaScriptCore/wtf/FastAllocBase.h:104
#18 QTWTF::deleteOwnedPtr<QTJSC::BytecodeGenerator>() at src/3rdparty/javascriptcore/JavaScriptCore/wtf/OwnPtrCommon.h:46
#19 QTWTF::deleteOwnedPtr<QTJSC::BytecodeGenerator>() at src/3rdparty/javascriptcore/JavaScriptCore/wtf/OwnPtrCommon.h:42
#20 QTWTF::OwnPtr<QTJSC::BytecodeGenerator>::~OwnPtr() at src/3rdparty/javascriptcore/JavaScriptCore/wtf/OwnPtr.h:53

Later it keeps crashing in tutorial world with SIGABRT but no message
Call stack:

#0 __GI_raise() at sysdeps/unix/sysv/linux/raise.c:49
#1 __GI_abort() at stdlib/abort.c:79
#2 qt_message_fatal() at src/corelib/global/qlogging.cpp:1,914
#3 QMessageLogger::fatal() at src/corelib/global/qlogging.cpp:893
#4 qt_assert() at src/corelib/global/qglobal.cpp:3,358
#5 ScriptMethodQtProxy::extension() at /home/ksuprynowicz/overte/pr1200/vircadia/libraries/script-engine/src/qtscript/ScriptObjectQtProxy.cpp:492
#6 QScript::ClassObjectDelegate::call() at src/script/bridge/qscriptclassobject.cpp:245
#7 QTJSC::NativeFuncWrapper::operator()() at src/3rdparty/javascriptcore/JavaScriptCore/runtime/CallData.cpp:46
#8 QTJSC::cti_op_call_NotJSFunction() at src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.cpp:1,780
#9 ??() at 
#10 ??() at 
#11 ??() at 
#12 ??() at 
#13 ??() at 
#14 ??() at 
#15 ??() at 
#16 ??() at 
#17 QTWTF::FastAllocBase::operator delete() at src/3rdparty/javascriptcore/JavaScriptCore/wtf/FastAllocBase.h:104
#18 QTWTF::deleteOwnedPtr<QTJSC::BytecodeGenerator>() at src/3rdparty/javascriptcore/JavaScriptCore/wtf/OwnPtrCommon.h:46
#19 QTWTF::deleteOwnedPtr<QTJSC::BytecodeGenerator>() at src/3rdparty/javascriptcore/JavaScriptCore/wtf/OwnPtrCommon.h:42
#20 QTWTF::OwnPtr<QTJSC::BytecodeGenerator>::~OwnPtr() at src/3rdparty/javascriptcore/JavaScriptCore/wtf/OwnPtr.h:53

@ksuprynowicz
Copy link
Contributor

The scripting console doesn't seem to work. Any command entered there results in following debug message:
[03/19 12:45:37] [WARNING] [default] QMetaObject::invokeMethod: No such method ScriptManager::evaluate(const QString&,const QString&)

@ksuprynowicz
Copy link
Contributor

ksuprynowicz commented Mar 19, 2022

Bug preventing various scripts from creating entities at given position (like for example createCow.js, or createPistol.js) is due to Vec3.multiply not working correctly.
Simple example:

var vec1 = Vec3.multiply(1.5, {x: 1, y: 2, z: 3});
print(JSON.stringify(vec1));

Returns {"x":null,"y":null,"z":null} while it previous version it returns {"x":1.5,"y":3,"z":4.5}

Edit: Reversed argument order gives correct result, so it's only one of the overloaded operators that is failing.

@odysseus654
Copy link
Contributor Author

Thank you for looking at this, these kinds of "function overload evaluation" is brand-new code and likely one of the weakest points (and most need of testing)

Was hoping to get more done this weekend but... have some energy right now so we'll see how many of these simpler issues I can resolve

…'s used as a return datatype in a script-callable function (and doesn't get auto-registered)
… accept and discard script parameters beyond that count
@odysseus654
Copy link
Contributor Author

odysseus654 commented Mar 21, 2022

Initial thoughts, hoping to push once I actually do a bit of testing (dunno how much though):

  • No such method ScriptManager::evaluate(const QString&,const QString&)
    The previous (current?) implementation of ScriptEngine exposes an awful lot of internal functions because anything meta-callable was also script-exposed and there were a lot of details that needed to be meta-callable. I've tried to reduce the list to what script might need but... until I see responses like this I don't know what's necessary (and this function could be abused by script). I've added Q_INVOKABLE to it though, so should be resolved
    [Edit: I just found the BLOCKING_INVOKE_METHOD on the other side of this call, will deal with that and back out the Q_INVOKABLE]
  • Uncaught TypeError: EventBridge.forceHtmlAudioOutputDeviceUpdate is not a function
    I found a typo that would be excluding method discovery for objects that exclude parent object discovery, hoping this resolves the situation.
  • Error: Cannot call native function PerformanceScriptingInterface::getPerformancePreset, its return value has not been registered with Qt
    Return value is now registered in the PerformanceScriptingInterface constructor
  • Error: Native call of WindowScriptingInterface::browseDirAsync failed: unexpected parameter count
    The script calling this is passing an extra empty string that... I don't know what it is. Javascript rules are that extra parameters get discarded (if the called function doesn't get them through "arguments"). I'm now tracking the maximum number of parameters that any overload uses and discarding scripting parameters beyond this count.

@odysseus654
Copy link
Contributor Author

Not fully satisfied with the changes but pushed what I have.

Getting a crash on launch (which doesn't immediately seem relevant) and a crash on shutdown (which seems more relevant)

@vircadia-build-notifier

@ksuprynowicz
Copy link
Contributor

I built and tested the most recent version.

Scripting console now works :)

Explore App:
[03/25 20:42:23] [DEBUG] [qml] [FlickableWebViewCore.qml] Web Entity JS message: file:///home/ksuprynowicz/overte/pr1200/vircadia/build/interface/scripts/communityScripts/explore/explore.html#/ 491 Uncaught TypeError: EventBridge.forceHtmlAudioOutputDeviceUpdate is not a function

Create app doesn't display properties, causes these errors:

[03/25 20:46:24] [WARNING] [default] qrc:/qml/controls/+webengine/FlickableWebViewCore.qml:21:5: Unable to assign [undefined] to bool
[03/25 20:46:25] [DEBUG] [qml] [FlickableWebViewCore.qml] Web Entity JS message: file:///home/ksuprynowicz/overte/pr1200/vircadia/build/interface/scripts/system/create/entityProperties/html/entityProperties.html 491 Uncaught TypeError: EventBridge.forceHtmlAudioOutputDeviceUpdate is not a function
[03/25 20:47:23] [DEBUG] [qml] [FlickableWebViewCore.qml] Web Entity JS message: file:///home/ksuprynowicz/overte/pr1200/vircadia/build/interface/scripts/system/create/entityList/html/entityList.html 497 Uncaught TypeError: EventBridge.forceHtmlAudioOutputDeviceUpdate is not a function

in voxels.js
[03/25 20:52:11] [DEBUG] [hifi.interface] No matching url ""

createPistol.js fails:

[03/25 21:04:27] [DEBUG] [hifi.scriptengine] loadURL "file:///home/ksuprynowicz/overte/pr1200/vircadia/build/interface/scripts/tutorials/createPistol.js" "Success" QThread(0x556f36a953c0, name = "Main Thread")
[03/25 21:04:27] [DEBUG] [hifi.shared] SpatiallyNestable::setLocalPosition -- position contains NaN
[03/25 21:04:27] [CRITICAL] [hifi.scriptengine] [about:Entities 4] [UncaughtException {8451506e-f426-4ce2-8994-0e1715fb06fa}] Error: Can't find variable: COLORS in https://cdn-1.vircadia.com/us-e-1/Developer/Tutorials/entity_scripts/pistol.js:350
[03/25 21:04:27] [CRITICAL] [hifi.scriptengine] [Backtrace]
[03/25 21:04:27] [CRITICAL] [hifi.scriptengine]     <anonymous>(entityID = '{8451506e-f426-4ce2-8994-0e1715fb06fa}', ) at https://cdn-1.vircadia.com/us-e-1/Developer/Tutorials/entity_scripts/pistol.js:350
[03/25 21:04:27] [CRITICAL] [hifi.scriptengine]     <global>() at -1

@ksuprynowicz
Copy link
Contributor

I tested it again, and create app throws a lot of errors, but properties display correctly now. Adding new objects also works as indended now.

[03/25 21:27:35] [DEBUG] [qml] [FlickableWebViewCore.qml] Web Entity JS message: file:///home/ksuprynowicz/overte/pr1200/vircadia/build/interface/scripts/system/create/entityProperties/html/js/entityProperties.js 3861 Uncaught ReferenceError: element is not defined
[03/25 21:27:35] [DEBUG] [qml] [FlickableWebViewCore.qml] Web Entity JS message: file:///home/ksuprynowicz/overte/pr1200/vircadia/build/interface/scripts/system/create/entityProperties/html/js/entityProperties.js 2782 Uncaught TypeError: Cannot read property 'updateMinMax' of undefined
[03/25 21:27:36] [DEBUG] [qml] [FlickableWebViewCore.qml] Web Entity JS message: file:///home/ksuprynowicz/overte/pr1200/vircadia/build/interface/scripts/system/create/entityProperties/html/js/entityProperties.js 3861 Uncaught ReferenceError: element is not defined
[03/25 21:27:36] [DEBUG] [qml] [FlickableWebViewCore.qml] Web Entity JS message: file:///home/ksuprynowicz/overte/pr1200/vircadia/build/interface/scripts/system/create/entityProperties/html/entityProperties.html 491 Uncaught TypeError: EventBridge.forceHtmlAudioOutputDeviceUpdate is not a function
[03/25 21:27:38] [WARNING] [default] qrc:/qml/controls/+webengine/FlickableWebViewCore.qml:21:5: Unable to assign [undefined] to bool
[03/25 21:27:39] [DEBUG] [hifi.shared] SpatiallyNestable::setLocalPosition -- position contains NaN
[03/25 21:27:39] [DEBUG] [hifi.scriptengine.module] ScriptManager::require( "./assets/data/createAppTooltips.json" )
[03/25 21:27:39] [DEBUG] [hifi.scriptengine.module] newModule ""
[03/25 21:27:39] [DEBUG] [hifi.scriptengine.module] require.fetchModuleSource:  "createAppTooltips.json" QThread(0x560de54a6990, name = "js:defaultScripts.js")
[03/25 21:27:39] [DEBUG] [hifi.scriptengine] Found script in cache: "createAppTooltips.json"
[03/25 21:27:39] [DEBUG] [hifi.scriptengine.module] "require.instantiateModule: createAppTooltips.json / 27361 bytes"
[03/25 21:27:39] [DEBUG] [hifi.scriptengine.module] ... parsing as JSON
[03/25 21:27:39] [DEBUG] [hifi.scriptengine.module] //ScriptManager::require( "./assets/data/createAppTooltips.json" )
libpng warning: iCCP: known incorrect sRGB profile
[03/25 21:27:39] [DEBUG] [qml] [FlickableWebViewCore.qml] Web Entity JS message: file:///home/ksuprynowicz/overte/pr1200/vircadia/build/interface/scripts/system/create/entityProperties/html/js/entityProperties.js 3861 Uncaught ReferenceError: element is not defined
[03/25 21:27:39] [DEBUG] [qml] [FlickableWebViewCore.qml] Web Entity JS message: file:///home/ksuprynowicz/overte/pr1200/vircadia/build/interface/scripts/system/create/entityProperties/html/js/entityProperties.js 2782 Uncaught TypeError: Cannot read property 'updateMinMax' of undefined
[03/25 21:27:40] [DEBUG] [qml] [FlickableWebViewCore.qml] Web Entity JS message: file:///home/ksuprynowicz/overte/pr1200/vircadia/build/interface/scripts/system/create/entityProperties/html/js/entityProperties.js 3861 Uncaught ReferenceError: element is not defined
[03/25 21:27:40] [DEBUG] [qml] [FlickableWebViewCore.qml] Web Entity JS message: file:///home/ksuprynowicz/overte/pr1200/vircadia/build/interface/scripts/system/create/entityProperties/html/entityProperties.html 491 Uncaught TypeError: EventBridge.forceHtmlAudioOutputDeviceUpdate is not a function
[03/25 21:27:41] [DEBUG] [qml] [FlickableWebViewCore.qml] Web Entity JS message: file:///home/ksuprynowicz/overte/pr1200/vircadia/build/interface/scripts/system/create/entityProperties/html/js/entityProperties.js 3861 Uncaught ReferenceError: element is not defined
[03/25 21:27:43] [DEBUG] [qml] [FlickableWebViewCore.qml] Web Entity JS message: file:///home/ksuprynowicz/overte/pr1200/vircadia/build/interface/scripts/system/create/entityList/html/entityList.html 497 Uncaught TypeError: EventBridge.forceHtmlAudioOutputDeviceUpdate is not a function
[03/25 21:27:43] [DEBUG] [qml] [FlickableWebViewCore.qml] Web Entity JS message: file:///home/ksuprynowicz/overte/pr1200/vircadia/build/interface/scripts/system/create/entityProperties/html/js/entityProperties.js 3861 Uncaught ReferenceError: element is not defined
[03/25 21:27:44] [DEBUG] [qml] [FlickableWebViewCore.qml] Web Entity JS message: file:///home/ksuprynowicz/overte/pr1200/vircadia/build/interface/scripts/system/create/entityList/html/entityList.html 497 Uncaught TypeError: EventBridge.forceHtmlAudioOutputDeviceUpdate is not a function
[03/25 21:27:44] [DEBUG] [qml] [FlickableWebViewCore.qml] Web Entity JS message: file:///home/ksuprynowicz/overte/pr1200/vircadia/build/interface/scripts/system/create/entityProperties/html/js/entityProperties.js 3861 Uncaught ReferenceError: element is not defined
[Previous message was repeated 1 times]
[03/25 21:27:45] [DEBUG] [qml] [FlickableWebViewCore.qml] Web Entity JS message: file:///home/ksuprynowicz/overte/pr1200/vircadia/build/interface/scripts/system/create/entityList/html/entityList.html 497 Uncaught TypeError: EventBridge.forceHtmlAudioOutputDeviceUpdate is not a function
[03/25 21:27:46] [DEBUG] [qml] [FlickableWebViewCore.qml] Web Entity JS message: file:///home/ksuprynowicz/overte/pr1200/vircadia/build/interface/scripts/system/create/entityProperties/html/js/entityProperties.js 3861 Uncaught ReferenceError: element is not defined
[03/25 21:27:46] [DEBUG] [hifi.scriptengine] [defaultScripts.js] PEOPLE truncated notification data for processing: []

@ksuprynowicz
Copy link
Contributor

It seems like it crashes after some time, or some amount of use. After crash properties of objects on the list are not displayed anymore:
create_crash
After closing create app windows it doesn't fully stop, and toolbar is partially frozen:
create_crash_2

@JulianGro
Copy link
Contributor

in voxels.js [03/25 20:52:11] [DEBUG] [hifi.interface] No matching url ""

This is a common message in production builds. Just fyi.

@ksuprynowicz
Copy link
Contributor

File dialog in running scripts:

[03/26 11:40:21] [WARNING] [default] "Could not convert argument 0 at"
[03/26 11:40:21] [WARNING] [default] 	 "expression for currentSelectionPath@qrc:/qml/dialogs/FileDialog.qml:264"
[03/26 11:40:21] [WARNING] [default] 	 "fileDialog@qrc:/qml/desktop/Desktop.qml:537"
[03/26 11:40:21] [WARNING] [default] 	 "onClickedQueued@qrc:/qml/hifi/dialogs/RunningScripts.qml:344"
[03/26 11:40:21] [WARNING] [default] 	 "onTriggered@qrc:/qml/controlsUit/QueuedButton.qml:38"
[03/26 11:40:21] [WARNING] [default] "Passing incompatible arguments to C++ functions from JavaScript is dangerous and deprecated."
[03/26 11:40:21] [WARNING] [default] "This will throw a JavaScript TypeError in future releases of Qt!"

Overloading still doesn't work:
var vec1 = Vec3.multiply(1.5, {x: 1, y: 2, z: 3}); produces {"x":null,"y":null,"z":null}
var vec2 = Vec3.multiply({x: 1, y: 2, z: 3}, 1.5); produces {"x":1.5,"y":3,"z":4.5}

@ksuprynowicz
Copy link
Contributor

There are also TypeErrors during shutdown:

[03/26 11:59:23] [WARNING] [default] qrc:/qml/hifi/dialogs/RunningScripts.qml:35: TypeError: Cannot read property 'scriptsModelFilter' of null
[03/26 11:59:23] [WARNING] [default] qrc:/qml/hifi/Desktop.qml:69: TypeError: Cannot read property 'getTablet' of null
[03/26 11:59:23] [WARNING] [default] qrc:/qml/hifi/tablet/TabletHome.qml:15: TypeError: Cannot call method 'getTablet' of null
[03/26 11:59:23] [WARNING] [default] qrc:/qml/hifi/audio/MicBarApplication.qml:23: TypeError: Cannot read property 'pushToTalk' of null
[03/26 11:59:23] [WARNING] [default] qrc:/qml/hifi/audio/MicBarApplication.qml:20: TypeError: Cannot read property 'inputLevel' of null
[03/26 11:59:23] [WARNING] [default] qrc:/qml/hifi/audio/MicBarApplication.qml:22: TypeError: Cannot read property 'muted' of null
[03/26 11:59:23] [WARNING] [default] qrc:/qml/hifi/audio/MicBarApplication.qml:21: TypeError: Cannot read property 'clipping' of null
[03/26 11:59:23] [WARNING] [default] qrc:/qml/hifi/audio/MicBarApplication.qml:24: TypeError: Cannot read property 'pushingToTalk' of null
[03/26 11:59:23] [WARNING] [default] qrc:/qml/hifi/audio/MicBar.qml:275: TypeError: Cannot read property 'clipping' of null
[03/26 11:59:23] [WARNING] [default] qrc:/qml/hifi/audio/MicBar.qml:23: TypeError: Cannot read property 'inputLevel' of null
[03/26 11:59:23] [WARNING] [default] qrc:/qml/hifi/audio/MicBar.qml:25: TypeError: Cannot read property 'pushToTalk' of null
[03/26 11:59:23] [WARNING] [default] qrc:/qml/hifi/audio/MicBar.qml:22: TypeError: Cannot read property 'muted' of null
[03/26 11:59:23] [WARNING] [default] qrc:/qml/hifi/audio/MicBar.qml:24: TypeError: Cannot read property 'clipping' of null
[03/26 11:59:23] [WARNING] [default] qrc:/qml/hifi/audio/MicBar.qml:26: TypeError: Cannot read property 'pushingToTalk' of null
[03/26 11:59:23] [WARNING] [default] qrc:/qml/hifi/audio/MicBarApplication.qml:23: TypeError: Cannot read property 'pushToTalk' of null
[03/26 11:59:23] [WARNING] [default] qrc:/qml/hifi/audio/MicBarApplication.qml:20: TypeError: Cannot read property 'inputLevel' of null
[03/26 11:59:23] [WARNING] [default] qrc:/qml/hifi/audio/MicBarApplication.qml:22: TypeError: Cannot read property 'muted' of null
[03/26 11:59:23] [WARNING] [default] qrc:/qml/hifi/audio/MicBarApplication.qml:21: TypeError: Cannot read property 'clipping' of null
[03/26 11:59:23] [WARNING] [default] qrc:/qml/hifi/audio/MicBarApplication.qml:24: TypeError: Cannot read property 'pushingToTalk' of null

@stale
Copy link

stale bot commented Sep 22, 2022

Hello! Is this still an issue?

@stale stale bot added the stale Issue / PR has not had activity label Sep 22, 2022
@digisomni digisomni removed the stale Issue / PR has not had activity label Sep 22, 2022
@stale
Copy link

stale bot commented Mar 22, 2023

Hello! Is this still an issue?

@stale stale bot added the stale Issue / PR has not had activity label Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
allow-build-upload Allows the upload of a build for non white-listed users enhancement New feature or request needs testing (QA) The PR is ready for testing rebuild rebuild through the GithubActions stale Issue / PR has not had activity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants