Ok, thank you. While diffing, I saw that my team has modified many other source code that I don’t want to publish before cleaned up.
So for now, I just attach you the primary bugfix I was speaking of above, preventing us to use webchat in production.
Fortunately this bug is not located in the workgroup.jar as I wrongly stated out yesterday, so I don’t need to commit the sources of the exploded workgroup.jar. However, I fixed some (potential) NPE’s in the source code of workgroup.jar which I’ll publish once cleaned up the project. The same applies to my changes due to the dwr upgrade.
Some words about the attached bugfix: new chat sessions could be killed because the ChatManager periodically executes removeStaleChats.
The problem with this was, that it could be executed just in the same milisecond when a new chat session was created. In this case, the chat session had not yet a chance to join a group or to execute lastCheck. Hence, the ChatManager thought it was stale and removed it.
The bugfix gives newly created chat sessions some time to get in place before they are considered to be stale.
For us, this modification was essential because our chat sessions join a group not upon creation but only after the client has sent a message, which will notify the agent only then. We did not want to notify the agent earlier because it may happen that a client opens a chat window without ever writing a message.
That being said, it points out that the original code will fail less often than our modified code without the bugfix. However, the original code may fail too without the bugfix when removeStaleChats is executed in the same milisecond a new chat session is created.
I don’t see how to attach a text file here (only image or video seems to be possible). So I pasted it here:http://pastie.org/3090402
Btw. I added in ChatSession.java just a final long createdTimestamp and its getter but the diff command was not able to outline it.