@transitive-sdk/utils-web 0.12.3 → 0.12.4

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.
Files changed (2) hide show
  1. package/dist/utils-web.js +11 -9
  2. package/package.json +1 -1
package/dist/utils-web.js CHANGED
@@ -729,25 +729,27 @@ var require_MqttSync = __commonJS({
729
729
  if (this.heartbeats == 1 && !migrate && onReady)
730
730
  onReady();
731
731
  this.heartbeats++;
732
- } else if (packet.retain || ignoreRetain) {
732
+ } else {
733
+ const json = mqttParsePayload(payload);
733
734
  let path = topicToPath2(topic);
734
735
  log2.debug("processing message", topic, path);
735
736
  if (sliceTopic) {
736
737
  path = path.slice(sliceTopic);
737
738
  topic = pathToTopic2(path);
738
739
  }
739
- const json = mqttParsePayload(payload);
740
740
  if (this.rpcHandlers[topic]) {
741
741
  this.handleRPCRequest(topic, json);
742
742
  } else if (this.rpcCallbacks[topic]) {
743
743
  this.handleRPCResponse(topic, json);
744
- } else if (this.isPublished(topic)) {
745
- this.publishedMessages.updateFromArray([...path, specialKey], json);
746
- this.data.update(topic, json, { external: true });
747
- } else if (this.isSubscribed(topic)) {
748
- log2.debug("applying received update", topic);
749
- const changes = this.data.update(topic, json);
750
- onChange && Object.keys(changes).length > 0 && onChange(changes);
744
+ } else if (packet.retain || ignoreRetain) {
745
+ if (this.isPublished(topic)) {
746
+ this.publishedMessages.updateFromArray([...path, specialKey], json);
747
+ this.data.update(topic, json, { external: true });
748
+ } else if (this.isSubscribed(topic)) {
749
+ log2.debug("applying received update", topic);
750
+ const changes = this.data.update(topic, json);
751
+ onChange && Object.keys(changes).length > 0 && onChange(changes);
752
+ }
751
753
  }
752
754
  }
753
755
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transitive-sdk/utils-web",
3
- "version": "0.12.3",
3
+ "version": "0.12.4",
4
4
  "description": "Web utils for the Transitive framework",
5
5
  "homepage": "https://transitiverobotics.com",
6
6
  "repository": {