Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

LC CS - Auto Login / Log off syndrome

Avatar

Level 2

LC CS - Auto Login / Log off syndrome:  After Login to the AFCS server, sometimes user gets  automatically logged off/in randomly. This is a inconsistent behavior.

For example:

Considering User A and User B logged into the chat room, after some period of time the User A/User B automatically gets logged off from the chat room. Immediately it tries to login, the login happens successfully. But while creating the session the below error thrown.

Error

Error: The node is not synchronized. Make sure you've subscribed.

onCustomFieldRegister

onCustomFieldRegister

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

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

at com.adobe.component.chat.model.presence::PresenceConnectSession/setChatUserId()[E:\FFAapp\ChatComponentLib\src\com\adobe\component\chat\model\presence\PresenceConnectSession.as:173]

at com.adobe.component.chat.model.presence::PresenceConnectSession/onCustomFieldRegister()[E:\FFAapp\ChatComponentLib\src\com\adobe\component\chat\model\presence\PresenceConnectSession.as:181]

at flash.events::EventDispatcher/dispatchEventFunction()

at flash.events::EventDispatcher/dispatchEvent()

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

at flash.events::EventDispatcher/dispatchEventFunction()

at flash.events::EventDispatcher/dispatchEvent()

at com.adobe.rtc.sharedModel::CollectionNode/http://www.adobe.com/2006/connect/cocomo/messaging/internal::receiveNode()[C:\work\main\connect\cocomoPlayer10\src\com\adobe\rtc\sharedModel\CollectionNode.as:705]

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

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

at com.adobe.rtc.session.managers::SessionManagerBase/receiveNodes()[C:\work\main\connect\cocomoPlayer10\src\com\adobe\rtc\session\managers\SessionManagerBase.as:364]


Log file

RECEIVED LOGIN AT SESSION

  .user descriptor from server [object]

    \\

    .displayName [string]= Abhiram G Raj

    .role [number]= 100

    .userID [string]= WCD-413847BC49DB8B8499201587

    .affiliation [number]= 100

RECEIVENODES UserManager

receiveAllSynchData UserManager

Setting isPeer to false as connection is not RTMFP for UserAbhiram G Raj

RECEIVENODES FileManager

receiveAllSynchData FileManager

checkManagerSync:[object FileManager]

RECEIVENODES AVManager

receiveAllSynchData AVManager

checkManagerSync:[object StreamManager]

RECEIVENODES RoomManager

receiveAllSynchData RoomManager

checkManagerSync:[object UserManager]

Testing ...... Sync Login + this.connectSession.isSynchronized = true

connectChat

login complete

)

NetConnection.Connect.Closed

@@@@@@@@@@@@  >>>>> User List logout

@@@@@@@@@@@@  >>>>> AFCS logout

logout complete

CONNECTSESSION:LOGOUT

Testing ...... Sync Login + this.connectSession.isSynchronized = false

CONNECTSESSION:LOGOUT

RECEIVED LOGIN AT SESSION

  .user descriptor from server [object]

    \\

    .displayName [string]= Abhiram G Raj

    .role [number]= 100

    .userID [string]= WCD-413847BC49DB8B8499201587

    .affiliation [number]= 100

RECEIVENODES UserManager

Error: The node is not synchronized. Make sure you've subscribed.

  rest is same as above mentioned error

11 Replies

Avatar

Former Community Member

Hi,

You shouldn't get auto log outs unless your connection breaks down. In that case, we have a reconnect mechanism that tries to connect you back if connection has been restored. I would be interested in knowing details of why you get logged off suddenly.

Regarding login back, this error on reconnect you mentioned shouldn’t happen. Send us a small test app that reproduces this error.

Thanks

Hironmay Basu

Avatar

Level 2

Hi Hironmay,


Nice to see your reply .

Please share your email id so that i can share sample code with you , dont have acces to free file upload sites

Thanks
Ritesh

Thanks,
Ritesh

Avatar

Former Community Member

You can post the small sample code in the forum itself.

Thanks

Hironmay Basu

Avatar

Level 2

Addiing Listener for Session Event

public function connectWithAuthen( userName:String, passWord:String, room:String ):void

{

trace('connectWithAuth success');

var authenticator:AdobeHSAuthenticator = new AdobeHSAuthenticator();

authenticator.userName = userName;

authenticator.password = passWord;

this.connectSession = new ConnectSessionContainer();

this.connectSession.addEventListener(SessionEvent.SYNCHRONIZATION_CHANGE, onSync, false, 0, true);

this.connectSession.addEventListener(SessionEvent.ERROR, onSessionError, false, 0, true );

this.connectSession.authenticator = authenticator;

this.connectSession.roomURL = room;

this.connectSession.login();

}

