-
Notifications
You must be signed in to change notification settings - Fork 12
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
Toolsocket updates #1031
Toolsocket updates #1031
Conversation
dangond-ptc
commented
Apr 2, 2024
- Adapted codebase to use ToolSocket v2.0.0's API.
I'm still working on tracking down the cause of the failing tests. |
Ok, after much investigation: the current code passes all tests on a clean install with the right toolsocket dependency. The issues I was having are:
|
libraries/utilities.js
Outdated
@@ -75,7 +75,7 @@ const {identityFolderName} = require('../constants.js'); | |||
var hardwareIdentity = path.join(objectsPath, identityFolderName); | |||
|
|||
let socketReferences = { | |||
realityEditorUpdateSocketArray: null | |||
realityEditorUpdateSocketSubscriptions: null | |||
}; | |||
|
|||
let ioReference = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can drop this variable and its use in utilities.setup()
for (var thisEditor in realityEditorSocketArray) { | ||
realityEditorSocketArray[thisEditor].forEach((thisObj) => { | ||
if (typeof sourceSocketID !== 'undefined' && thisEditor === sourceSocketID && msgContent.object === thisObj.object && msgContent.frame === thisObj.frame) { | ||
function sendMessageToEditors(msgContent, sourceSocket) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great improvement in readability!
(fix lint errors before merging) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
server.js
Outdated
const subscriptions = []; | ||
subscriptions.socket = socket; | ||
realityEditorSocketSubscriptions.push(subscriptions); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Little bit confused about adding a socket property to an array, rather than using an object, is there a reason to structure it like this? (I'm not always up-to-date with clean coding conventions so I figure you have a valid reason, just curious)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at it now, I cannot come up with a good answer for this. I'll push a commit with a more sensible arrangement!
```bash | ||
git clone --recurse-submodules https://github.com/ptcrealitylab/vuforia-spatial-edge-server.git | ||
cd vuforia-spatial-edge-server | ||
./scripts/ci.sh | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating the README, too!
@benptc Added a new commit regarding the socket property on the arrays. Lmk if that's better and looks good! |