Page 1 of 1

[BUG] RoomVariable is reported as not persistent

Posted: 04 Aug 2011, 10:47
by mente
Hello,

Encountered bug. Using SFS2x RC3 server and SFS2x RC3 client. Trying to set room variable on server:

Code: Select all

        RoomVariable state = new SFSRoomVariable(RoomVariableName.SCRIPT_STATE.toString(), new SFSObject(), true, true, false);
        state.setOwner(room.getOwner());
        
        logger.debug("State is " + state);
        List<RoomVariable> vars = new ArrayList(1);
        vars.add(state);
        getAPI().setRoomVariables(room.getOwner(), room, vars);
Log shows following:

Code: Select all

11:45:29,304 DEBUG [pool-1-thread-2] event.RoomAddedHandler     - State is { N: state, T: OBJECT, V: [SFSObject, size: 0], Pr: true, Ps: true, G: false, H: false, Owner: ( User Name: account-1, Id: 0, Priv: 0, Sess: 95.69.176.224:56536 )  }
11:45:29,305 DEBUG [pool-1-thread-2] event.RoomAddedHandler     - State is { N: state, T: OBJECT, V: [SFSObject, size: 0], Pr: true, Ps: true, G: false, H: false, Owner: ( User Name: account-1, Id: 0, Priv: 0, Sess: 95.69.176.224:56536 )  }
Looks like variable is reported persistent on server.
But following assert on client fails:

Code: Select all

        assertTrue("State is persistent", state.isPersistent());
I trust server-side, so it looks like error on client.

Thanks

Posted: 05 Aug 2011, 07:53
by ThomasLund
Added to bugtracker - thanks for reporting

Posted: 05 Aug 2011, 14:20
by mente
One more bug: admin panel reports, that this variable is not private, not persistent. But it's persistent and private.

Posted: 05 Aug 2011, 16:33
by mente
Looks like bug is in server, not client.
Update on this bug: when roomvariable owner leaves the room, variable is removed. Server-side generation of variable:

Code: Select all

RoomVariable stateVariable = new SFSRoomVariable(RoomVariableName.SCRIPT_STATE.toString(), state, true, true, false);
stateVariable.setOwner(room.getOwner());

Posted: 16 Aug 2011, 08:19
by Lapo
Thanks for reporting.
I confirm that there is a client side bug on the PERSISTENT flag which has been fixed and we'll release a quick patch soon.
One more bug: admin panel reports, that this variable is not private, not persistent. But it's persistent and private.
This is confusing.
If the variable is set as PERSISTENT and PRIVATE then you'd expect exactly to see those two flags active in the AdminTool which is what happens.
We didn't find any anomalies.

Cheers

Posted: 16 Aug 2011, 08:24
by mente
That's the problem. Two flags should be true, but both of them are false.
Let's see what will be after a quick fix release. Maybe I've missed something

Posted: 16 Aug 2011, 08:27
by Lapo
We are not able to reproduce that.
Suggestion: make sure you are not using an older AdminTool cached by the browser. Clear your cache and reload the tool, it should work just fine.

Cheers

Posted: 16 Aug 2011, 08:29
by mente
Ok, will do it on next patch release :)