-
Bug
-
Resolution: Unresolved
-
Major
-
None
Adding a new Connection Listener or Event Listener to already connected Gerrit server will not receive connectionEstablished event.
addListener in gerrit-events library (https://github.com/sonyxperiadev/gerrit-events.git) will not trigger connectionEstablished if connection is already established.
See GerritServer.java:517
This can be fixed here in this plugin but with risk of calling connectionEstablished twice
gerritConnection.addListener(projectListUpdater);
if (isConnected()) {
projectListUpdater.connectionEstablished();
}
1) adding listener to not connected server
2) server is connected -> calling connectionEstablished
3) testing that server is connected -> calling connectionEstablished second time
Maybe the best way is to change the code of addListener in gerrit-events library.
Correct me if my thoughts are wrong. Comments are welcome.
My knowledge of Java and Java internals are poor to fix it myself.