Compare commits
23 Commits
cojson-sto
...
jazz-brows
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
07fe2b9dcf | ||
|
|
b297c93b80 | ||
|
|
d2e62e5b44 | ||
|
|
fe73ce7514 | ||
|
|
0fed16cea4 | ||
|
|
08804ad435 | ||
|
|
79fa7724ad | ||
|
|
4604c2184a | ||
|
|
11bac697fb | ||
|
|
96cec27f89 | ||
|
|
bcd412b8f9 | ||
|
|
6b456e2841 | ||
|
|
1df72b3dc8 | ||
|
|
402d692739 | ||
|
|
fad46b2fb5 | ||
|
|
0153c80cf2 | ||
|
|
4f75dc8d97 | ||
|
|
e2c79cccb5 | ||
|
|
c14a0e05be | ||
|
|
016dd3a5dd | ||
|
|
5c4ca9103c | ||
|
|
b4aad92907 | ||
|
|
56d1e095a1 |
5
.changeset/bright-files-help.md
Normal file
5
.changeset/bright-files-help.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"cojson": patch
|
||||
---
|
||||
|
||||
Improve logging
|
||||
5
.changeset/calm-experts-dance.md
Normal file
5
.changeset/calm-experts-dance.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"cojson-transport-ws": patch
|
||||
---
|
||||
|
||||
Wait if WS buffer is full
|
||||
25
.changeset/pre.json
Normal file
25
.changeset/pre.json
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"mode": "pre",
|
||||
"tag": "hotfixes",
|
||||
"initialVersions": {
|
||||
"jazz-example-chat": "0.0.79",
|
||||
"jazz-inspector": "0.0.57",
|
||||
"jazz-example-pets": "0.0.97",
|
||||
"jazz-example-todo": "0.0.96",
|
||||
"cojson": "0.7.31",
|
||||
"cojson-storage-indexeddb": "0.7.31",
|
||||
"cojson-storage-sqlite": "0.7.31",
|
||||
"cojson-transport-ws": "0.7.31",
|
||||
"hash-slash": "0.2.0",
|
||||
"jazz-browser": "0.7.32",
|
||||
"jazz-browser-media-images": "0.7.32",
|
||||
"jazz-nodejs": "0.7.32",
|
||||
"jazz-react": "0.7.32",
|
||||
"jazz-run": "0.7.32",
|
||||
"jazz-tools": "0.7.32"
|
||||
},
|
||||
"changesets": [
|
||||
"bright-files-help",
|
||||
"calm-experts-dance"
|
||||
]
|
||||
}
|
||||
2
.github/workflows/build-and-deploy.yaml
vendored
2
.github/workflows/build-and-deploy.yaml
vendored
@@ -3,8 +3,6 @@ name: Build and Deploy
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
|
||||
jobs:
|
||||
build-examples:
|
||||
|
||||
@@ -1,5 +1,76 @@
|
||||
# jazz-example-chat
|
||||
|
||||
## 0.0.80-hotfixes.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.7.33-hotfixes.1
|
||||
|
||||
## 0.0.80-hotfixes.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.33-hotfixes.0
|
||||
- jazz-react@0.7.33-hotfixes.0
|
||||
- jazz-tools@0.7.33-hotfixes.0
|
||||
|
||||
## 0.0.79
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- jazz-tools@0.7.32
|
||||
- jazz-react@0.7.32
|
||||
|
||||
## 0.0.78
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.31
|
||||
- jazz-react@0.7.31
|
||||
- jazz-tools@0.7.31
|
||||
|
||||
## 0.0.77
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.7.30
|
||||
|
||||
## 0.0.76
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.29
|
||||
- jazz-react@0.7.29
|
||||
- jazz-tools@0.7.29
|
||||
|
||||
## 0.0.75
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.28
|
||||
- jazz-react@0.7.28
|
||||
- jazz-tools@0.7.28
|
||||
|
||||
## 0.0.74
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.7.27
|
||||
|
||||
## 0.0.73
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.26
|
||||
- jazz-react@0.7.26
|
||||
- jazz-tools@0.7.26
|
||||
|
||||
## 0.0.72
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
# Jazz Chat Example
|
||||
|
||||
Live version: https://example-chat.jazz.tools
|
||||
Live version: [https://chat.jazz.tools](https://chat.jazz.tools)
|
||||
|
||||
## Installing & running the example locally
|
||||
|
||||
(this requires `pnpm` to be installed, see [https://pnpm.io/installation](https://pnpm.io/installation))
|
||||
|
||||
Start by checking out `jazz`
|
||||
|
||||
```bash
|
||||
git clone https://github.com/gardencmp/jazz.git
|
||||
cd jazz/examples/chat
|
||||
@@ -34,7 +35,6 @@ pnpm dev
|
||||
|
||||
If you have feedback, let us know on [Discord](https://discord.gg/utDMjHYg42) or open an issue or PR to fix something that seems wrong.
|
||||
|
||||
|
||||
## Configuration: sync server
|
||||
|
||||
By default, the example app uses [Jazz Global Mesh](https://jazz.tools/mesh) (`wss://sync.jazz.tools`) - so cross-device use, invites and collaboration should just work.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "jazz-example-chat",
|
||||
"private": true,
|
||||
"version": "0.0.72",
|
||||
"version": "0.0.80-hotfixes.1",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -1,5 +1,67 @@
|
||||
# jazz-example-chat
|
||||
|
||||
## 0.0.58-hotfixes.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson-transport-ws@0.7.33-hotfixes.1
|
||||
|
||||
## 0.0.58-hotfixes.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.33-hotfixes.0
|
||||
- cojson-transport-ws@0.7.33-hotfixes.0
|
||||
|
||||
## 0.0.57
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- Updated dependencies
|
||||
- cojson-transport-ws@0.7.31
|
||||
- cojson@0.7.31
|
||||
|
||||
## 0.0.56
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson-transport-ws@0.7.30
|
||||
|
||||
## 0.0.55
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.29
|
||||
- cojson-transport-ws@0.7.29
|
||||
|
||||
## 0.0.54
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.28
|
||||
- cojson-transport-ws@0.7.28
|
||||
|
||||
## 0.0.53
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson-transport-ws@0.7.27
|
||||
|
||||
## 0.0.52
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.26
|
||||
- cojson-transport-ws@0.7.26
|
||||
|
||||
## 0.0.51
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "jazz-inspector",
|
||||
"private": true,
|
||||
"version": "0.0.51",
|
||||
"version": "0.0.58-hotfixes.1",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -1,5 +1,76 @@
|
||||
# jazz-example-pets
|
||||
|
||||
## 0.0.98-hotfixes.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser-media-images@0.7.33-hotfixes.1
|
||||
- jazz-react@0.7.33-hotfixes.1
|
||||
|
||||
## 0.0.98-hotfixes.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.7.33-hotfixes.0
|
||||
- jazz-tools@0.7.33-hotfixes.0
|
||||
- jazz-browser-media-images@0.7.33-hotfixes.0
|
||||
|
||||
## 0.0.97
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- jazz-tools@0.7.32
|
||||
- jazz-browser-media-images@0.7.32
|
||||
- jazz-react@0.7.32
|
||||
|
||||
## 0.0.96
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.7.31
|
||||
- jazz-tools@0.7.31
|
||||
- jazz-browser-media-images@0.7.31
|
||||
|
||||
## 0.0.95
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser-media-images@0.7.30
|
||||
- jazz-react@0.7.30
|
||||
|
||||
## 0.0.94
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.7.29
|
||||
- jazz-tools@0.7.29
|
||||
- jazz-browser-media-images@0.7.29
|
||||
|
||||
## 0.0.93
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.7.28
|
||||
- jazz-tools@0.7.28
|
||||
- jazz-browser-media-images@0.7.28
|
||||
|
||||
## 0.0.92
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser-media-images@0.7.27
|
||||
- jazz-react@0.7.27
|
||||
|
||||
## 0.0.91
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- jazz-react@0.7.26
|
||||
- jazz-tools@0.7.26
|
||||
- jazz-browser-media-images@0.7.26
|
||||
|
||||
## 0.0.90
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "jazz-example-pets",
|
||||
"private": true,
|
||||
"version": "0.0.90",
|
||||
"version": "0.0.98-hotfixes.1",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -1,5 +1,67 @@
|
||||
# jazz-example-todo
|
||||
|
||||
## 0.0.97-hotfixes.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.7.33-hotfixes.1
|
||||
|
||||
## 0.0.97-hotfixes.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.7.33-hotfixes.0
|
||||
- jazz-tools@0.7.33-hotfixes.0
|
||||
|
||||
## 0.0.96
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- jazz-tools@0.7.32
|
||||
- jazz-react@0.7.32
|
||||
|
||||
## 0.0.95
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.7.31
|
||||
- jazz-tools@0.7.31
|
||||
|
||||
## 0.0.94
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.7.30
|
||||
|
||||
## 0.0.93
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.7.29
|
||||
- jazz-tools@0.7.29
|
||||
|
||||
## 0.0.92
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.7.28
|
||||
- jazz-tools@0.7.28
|
||||
|
||||
## 0.0.91
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.7.27
|
||||
|
||||
## 0.0.90
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- jazz-react@0.7.26
|
||||
- jazz-tools@0.7.26
|
||||
|
||||
## 0.0.89
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "jazz-example-todo",
|
||||
"private": true,
|
||||
"version": "0.0.89",
|
||||
"version": "0.0.97-hotfixes.1",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -1,5 +1,41 @@
|
||||
# cojson-storage-indexeddb
|
||||
|
||||
## 0.7.33-hotfixes.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.33-hotfixes.0
|
||||
|
||||
## 0.7.31
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.31
|
||||
|
||||
## 0.7.29
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.29
|
||||
|
||||
## 0.7.28
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.28
|
||||
|
||||
## 0.7.26
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Remove Effect from jazz/cojson internals
|
||||
- Updated dependencies
|
||||
- cojson@0.7.26
|
||||
|
||||
## 0.7.23
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cojson-storage-indexeddb",
|
||||
"version": "0.7.23",
|
||||
"version": "0.7.33-hotfixes.0",
|
||||
"main": "dist/index.js",
|
||||
"type": "module",
|
||||
"types": "src/index.ts",
|
||||
|
||||
@@ -1,5 +1,41 @@
|
||||
# cojson-storage-sqlite
|
||||
|
||||
## 0.7.33-hotfixes.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.33-hotfixes.0
|
||||
|
||||
## 0.7.31
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.31
|
||||
|
||||
## 0.7.29
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.29
|
||||
|
||||
## 0.7.28
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.28
|
||||
|
||||
## 0.7.26
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Remove Effect from jazz/cojson internals
|
||||
- Updated dependencies
|
||||
- cojson@0.7.26
|
||||
|
||||
## 0.7.23
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "cojson-storage-sqlite",
|
||||
"type": "module",
|
||||
"version": "0.7.23",
|
||||
"version": "0.7.33-hotfixes.0",
|
||||
"main": "dist/index.js",
|
||||
"types": "src/index.ts",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -1,5 +1,60 @@
|
||||
# cojson-transport-nodejs-ws
|
||||
|
||||
## 0.7.33-hotfixes.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Wait if WS buffer is full
|
||||
|
||||
## 0.7.33-hotfixes.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.33-hotfixes.0
|
||||
|
||||
## 0.7.31
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Properly close connecting websockets
|
||||
- Updated dependencies
|
||||
- cojson@0.7.31
|
||||
|
||||
## 0.7.30
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Immediately resolve an already-open websocket
|
||||
|
||||
## 0.7.29
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.29
|
||||
|
||||
## 0.7.28
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.28
|
||||
|
||||
## 0.7.27
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Option to not expect pings
|
||||
|
||||
## 0.7.26
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Remove Effect from jazz/cojson internals
|
||||
- Updated dependencies
|
||||
- cojson@0.7.26
|
||||
|
||||
## 0.7.23
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "cojson-transport-ws",
|
||||
"type": "module",
|
||||
"version": "0.7.23",
|
||||
"version": "0.7.33-hotfixes.1",
|
||||
"main": "dist/index.js",
|
||||
"types": "src/index.ts",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
import { DisconnectedError, Peer, PingTimeoutError, SyncMessage, cojsonInternals } from "cojson";
|
||||
import {
|
||||
DisconnectedError,
|
||||
Peer,
|
||||
PingTimeoutError,
|
||||
SyncMessage,
|
||||
cojsonInternals,
|
||||
} from "cojson";
|
||||
|
||||
interface WebsocketEvents {
|
||||
close: { code: number; reason: string };
|
||||
@@ -23,6 +29,7 @@ interface AnyWebSocket {
|
||||
close(): void;
|
||||
send(data: string): void;
|
||||
readyState: number;
|
||||
bufferedAmount: number;
|
||||
}
|
||||
|
||||
const g: typeof globalThis & {
|
||||
@@ -37,10 +44,12 @@ export function createWebSocketPeer({
|
||||
id,
|
||||
websocket,
|
||||
role,
|
||||
expectPings = true,
|
||||
}: {
|
||||
id: string;
|
||||
websocket: AnyWebSocket;
|
||||
role: Peer["role"];
|
||||
expectPings?: boolean;
|
||||
}): Peer {
|
||||
const incoming = new cojsonInternals.Channel<
|
||||
SyncMessage | DisconnectedError | PingTimeoutError
|
||||
@@ -74,17 +83,23 @@ export function createWebSocketPeer({
|
||||
console.error("Error while pushing incoming msg", e),
|
||||
);
|
||||
}
|
||||
pingTimeout = setTimeout(() => {
|
||||
incoming
|
||||
.push("PingTimeout")
|
||||
.catch((e) =>
|
||||
console.error("Error while pushing ping timeout", e),
|
||||
);
|
||||
}, 10_000);
|
||||
if (expectPings) {
|
||||
pingTimeout = setTimeout(() => {
|
||||
incoming
|
||||
.push("PingTimeout")
|
||||
.catch((e) =>
|
||||
console.error("Error while pushing ping timeout", e),
|
||||
);
|
||||
}, 10_000);
|
||||
}
|
||||
});
|
||||
|
||||
const websocketOpen = new Promise<void>((resolve) => {
|
||||
websocket.addEventListener("open", resolve, { once: true });
|
||||
if (websocket.readyState === 1) {
|
||||
resolve();
|
||||
} else {
|
||||
websocket.addEventListener("open", resolve, { once: true });
|
||||
}
|
||||
});
|
||||
|
||||
return {
|
||||
@@ -93,13 +108,26 @@ export function createWebSocketPeer({
|
||||
outgoing: {
|
||||
async push(msg) {
|
||||
await websocketOpen;
|
||||
websocket.send(JSON.stringify(msg));
|
||||
if (websocket.readyState === 1) {
|
||||
while (websocket.bufferedAmount > 1_000_000) {
|
||||
console.log("WS buffer filling", id, websocket.bufferedAmount);
|
||||
await new Promise((resolve) =>
|
||||
setTimeout(resolve, 100),
|
||||
);
|
||||
}
|
||||
websocket.send(JSON.stringify(msg));
|
||||
}
|
||||
},
|
||||
close() {
|
||||
if (websocket.readyState === 1) {
|
||||
console.log("Trying to close", id, websocket.readyState)
|
||||
if (websocket.readyState === 0) {
|
||||
websocket.addEventListener("open", function handleClose() {
|
||||
websocket.close();
|
||||
}, { once: true });
|
||||
} else if (websocket.readyState == 1) {
|
||||
websocket.close();
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
role,
|
||||
};
|
||||
|
||||
@@ -1,5 +1,35 @@
|
||||
# cojson
|
||||
|
||||
## 0.7.33-hotfixes.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Improve logging
|
||||
|
||||
## 0.7.31
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Close both ends of the peer on gracefulShutdown
|
||||
|
||||
## 0.7.29
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Remove noisy log
|
||||
|
||||
## 0.7.28
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Fix ignoring server peers
|
||||
|
||||
## 0.7.26
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Remove Effect from jazz/cojson internals
|
||||
|
||||
## 0.7.23
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"types": "src/index.ts",
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"version": "0.7.23",
|
||||
"version": "0.7.33-hotfixes.0",
|
||||
"devDependencies": {
|
||||
"@types/jest": "^29.5.3",
|
||||
"@typescript-eslint/eslint-plugin": "^6.2.1",
|
||||
|
||||
@@ -394,6 +394,9 @@ export class SyncManager {
|
||||
|
||||
processMessages().catch((e) => {
|
||||
console.error("Error processing messages from peer", peer.id, e);
|
||||
}).finally(() => {
|
||||
peer.outgoing.close();
|
||||
delete this.peers[peer.id];
|
||||
});
|
||||
}
|
||||
|
||||
@@ -411,7 +414,7 @@ export class SyncManager {
|
||||
// special case: we should be able to solve this much more neatly
|
||||
// with an explicit state machine in the future
|
||||
const eligiblePeers = this.peersInPriorityOrder().filter(
|
||||
(other) => other.id !== peer.id && peer.role === "server",
|
||||
(other) => other.id !== peer.id && other.role === "server",
|
||||
);
|
||||
if (eligiblePeers.length === 0) {
|
||||
if (msg.header || Object.keys(msg.sessions).length > 0) {
|
||||
@@ -443,14 +446,14 @@ export class SyncManager {
|
||||
}
|
||||
|
||||
if (entry.state === "loading") {
|
||||
console.log(
|
||||
console.debug(
|
||||
"Waiting for loaded",
|
||||
msg.id,
|
||||
"after message from",
|
||||
peer.id,
|
||||
);
|
||||
const loaded = await entry.done;
|
||||
console.log("Loaded", msg.id, loaded);
|
||||
// console.log("Loaded", msg.id, loaded);
|
||||
if (loaded === "unavailable") {
|
||||
peer.optimisticKnownStates[msg.id] = knownStateIn(msg);
|
||||
peer.toldKnownState.add(msg.id);
|
||||
@@ -648,11 +651,9 @@ export class SyncManager {
|
||||
console.error(
|
||||
"Failed to add transactions",
|
||||
msg.id,
|
||||
JSON.stringify(newTransactions, (k, v) =>
|
||||
k === "changes" || k === "encryptedChanges"
|
||||
? v.slice(0, 20) + "..."
|
||||
: v,
|
||||
),
|
||||
newTransactions.length + ' new transactions',
|
||||
'we have' + ourTotalnTxs,
|
||||
'they have' + theirTotalnTxs,
|
||||
);
|
||||
continue;
|
||||
}
|
||||
@@ -747,7 +748,11 @@ export class SyncManager {
|
||||
|
||||
gracefulShutdown() {
|
||||
for (const peer of Object.values(this.peers)) {
|
||||
console.debug("Gracefully closing", peer.id);
|
||||
peer.outgoing.close();
|
||||
peer.incoming = (async function* () {
|
||||
yield "Disconnected" as const;
|
||||
})();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,67 @@
|
||||
# jazz-browser-media-images
|
||||
|
||||
## 0.7.33-hotfixes.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser@0.7.33-hotfixes.1
|
||||
|
||||
## 0.7.33-hotfixes.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser@0.7.33-hotfixes.0
|
||||
- jazz-tools@0.7.33-hotfixes.0
|
||||
|
||||
## 0.7.32
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- jazz-tools@0.7.32
|
||||
- jazz-browser@0.7.32
|
||||
|
||||
## 0.7.31
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser@0.7.31
|
||||
- jazz-tools@0.7.31
|
||||
|
||||
## 0.7.30
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser@0.7.30
|
||||
|
||||
## 0.7.29
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser@0.7.29
|
||||
- jazz-tools@0.7.29
|
||||
|
||||
## 0.7.28
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser@0.7.28
|
||||
- jazz-tools@0.7.28
|
||||
|
||||
## 0.7.27
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser@0.7.27
|
||||
|
||||
## 0.7.26
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- jazz-browser@0.7.26
|
||||
- jazz-tools@0.7.26
|
||||
|
||||
## 0.7.25
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "jazz-browser-media-images",
|
||||
"version": "0.7.25",
|
||||
"version": "0.7.33-hotfixes.1",
|
||||
"type": "module",
|
||||
"main": "dist/index.js",
|
||||
"types": "src/index.ts",
|
||||
|
||||
@@ -1,5 +1,85 @@
|
||||
# jazz-browser
|
||||
|
||||
## 0.7.33-hotfixes.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson-transport-ws@0.7.33-hotfixes.1
|
||||
|
||||
## 0.7.33-hotfixes.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.33-hotfixes.0
|
||||
- cojson-storage-indexeddb@0.7.33-hotfixes.0
|
||||
- cojson-transport-ws@0.7.33-hotfixes.0
|
||||
- jazz-tools@0.7.33-hotfixes.0
|
||||
|
||||
## 0.7.32
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- jazz-tools@0.7.32
|
||||
|
||||
## 0.7.31
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- Updated dependencies
|
||||
- cojson-transport-ws@0.7.31
|
||||
- cojson@0.7.31
|
||||
- cojson-storage-indexeddb@0.7.31
|
||||
- jazz-tools@0.7.31
|
||||
|
||||
## 0.7.30
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson-transport-ws@0.7.30
|
||||
|
||||
## 0.7.29
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.29
|
||||
- cojson-storage-indexeddb@0.7.29
|
||||
- cojson-transport-ws@0.7.29
|
||||
- jazz-tools@0.7.29
|
||||
|
||||
## 0.7.28
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.28
|
||||
- cojson-storage-indexeddb@0.7.28
|
||||
- cojson-transport-ws@0.7.28
|
||||
- jazz-tools@0.7.28
|
||||
|
||||
## 0.7.27
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson-transport-ws@0.7.27
|
||||
|
||||
## 0.7.26
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Remove Effect from jazz/cojson internals
|
||||
- Updated dependencies
|
||||
- cojson@0.7.26
|
||||
- cojson-storage-indexeddb@0.7.26
|
||||
- cojson-transport-ws@0.7.26
|
||||
- jazz-tools@0.7.26
|
||||
|
||||
## 0.7.25
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "jazz-browser",
|
||||
"version": "0.7.25",
|
||||
"version": "0.7.33-hotfixes.1",
|
||||
"type": "module",
|
||||
"main": "dist/index.js",
|
||||
"types": "src/index.ts",
|
||||
|
||||
@@ -1,5 +1,80 @@
|
||||
# jazz-autosub
|
||||
|
||||
## 0.7.33-hotfixes.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson-transport-ws@0.7.33-hotfixes.1
|
||||
|
||||
## 0.7.33-hotfixes.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.33-hotfixes.0
|
||||
- cojson-transport-ws@0.7.33-hotfixes.0
|
||||
- jazz-tools@0.7.33-hotfixes.0
|
||||
|
||||
## 0.7.32
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- jazz-tools@0.7.32
|
||||
|
||||
## 0.7.31
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- Updated dependencies
|
||||
- cojson-transport-ws@0.7.31
|
||||
- cojson@0.7.31
|
||||
- jazz-tools@0.7.31
|
||||
|
||||
## 0.7.30
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson-transport-ws@0.7.30
|
||||
|
||||
## 0.7.29
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.29
|
||||
- cojson-transport-ws@0.7.29
|
||||
- jazz-tools@0.7.29
|
||||
|
||||
## 0.7.28
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.28
|
||||
- cojson-transport-ws@0.7.28
|
||||
- jazz-tools@0.7.28
|
||||
|
||||
## 0.7.27
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson-transport-ws@0.7.27
|
||||
|
||||
## 0.7.26
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Remove Effect from jazz/cojson internals
|
||||
- Updated dependencies
|
||||
- cojson@0.7.26
|
||||
- cojson-transport-ws@0.7.26
|
||||
- jazz-tools@0.7.26
|
||||
|
||||
## 0.7.25
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"types": "src/index.ts",
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"version": "0.7.25",
|
||||
"version": "0.7.33-hotfixes.1",
|
||||
"dependencies": {
|
||||
"cojson": "workspace:*",
|
||||
"cojson-transport-ws": "workspace:*",
|
||||
|
||||
@@ -1,5 +1,77 @@
|
||||
# jazz-react
|
||||
|
||||
## 0.7.33-hotfixes.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser@0.7.33-hotfixes.1
|
||||
|
||||
## 0.7.33-hotfixes.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.33-hotfixes.0
|
||||
- jazz-browser@0.7.33-hotfixes.0
|
||||
- jazz-tools@0.7.33-hotfixes.0
|
||||
|
||||
## 0.7.32
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- jazz-tools@0.7.32
|
||||
- jazz-browser@0.7.32
|
||||
|
||||
## 0.7.31
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.31
|
||||
- jazz-browser@0.7.31
|
||||
- jazz-tools@0.7.31
|
||||
|
||||
## 0.7.30
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser@0.7.30
|
||||
|
||||
## 0.7.29
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.29
|
||||
- jazz-browser@0.7.29
|
||||
- jazz-tools@0.7.29
|
||||
|
||||
## 0.7.28
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.28
|
||||
- jazz-browser@0.7.28
|
||||
- jazz-tools@0.7.28
|
||||
|
||||
## 0.7.27
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser@0.7.27
|
||||
|
||||
## 0.7.26
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Remove Effect from jazz/cojson internals
|
||||
- Updated dependencies
|
||||
- cojson@0.7.26
|
||||
- jazz-browser@0.7.26
|
||||
- jazz-tools@0.7.26
|
||||
|
||||
## 0.7.25
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "jazz-react",
|
||||
"version": "0.7.25",
|
||||
"version": "0.7.33-hotfixes.1",
|
||||
"type": "module",
|
||||
"main": "dist/index.js",
|
||||
"types": "src/index.ts",
|
||||
|
||||
@@ -1,5 +1,79 @@
|
||||
# jazz-autosub
|
||||
|
||||
## 0.7.33-hotfixes.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson-transport-ws@0.7.33-hotfixes.1
|
||||
|
||||
## 0.7.33-hotfixes.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.33-hotfixes.0
|
||||
- cojson-transport-ws@0.7.33-hotfixes.0
|
||||
- jazz-tools@0.7.33-hotfixes.0
|
||||
|
||||
## 0.7.32
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- jazz-tools@0.7.32
|
||||
|
||||
## 0.7.31
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- Updated dependencies
|
||||
- cojson-transport-ws@0.7.31
|
||||
- cojson@0.7.31
|
||||
- jazz-tools@0.7.31
|
||||
|
||||
## 0.7.30
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson-transport-ws@0.7.30
|
||||
|
||||
## 0.7.29
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.29
|
||||
- cojson-transport-ws@0.7.29
|
||||
- jazz-tools@0.7.29
|
||||
|
||||
## 0.7.28
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.28
|
||||
- cojson-transport-ws@0.7.28
|
||||
- jazz-tools@0.7.28
|
||||
|
||||
## 0.7.27
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson-transport-ws@0.7.27
|
||||
|
||||
## 0.7.26
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.26
|
||||
- cojson-transport-ws@0.7.26
|
||||
- jazz-tools@0.7.26
|
||||
|
||||
## 0.7.25
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"bin": "./dist/index.js",
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"version": "0.7.25",
|
||||
"version": "0.7.33-hotfixes.1",
|
||||
"scripts": {
|
||||
"lint": "eslint . --ext ts,tsx",
|
||||
"format": "prettier --write './src/**/*.{ts,tsx}'",
|
||||
|
||||
@@ -1,5 +1,47 @@
|
||||
# jazz-autosub
|
||||
|
||||
## 0.7.33-hotfixes.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.33-hotfixes.0
|
||||
|
||||
## 0.7.32
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Adapt type of applyDiff to make CoMaps fully subclassable again
|
||||
|
||||
## 0.7.31
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.31
|
||||
|
||||
## 0.7.29
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.29
|
||||
|
||||
## 0.7.28
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.28
|
||||
|
||||
## 0.7.26
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Remove Effect from jazz/cojson internals
|
||||
- Updated dependencies
|
||||
- cojson@0.7.26
|
||||
|
||||
## 0.7.25
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"types": "./src/index.ts",
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"version": "0.7.25",
|
||||
"version": "0.7.33-hotfixes.0",
|
||||
"dependencies": {
|
||||
"cojson": "workspace:*",
|
||||
"fast-check": "^3.17.2"
|
||||
|
||||
@@ -457,7 +457,7 @@ export class CoMap extends CoValueBase implements CoValue {
|
||||
return subscribeToExistingCoValue(this, depth, listener);
|
||||
}
|
||||
|
||||
applyDiff(newValues: Partial<CoMapInit<this>>) {
|
||||
applyDiff<N extends Partial<CoMapInit<this>>>(newValues: N) {
|
||||
for (const key in newValues) {
|
||||
if (Object.prototype.hasOwnProperty.call(newValues, key)) {
|
||||
const tKey = key as keyof typeof newValues & keyof this;
|
||||
@@ -466,7 +466,7 @@ export class CoMap extends CoValueBase implements CoValue {
|
||||
|
||||
if (tKey in this._schema) {
|
||||
const newValue = newValues[tKey];
|
||||
const currentValue = this[tKey];
|
||||
const currentValue = (this as unknown as N)[tKey];
|
||||
|
||||
if (descriptor === "json" || "encoded" in descriptor) {
|
||||
if (currentValue !== newValue) {
|
||||
|
||||
Reference in New Issue
Block a user