onSync Functoin

public function onSync(event:SessionEvent):void {

if( this.connectSession.isSynchronized )

{

this.doConnectChat = true;

trace('Testing ...... Sync Login'+this.connectSession.isSynchronized) ;

var userManager:UserManager = event.currentTarget.userManager as UserManager;

userManager.addEventListener(UserEvent.USER_CREATE, onUserCreated,

false, 0, true);

userManager.addEventListener(UserEvent.USER_REMOVE, onUserRemoved,

false, 0, true);

userManager.addEventListener(UserEvent.USER_STATUS_CHANGE, onUserStatusChange,

false, 0, true);

userManager.addEventListener(UserEvent.CUSTOM_FIELD_REGISTER, onCustomFieldRegister,

false, 0, true );

this.displayName = this.connectSession.userManager.getUserDescriptor( this.connectSession.userManager.myUserID ).displayName;

var isDefined:Boolean = userManager.isCustomFieldDefined( LibProperties.CHAT_USER_ID ) ;

if( !isDefined && userManager.myUserRole == UserRoles.OWNER )

{

userManager.registerCustomUserField( LibProperties.CHAT_USER_ID );

}

if( this.doConnectChat )

{

if( isDefined )

setChatUserId( userManager.myUserID );

connectChat();

}

tempUserList = connectSession.userManager.userCollection

as ArrayCollection;

tempUserList.refresh();

var loginEvent:LoginEvent = new LoginEvent(LoginEvent.LOGIN_COMPLETE,tempUserList,this.connectSession,this );

loginEvent.userList = tempUserList

this.dispatchEvent( loginEvent );

}

else

{

this.doConnectChat = false;

this.dispatchEvent( new LoginEvent( LoginEvent.LOGOUT_COMPLETE,null,null, this ) );

trace('Testing ...... Sync Logout'+this.connectSession.isSynchronized) ;

this.connectSession.logout();

}

}

Avatar

Former Community Member

As I posted in forum, this week Adobe has office off. So, I will get back to you running your code next week.

Thanks

Hironmay Basu

Avatar

Level 1

I'm also getting this error, though in a completely different context.

I'm using custom SharedObjects.  I'm making sure the ConnectSession is synchronized before I subscribe to them.  My application will work fine for several hours and then it'll randomly stop working and I have to wait a while until it starts working again.  Restarting the computer doesn't work -- it really seems time based.

It's a really annoying error and it's having an effect on my productivity : /

Avatar

Employee

How long is "several hours" ?

We have some code that tries to disconnect clients after 12 hours of inactivity (we can't really keep rooms running forever)

If your case is reproducible, please collect the logs and send them over. Also, it would help if you tell us your account and room so that we can look at the server-side logs.

Avatar

Level 1

I don't think it's an inactivity disconnect.  The way I'm using the service right now is for debugging purposes, so it's more like very frequent log-ons, log-offs, disconnects, and subscriptions.  After a few hours of this (maybe 3 on average?) the nodes will stop subscribing.  I'll try tinkering with it tomorrow to get a simple script that can reproduce the error.

Thanks for the quick reply 

Edit: I think I fixed it.  Not entirely sure what I did exactly but I made sure the connect session was synchronized first and that nothing was synchronizing out of order.

Avatar

Level 1

Okay, I found out what was going wrong.  Oddly enough, when I added a SYNCHRONIZATION_CHANGE event listener to the ConnectSession variable and subscribed to all of my SharedObjects in the callback function, none of them would synchronize.  When I subscribed to the SharedObjects before the ConnectSession synchronized everything worked.  Weird.

Edit: RiteshYadav's sample is hard to read, but it looks like he has a lot of logic in the callback function of SYNCHRONIZATION_CHANGE.  He's probably trying to sync with something after the ConnectSession is synced too.

Avatar

Level 2

Once user is logged out , this.connectSession.isSynchronized is not setting to false it remains true  so at the time of next login control is going to else condition

Not trying to sync with something after the ConnectSession is synced .just  calling a hander for SessionEvent.SYNCHRONIZATION_CHANGE event

Avatar

Level 1

I think the line:

tempUserList.refresh();

may be the culprit.  Try fiddling with it (ie commenting lines out) to get your script to work and then finding the line that's causing it.

Another problem I encountered was syncing to the same CollectionNode twice which, for some reason, prevents the SharedObjects from syncing after you sync to the CollectionNode the second time.