aotrautils 0.0.149 → 0.0.152

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.0.0.000 (17/07/2022-03:50:48)»*/
3
+ /*utils COMMONS library associated with aotra version : «1.0.0.000 (17/07/2022-04:02:53)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -4828,7 +4828,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
4828
4828
 
4829
4829
 
4830
4830
 
4831
- /*utils CLIENT library associated with aotra version : «1.0.0.000 (17/07/2022-03:50:48)»*/
4831
+ /*utils CLIENT library associated with aotra version : «1.0.0.000 (17/07/2022-04:02:53)»*/
4832
4832
  /*-----------------------------------------------------------------------------*/
4833
4833
  /* ## Utility global methods in a browser (htmljs) client environment.
4834
4834
  *
@@ -11678,7 +11678,7 @@ createFusrodaClient=function(doOnClientReady, doOnDataReception, urlParam=null,
11678
11678
 
11679
11679
 
11680
11680
 
11681
- /*utils GEOMETRY library associated with aotra version : «1.0.0.000 (17/07/2022-03:50:48)»*/
11681
+ /*utils GEOMETRY library associated with aotra version : «1.0.0.000 (17/07/2022-04:02:53)»*/
11682
11682
  /*-----------------------------------------------------------------------------*/
11683
11683
 
11684
11684
 
@@ -12884,7 +12884,7 @@ function rayVsUnitSphereClosestPoint(p, r) {
12884
12884
  // MUST REMAIN AT THE END OF THIS LIBRARY FILE !
12885
12885
 
12886
12886
  AOTRAUTILS_GEOMETRY_LIB_IS_LOADED=true;
12887
- /*utils SERVER library associated with aotra version : «1.0.0.000 (17/07/2022-03:50:48)»*/
12887
+ /*utils SERVER library associated with aotra version : «1.0.0.000 (17/07/2022-04:02:53)»*/
12888
12888
  /*-----------------------------------------------------------------------------*/
12889
12889
 
12890
12890
 
@@ -13244,24 +13244,9 @@ WebsocketImplementation={
13244
13244
  }
13245
13245
 
13246
13246
 
13247
- // DBG
13248
- lognow(" Channel information:dataWrapped",dataWrapped);
13249
- lognow(" Channel information:dataWrapped",JSON.stringify(dataWrapped));
13250
- lognow(" Channel information:dataWrapped.channelName«"+dataWrapped.channelName+"»");
13251
- lognow(" Channel information:receptionEntryPoint.channelName«"+receptionEntryPoint.channelName+"»");
13252
- lognow(" C1",(dataWrapped.channelName!=receptionEntryPoint.channelName));
13253
- lognow(" C2",(dataWrapped.channelName!==receptionEntryPoint.channelName));
13254
- lognow(" C11",(dataWrapped.channelName==receptionEntryPoint.channelName));
13255
- lognow(" C22",(dataWrapped.channelName===receptionEntryPoint.channelName));
13256
- lognow(" C111",(dataWrapped.channelName.normalize()==receptionEntryPoint.channelName.normalize()));
13257
- lognow(" C222",(dataWrapped.channelName.normalize()===receptionEntryPoint.channelName.normalize()));
13258
-
13259
-
13260
- ////
13261
- // CURRENT 5 : PROBLEM IS HERE :
13262
13247
 
13263
13248
  // Channel information is stored in exchanged data :
13264
- if(dataWrapped.channelName.normalize()!==receptionEntryPoint.channelName.normalize()) return;
13249
+ if(dataWrapped.channelName!==receptionEntryPoint.channelName) return;
13265
13250
 
13266
13251
 
13267
13252
  const clientSocket=clientSocketParam;
@@ -13285,16 +13270,9 @@ WebsocketImplementation={
13285
13270
 
13286
13271
 
13287
13272
  if(!WebsocketImplementation.useSocketIOImplementation) clientSocketParam.addEventListener("message", doOnMessage);
13288
- else{
13289
-
13290
- // DBG
13291
- clientSocketParam.onAny((event,args) => { console.log(`MAIS PUTAIN : ${event}:`,args); });
13292
- clientSocketParam.on(channelName,(args, clientSocket) => { console.log(`MAIS OSKOUR :${args} ${clientSocket}`); });
13273
+ else clientSocketParam.on(channelName, doOnMessage);
13293
13274
 
13294
13275
 
13295
-
13296
- clientSocketParam.on(channelName, doOnMessage);
13297
- }
13298
13276
 
13299
13277
 
13300
13278
 
@@ -13321,7 +13299,8 @@ WebsocketImplementation={
13321
13299
  // TODO : FIXME : Use one single interface !
13322
13300
  let serverClients;
13323
13301
  if(!WebsocketImplementation.useSocketIOImplementation) serverClients=nodeServerInstance.serverSocket.clients;
13324
- else serverClients=nodeServerInstance.serverSocket.sockets.clients();
13302
+ // OLD: else serverClients=nodeServerInstance.serverSocket.sockets.clients();
13303
+ else serverClients=nodeServerInstance.serverSocket.sockets;
13325
13304
 
13326
13305
  serverClients.forEach((clientSocket)=>{
13327
13306
 
@@ -13502,7 +13481,8 @@ WebsocketImplementation={
13502
13481
 
13503
13482
  // TODO : FIXME : Use one single interface !
13504
13483
  if(!WebsocketImplementation.useSocketIOImplementation) serverClients=nodeServerInstance.serverSocket.clients;
13505
- else serverClients=nodeServerInstance.serverSocket.sockets.clients();
13484
+ // OLD : else serverClients=nodeServerInstance.serverSocket.sockets.clients();
13485
+ else serverClients=nodeServerInstance.serverSocket.sockets;
13506
13486
 
13507
13487
  serverClients.forEach((clientSocket)=>{
13508
13488
  clearInterval(clientSocket.stateCheckInterval);
@@ -13741,7 +13721,17 @@ WebsocketImplementation={
13741
13721
  // const dataWrapped=JSON.parse(message);
13742
13722
  // dataWrapped=getAt(dataWrapped,0);// We get the root element
13743
13723
 
13744
- const dataWrapped=(WebsocketImplementation.useFlatStrings?JSON.parse(message):message);
13724
+
13725
+ let dataWrapped=message;
13726
+ try{
13727
+ dataWrapped=(WebsocketImplementation.useFlatStrings || isString(message)?JSON.parse(message):message);
13728
+ }catch(error1){
13729
+ // TRACE
13730
+ lognow(`ERROR : Failed to parse JSON for string «${dataWrapped}»`,error1);
13731
+ dataWrapped=(isString(message)?message:JSON.stringify(message));
13732
+ }
13733
+
13734
+
13745
13735
 
13746
13736
 
13747
13737
  // Channel information is stored in exchanged data :
aotrautils/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils",
3
- "version": "0.0.149",
3
+ "version": "0.0.152",
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)",