aotrautils 0.0.1470 → 0.0.1472

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:24)»*/
3
+ /*utils COMMONS library associated with aotra version : «1_29072022-2359 (26/04/2025-12:56:05)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -4894,7 +4894,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
4894
4894
 
4895
4895
 
4896
4896
 
4897
- /*utils CLIENT library associated with aotra version : «1_29072022-2359 (26/04/2025-02:18:24)»*/
4897
+ /*utils CLIENT library associated with aotra version : «1_29072022-2359 (26/04/2025-12:56:05)»*/
4898
4898
  /*-----------------------------------------------------------------------------*/
4899
4899
  /* ## Utility global methods in a browser (htmljs) client environment.
4900
4900
  *
@@ -13466,7 +13466,7 @@ getAORTACClient=function(clientId=getUUID(), serverNodeOrigin="ws://127.0.0.1:40
13466
13466
 
13467
13467
 
13468
13468
 
13469
- /*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (26/04/2025-02:18:24)»*/
13469
+ /*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (26/04/2025-12:56:05)»*/
13470
13470
  /*-----------------------------------------------------------------------------*/
13471
13471
 
13472
13472
 
@@ -14705,7 +14705,7 @@ function rayVsUnitSphereClosestPoint(p, r) {
14705
14705
  // MUST REMAIN AT THE END OF THIS LIBRARY FILE !
14706
14706
 
14707
14707
  AOTRAUTILS_GEOMETRY_LIB_IS_LOADED=true;
14708
- /*utils AI library associated with aotra version : «1_29072022-2359 (26/04/2025-02:18:24)»*/
14708
+ /*utils AI library associated with aotra version : «1_29072022-2359 (26/04/2025-12:56:05)»*/
14709
14709
  /*-----------------------------------------------------------------------------*/
14710
14710
 
14711
14711
 
@@ -14851,7 +14851,7 @@ getOpenAIAPIClient=(modelName, apiURL, agentRole, defaultPrompt)=>{
14851
14851
 
14852
14852
 
14853
14853
 
14854
- /*utils SERVER library associated with aotra version : «1_29072022-2359 (26/04/2025-02:18:24)»*/
14854
+ /*utils SERVER library associated with aotra version : «1_29072022-2359 (26/04/2025-12:56:05)»*/
14855
14855
  /*-----------------------------------------------------------------------------*/
14856
14856
 
14857
14857
 
@@ -15835,13 +15835,12 @@ WebsocketImplementation={
15835
15835
 
15836
15836
  // BROWSER CLIENT INSTANCE :
15837
15837
  const browserInstance={
15838
+
15838
15839
  clientSocket:clientSocket,
15839
-
15840
15840
  receptionEntryPoints:[],
15841
15841
 
15842
15842
  receive:(channelNameParam, doOnIncomingMessage, clientsRoomsTag=null, receptionEntryPointId=null, listenerConfig={destroyListenerAfterReceiving:false})=>{
15843
15843
 
15844
-
15845
15844
  // DBG
15846
15845
  lognow("INFO : (CLIENT-BROWSER) SETTING UP RECEIVE for :",channelNameParam);
15847
15846
 
@@ -15852,29 +15851,25 @@ WebsocketImplementation={
15852
15851
  // TODO : ADD TO ALL OTHER SUBSYSTEMS !
15853
15852
  id:receptionEntryPointId,
15854
15853
  listenerConfig:listenerConfig,
15854
+ doOnIncomingMessage:doOnIncomingMessage,
15855
15855
  execute:(eventOrMessage)=>{
15856
15856
 
15857
15857
  const dataWrapped=WebsocketImplementation.getMessageDataBothImplementations(eventOrMessage);
15858
-
15859
- // // DBG
15860
- // lognow("(CLIENT) (DEBUG) CLIENT RECEIVED SOMETHING FROM SERVER :",dataWrapped);
15861
15858
 
15862
15859
  // Channel information is stored in exchanged data :
15863
- if(dataWrapped.channelName && dataWrapped.channelName!==channelNameParam) return;
15860
+ if(dataWrapped.channelName && dataWrapped.channelName!==this.channelName) return;
15864
15861
 
15865
- const clientSocket=browserInstance.clientSocket;
15866
-
15867
15862
  // Room information is stored in client socket object :
15868
- if(!WebsocketImplementation.isInRoom(clientSocket,clientsRoomsTag)) return;
15869
-
15870
- if(doOnIncomingMessage)
15871
- doOnIncomingMessage(dataWrapped.data, clientSocket);
15863
+ const clientSocket=browserInstance.clientSocket;
15864
+ if(!WebsocketImplementation.isInRoom(clientSocket, this.clientsRoomsTag)) return;
15872
15865
 
15873
15866
  // We remove one-time usage listeners :
15874
- if(listenerConfig && listenerConfig.destroyListenerAfterReceiving)
15875
- remove(browserInstance.receptionEntryPoints,receptionEntryPoint);
15867
+ // We remove BEFORE executing doOnIncomingMessage(), because in this function we can have other listener registration UNDER THE SAME ID !
15868
+ if(this.listenerConfig && this.listenerConfig.destroyListenerAfterReceiving)
15869
+ remove(browserInstance.receptionEntryPoints, receptionEntryPoint);
15876
15870
 
15877
-
15871
+ if(this.doOnIncomingMessage)
15872
+ this.doOnIncomingMessage(dataWrapped.data, clientSocket);
15878
15873
 
15879
15874
  }
15880
15875
  };
aotrautils/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils",
3
- "version": "0.0.1470",
3
+ "version": "0.0.1472",
4
4
  "main": "aotrautils.build.js",
5
5
  "description": "A library for vanilla javascript utils (client-side) used in aotra javascript CMS",
6
6
  "author": "Jeremie Ratomposon <info@alqemia.com> (https://alqemia.com)",