@pluv/client 0.38.9 → 0.38.10

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,5 +1,5 @@
1
1
 
2
- > @pluv/client@0.38.9 build /home/runner/work/pluv/pluv/packages/client
2
+ > @pluv/client@0.38.10 build /home/runner/work/pluv/pluv/packages/client
3
3
  > tsup src/index.ts --format esm,cjs --dts
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -8,11 +8,11 @@
8
8
  CLI Target: es6
9
9
  ESM Build start
10
10
  CJS Build start
11
- CJS dist/index.js 49.48 KB
12
- CJS ⚡️ Build success in 115ms
13
- ESM dist/index.mjs 48.17 KB
14
- ESM ⚡️ Build success in 115ms
11
+ CJS dist/index.js 49.35 KB
12
+ CJS ⚡️ Build success in 113ms
13
+ ESM dist/index.mjs 48.03 KB
14
+ ESM ⚡️ Build success in 116ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 3283ms
16
+ DTS ⚡️ Build success in 3215ms
17
17
  DTS dist/index.d.mts 23.16 KB
18
18
  DTS dist/index.d.ts 23.16 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @pluv/client
2
2
 
3
+ ## 0.38.10
4
+
5
+ ### Patch Changes
6
+
7
+ - cadd963: Update the user's presence locally only via `PluvRoom.updateMyPresence` (i.e. do not update the user's own presence from WebSocket messages) to avoid update delays. This should fix some cases of "jitter" depending on network latecy.
8
+ - @pluv/crdt@0.38.10
9
+ - @pluv/types@0.38.10
10
+
3
11
  ## 0.38.9
4
12
 
5
13
  ### Patch Changes
package/dist/index.js CHANGED
@@ -874,11 +874,7 @@ var PluvRoom = class extends AbstractRoom {
874
874
  this._usersManager.patchPresence(connectionId, data.presence);
875
875
  const myPresence = this._usersManager.myPresence;
876
876
  const myself = (_a = this._usersManager.myself) != null ? _a : null;
877
- if ((myself == null ? void 0 : myself.connectionId) === connectionId) {
878
- this._stateNotifier.subjects["my-presence"].next(myPresence);
879
- this._stateNotifier.subjects["myself"].next(myself);
880
- return;
881
- }
877
+ if ((myself == null ? void 0 : myself.connectionId) === connectionId) return;
882
878
  const other = this._usersManager.getOther(connectionId);
883
879
  const others = this._usersManager.getOthers();
884
880
  this._otherNotifier.subject(connectionId).next(other);
package/dist/index.mjs CHANGED
@@ -843,11 +843,7 @@ var PluvRoom = class extends AbstractRoom {
843
843
  this._usersManager.patchPresence(connectionId, data.presence);
844
844
  const myPresence = this._usersManager.myPresence;
845
845
  const myself = (_a = this._usersManager.myself) != null ? _a : null;
846
- if ((myself == null ? void 0 : myself.connectionId) === connectionId) {
847
- this._stateNotifier.subjects["my-presence"].next(myPresence);
848
- this._stateNotifier.subjects["myself"].next(myself);
849
- return;
850
- }
846
+ if ((myself == null ? void 0 : myself.connectionId) === connectionId) return;
851
847
  const other = this._usersManager.getOther(connectionId);
852
848
  const others = this._usersManager.getOthers();
853
849
  this._otherNotifier.subject(connectionId).next(other);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pluv/client",
3
- "version": "0.38.9",
3
+ "version": "0.38.10",
4
4
  "description": "@pluv/io frontend client",
5
5
  "author": "leedavidcs",
6
6
  "license": "MIT",
@@ -18,15 +18,15 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "wonka": "^6.3.5",
21
- "@pluv/crdt": "^0.38.9",
22
- "@pluv/types": "^0.38.9"
21
+ "@pluv/crdt": "^0.38.10",
22
+ "@pluv/types": "^0.38.10"
23
23
  },
24
24
  "devDependencies": {
25
25
  "eslint": "^8.57.1",
26
26
  "tsup": "^8.4.0",
27
27
  "typescript": "^5.8.2",
28
- "@pluv/tsconfig": "^0.38.9",
29
- "eslint-config-pluv": "^0.38.9"
28
+ "@pluv/tsconfig": "^0.38.10",
29
+ "eslint-config-pluv": "^0.38.10"
30
30
  },
31
31
  "scripts": {
32
32
  "build": "tsup src/index.ts --format esm,cjs --dts",
package/src/PluvRoom.ts CHANGED
@@ -785,12 +785,14 @@ export class PluvRoom<
785
785
  const myPresence = this._usersManager.myPresence;
786
786
  const myself = this._usersManager.myself ?? null;
787
787
 
788
- if (myself?.connectionId === connectionId) {
789
- this._stateNotifier.subjects["my-presence"].next(myPresence);
790
- this._stateNotifier.subjects["myself"].next(myself);
791
-
792
- return;
793
- }
788
+ /**
789
+ * !HACK
790
+ * @description We're going to have the user's own presence be patched only via local calls
791
+ * to this.updateMyPresence. So we'll not update the user's presence in this handler to
792
+ * avoid weird update delays to the user's own presence.
793
+ * @date April 2, 2025
794
+ */
795
+ if (myself?.connectionId === connectionId) return;
794
796
 
795
797
  const other = this._usersManager.getOther(connectionId);
796
798
  const others = this._usersManager.getOthers();