aotrautils-srv 0.0.1470 → 0.0.1471

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
 
2
2
 
3
- /*utils COMMONS library associated with aotra version : «1_29072022-2359 (26/04/2025-02:18:29)»*/
3
+ /*utils COMMONS library associated with aotra version : «1_29072022-2359 (26/04/2025-12:41:50)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -4894,7 +4894,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
4894
4894
 
4895
4895
 
4896
4896
 
4897
- /*utils AI library associated with aotra version : «1_29072022-2359 (26/04/2025-02:18:29)»*/
4897
+ /*utils AI library associated with aotra version : «1_29072022-2359 (26/04/2025-12:41:50)»*/
4898
4898
  /*-----------------------------------------------------------------------------*/
4899
4899
 
4900
4900
 
@@ -5040,7 +5040,7 @@ getOpenAIAPIClient=(modelName, apiURL, agentRole, defaultPrompt)=>{
5040
5040
 
5041
5041
 
5042
5042
 
5043
- /*utils SERVER library associated with aotra version : «1_29072022-2359 (26/04/2025-02:18:29)»*/
5043
+ /*utils SERVER library associated with aotra version : «1_29072022-2359 (26/04/2025-12:41:50)»*/
5044
5044
  /*-----------------------------------------------------------------------------*/
5045
5045
 
5046
5046
 
@@ -6024,13 +6024,12 @@ WebsocketImplementation={
6024
6024
 
6025
6025
  // BROWSER CLIENT INSTANCE :
6026
6026
  const browserInstance={
6027
+
6027
6028
  clientSocket:clientSocket,
6028
-
6029
6029
  receptionEntryPoints:[],
6030
6030
 
6031
6031
  receive:(channelNameParam, doOnIncomingMessage, clientsRoomsTag=null, receptionEntryPointId=null, listenerConfig={destroyListenerAfterReceiving:false})=>{
6032
6032
 
6033
-
6034
6033
  // DBG
6035
6034
  lognow("INFO : (CLIENT-BROWSER) SETTING UP RECEIVE for :",channelNameParam);
6036
6035
 
@@ -6056,14 +6055,15 @@ WebsocketImplementation={
6056
6055
  // Room information is stored in client socket object :
6057
6056
  if(!WebsocketImplementation.isInRoom(clientSocket,clientsRoomsTag)) return;
6058
6057
 
6059
- if(doOnIncomingMessage)
6060
- doOnIncomingMessage(dataWrapped.data, clientSocket);
6061
6058
 
6062
6059
  // We remove one-time usage listeners :
6060
+ // We remove BEFORE executing doOnIncomingMessage(), because in this function we can have other listener registration UNDER THE SAME ID !
6063
6061
  if(listenerConfig && listenerConfig.destroyListenerAfterReceiving)
6064
- remove(browserInstance.receptionEntryPoints,receptionEntryPoint);
6062
+ remove(browserInstance.receptionEntryPoints, receptionEntryPoint);
6065
6063
 
6066
6064
 
6065
+ if(doOnIncomingMessage)
6066
+ doOnIncomingMessage(dataWrapped.data, clientSocket);
6067
6067
 
6068
6068
  }
6069
6069
  };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils-srv",
3
- "version": "0.0.1470",
3
+ "version": "0.0.1471",
4
4
  "main": "aotrautils-srv.build.js",
5
5
  "description": "A library for vanilla javascript utils (server-side) used in aotra javascript CMS",
6
6
  "author": "Jeremie Ratomposon <info@alqemia.com> (https://alqemia.com)",