Closed benloh closed 1 year ago
In GitLab by @daveseah on Jul 27, 2022, 17:56
added 25 commits
In GitLab by @daveseah on Jul 27, 2022, 19:00
added 2 commits
In GitLab by @daveseah on Jul 27, 2022, 19:04
marked this merge request as ready
In GitLab by @daveseah on Jul 28, 2022, 10:04
added 1 commit
Jotting notes on testing for future reference.
Errors clearly caught by the existing Error Manager, showing an error on the Main screen.
http://localhost/app/main?project=starter_991
to open a project, but starter_991
doesn't exist. Error caught. Useful message in dev console: "logging error from project-loader could not load and initialize project starter_991". Page is unresponsive. Need to change URL and reload to start.These are not necessarily problems...just noting where Error Manager is not catching stuff.
Foo
blueprint that has references to featCall Foo.Costume...
to Bar
and save changes to server. Server reports SimPlaces Error -- bad script? Error: context missing 'Foo' (Ben's workshop
try...catch` that is not integrated into Error Mgr).[[
without closing blocks. ScriptEditor dev console shows error: "Uncaught Error: EOF without 1 unclosed blocks @13:16". Error Mgr does not engage.]]
without opening blocks. ScriptEditor dev console shows error: "Uncaught Error: GobbleIdentifier: Unexpected ] @9:0"featCall
with no parameters to Round 1 init script. Error shows up only after clicking "Prep Round". Error Mgr does not engage. Main dev console says: "Uncaught TypeError: Cannot read properties of undefined (reading 'objref') at featCall.compile"Moths-Activity-Dont-Know
line 38, the "if" statement has an "else" block. Load this activity, and hit "Prep Round". This will generate an error: "class-gscript-tokenizer-v2.ts:828 Uncaught Error: KeywordFromToken: tok 'block' is not decodeable as a keyword at Module.KeywordFromToken". Dumping kwTok
will show the script for the line the error is on. Main dev console error only, no Error Manaager.Moths-Activity-Migration
addFeature AgentWidgets
for the global agent.addFeature
in a round init script -- who's the target agent? global?addFeature AgentWidgets
to global agentaddFeature
?Tested opening and running and editing multiple projects. Things seem to run for the most part, so merging.
mentioned in commit 977e2cdcaa145c1c253c348be74f1878e668593e
In GitLab by @daveseah on Jul 27, 2022, 15:47
Merges dev-sri/system-updates -> dev-next
(incorporates !257, which can be closed if this succceeds)
This merge request adds to major infrastructure systems: Event Logging and Error Management supporting code. These features have not, however, been activated anywhere in the codebase. Both these feature require surgical placement in the code, and is best handled in a careful pair programming session.
TESTING
With luck, this merge request doesn't change anything in the existing projects, as it just adds some features that are not yet used. There are some cosmetic fixes here and there, and MAIN will now throw up a big error overlay so users know the system crashed before it could even draw anything.
NEW: EVENT LOGGING
The system event logger that is part of URSYS has been hooked back in with a new call
UR.LogEvent('eventName',itemsList)
.eventName
is a researcher-chosen string that identifies the kind of information being capturesitemList
is an array of strings and numbers that will be logged in order they are definedThe logged data goes into the
gem_srv/runtime
folder and is tagged with the UADDR (address) of the webapp that is sending the log. The line begins with the UADDR and eventName, and is followed by TAB-DELIMITED items. This makes it easy to copy/paste into a spreadsheet like Excel and have the fields line up. The delimiter character can be changed to whatever is necessary, though be aware that choosing ',' means that you will have to make sure youritemsList
strings don't have commas either.NEW: ERROR MANAGER
The error manager has not been able to be merged until now because the approach it takes requires a careful structured of how errors cascade throughout the system; to have done so earlier would have broken the prototype for the workshop because it was handling errors in a different way.
Currently the error manager is now back in the library. It's enabled for Main when it is calling
PROJSERVER.ProjectDataPreInit(this, projId)
to detect bad project files and pop-up an alert to let users know something is wrong.In all other cases, error catching traps are in place, but are commented out. The affected modules are:
ac-blueprints / m_CompileBlueprint()
- catch TextToScript, SymbolizeBlueprint, CompileBlueprint, and RegisterBlueprintac-editmgr / m_AddSlotsValidation()
- catch ValidateStatement()ac-instances / SetInstances()
- catch STORE.updateAndPublish(instances)ac-metadata / SetMetadata()
- catch DCPROJECT.UpdateProjectData() and STORE.updateAndPublish()ac-rounds / SetRounds()
- catch DCPROJECT.UpdateProjectData() and STORE.updateAndPublish()ac-wizcore / InitSetState()
- catch script_tokens interceptState()conditions MakeAgentExprTest()
- catch ParseExpressionconditions MakePairAgentExprTest()
- catch ParseExpressionclass-expr-evaluator-v2
- catch Evaluateclass-symbol-intepreter anyExpr()
- catch ParseExpressionscript-compiler DecodeStatement()
- catch DecodeToken which potentially recursesscript-tokenizer TextToScript()
- catch tokenize()transpiler-v2 ValidateLineText()
- catch TextToScript, ValidateStatementsim-agents MakeAgent()
- catch OpenBundle, CompileText, GetAgentById, MakeAgent, agent.exec(initScript)sim-conditions m_ProcessInteractions
- retrieve results from SIMCOND.PairAgentFilter()sim-rounds RoundInit()
- catch m_RunScript(round.initScript)sim-rounds RoundStop()
- catch m_RunScript(round.endScript)This is not a complete trap strategy, but is good enough to start the discussion on how to trap errors in a way that they can be reported by the GUI. One error can cascade through the entire system under very different contexts; is a script error occurring during compile time or runtime? Is it a script defined as an initScript or roundScript causing the compiler to crash? Is the error due to a missing symbol or syntax error? This will require considerable guidance to outline the system in terms of user operations mapped to underlying technical pathways so we know where to insert the error traps.
OTHER MISCELLANEOUS FIXES