Expand my Community achievements bar.

userManager.subscribe() question

Avatar

Former Community Member

Can someone explain to me what subscribe() does on the userManager class?  I've attached a file that will work if the line

this.session.userManager.subscribe(); is commented out.  As soon as that line is uncommented the application throws a runtime exception:

Error: MessageManager.createNode : insufficient permissions to create node

at com.adobe.rtc.messaging.manager::MessageManager/http://www.adobe.com/2006/connect/cocomo/messaging/internal::createNode()[C:\work\main\connect\cocomoPlayer10\src\com\adobe\rtc\messaging\manager\MessageManager.as:246]

at com.adobe.rtc.sharedModel::CollectionNode/createNode()[C:\work\main\connect\cocomoPlayer10\src\com\adobe\rtc\sharedModel\CollectionNode.as:362]

at com.adobe.rtc.sharedManagers::UserManager/registerCustomUserField()[C:\work\main\connect\cocomoPlayer10\src\com\adobe\rtc\sharedManagers\UserManager.as:635]

at PresenceTest/onUserManagerSync()[/projects/mosaic/tiles_ui/src/PresenceTest.mxml:55]

at flash.events::EventDispatcher/dispatchEventFunction()

at flash.events::EventDispatcher/dispatchEvent()

Thanks.

-chris    

2 Replies

Avatar

Employee

Hi Chris,

As you figured out, you dont have to subscribe to the UserManager. The ConnectSession creates and subscribes it for you. I did a bit of digging and figured that due to multiple subscribes of the UserManager it goes out of sync at the time you create your custom user field. I am sure you wont hit the error if you use a new user manager(provide it a new connect session) instead of using the session's user manager.

As for your question about what does subscribe do, it creates a collection node internally and subscribes to it.The collection node stores a roster of all the users and their details and fires necessary events as users change their roles or exit the room.

Thanks

Arun

Avatar

Former Community Member

I had a feeling that something else was calling the subscribe() method for the userManager, and it makes sense that the ConnectSession would do that.  My the reason I posted this on here was b/c there was nothing in the api docs for subscribe() and I wanted to make sure I was not missing something. Thanks for your help.

-chris