question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sync System: root object added listener does not raise events properly

See original GitHub issue

I’m just having trouble getting a listener on the root object to raise events properly.

RootSyncObject = SharingStage.Instance.Manager.GetRootSyncObject();
objElementAdapter = new ObjectElementAdapter();
objElementAdapter.ElementAddedEvent += OnElementAdded;
objElementAdapter.ElementDeletedEvent += OnElementDeleted;
RootSyncObject.AddListener(objElementAdapter);

I’m getting the root object and adding a listener but that listener never raises ElementAddedEvent nor ElementDeletedEvent.

Here’s the branch I’ve set up for proper testing: https://github.com/HodgsonSDAS/HoloToolkit-Unity/tree/SyncSystemTests

  1. Open SyncSystemTests.unity
  2. Add breakpoints to ObjectElementAdapter.cs lines 34, 123, & 137.
  3. Start Debugging in visual studio and attach to Unity Editor.
  4. Run the SyncSystemTest.unity scene.
  5. Create/Delete object object and int elements.
  6. Increment and decrement int value.
  7. Observe events not raised.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:16 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
Ziugycommented, Nov 10, 2016

Oh, local changes do not raise events on the local client. Events only get raised by remote client changes. You need to keep any local modifications done to intValueText.text.

1reaction
Ziugycommented, Nov 10, 2016

D’oh, looks like it was. Pull request makes much more sense! Done. You should see the add/delete event for ObjectElements too, but I didn’t test that. Only investigated the IntElement for you.

Note that for every ObjectElement you need to AddListener to receive that ObjectElement’s events. The change events don’t propagate up to the root.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Set listener for store events in a controller - javascript
Try something like 'widgetname gridPanel #store' (where widgetname is for the view assigned to the controller). I don't have something to test ...
Read more >
Spring Boot Application Events Explained
Spring Boot allows us to throw and listen to specific application events that we can process as we wish. Events are meant for...
Read more >
Event listeners not working? 3 key areas to troubleshoot
Are your event listeners not working as you'd expect? Here are 3 key areas to troubleshoot to help you get everything triggering as...
Read more >
Domain events: Design and implementation
Alternately, you can have the aggregate root subscribed for events raised by members of its aggregates (child entities).
Read more >
6 Handling Events
This chapter describes how to handle events on the server as well as on the client.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found