@nxtedition/lib 28.0.27 → 28.0.29

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 (3) hide show
  1. package/app.js +2 -2
  2. package/package.json +2 -2
  3. package/shared.js +3 -0
package/app.js CHANGED
@@ -769,7 +769,7 @@ export function makeApp(appConfig, onTerminateOrMeta, metaOrNull) {
769
769
  monitorProviders.stats$
770
770
  .subscribe((stats) => {
771
771
  try {
772
- statsBC.postMessage({ id: threadId, data: JSON.stringify(JSON.parse(stats)) })
772
+ statsBC.postMessage({ id: threadId, data: JSON.parse(JSON.stringify(stats)) })
773
773
  } catch (err) {
774
774
  statsBC.postMessage({ id: threadId, data: { error: serializeError(err) } })
775
775
  logger.error(
@@ -1095,7 +1095,7 @@ export function makeApp(appConfig, onTerminateOrMeta, metaOrNull) {
1095
1095
  monitorProviders.status$
1096
1096
  .subscribe((status) => {
1097
1097
  try {
1098
- statusBC.postMessage({ id: threadId, data: JSON.stringify(JSON.parse(status)) })
1098
+ statusBC.postMessage({ id: threadId, data: JSON.parse(JSON.stringify(status)) })
1099
1099
  } catch (err) {
1100
1100
  statusBC.postMessage({
1101
1101
  id: threadId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/lib",
3
- "version": "28.0.27",
3
+ "version": "28.0.29",
4
4
  "license": "UNLICENSED",
5
5
  "author": "Robert Nagy <robert.nagy@boffins.se>",
6
6
  "type": "module",
@@ -92,5 +92,5 @@
92
92
  "canvas": "^3.1.0",
93
93
  "rxjs": "^7.0.0"
94
94
  },
95
- "gitHead": "974526e5bb5a547662e75a360137e1e590f0a399"
95
+ "gitHead": "9a796e26b5fd7bf119919c756967597722decd67"
96
96
  }
package/shared.js CHANGED
@@ -94,6 +94,9 @@ export function reader({ sharedState, sharedBuffer }) {
94
94
  // wrapped around to the beginning of the buffer.
95
95
  if (dataLen === -1) {
96
96
  readPos = 0
97
+ // After wrapping, we must re-check against the writer's position.
98
+ // It's possible the writer is now at a position > 0.
99
+ writePos = Atomics.load(state, WRITE_INDEX) | 0
97
100
  } else {
98
101
  if (dataLen < 0) {
99
102
  throw new Error('Invalid data length')