Compare commits

...

6 Commits

Author SHA1 Message Date
Guido D'Orsi
eab128d8e8 Merge pull request #1617 from garden-co/changeset-release/main
Version Packages
2025-03-10 13:04:18 +01:00
github-actions[bot]
8793c218e7 Version Packages 2025-03-10 11:50:03 +00:00
Guido D'Orsi
57858a7cf0 Merge pull request #1624 from garden-co/better-error-logging
feat: improve error logging
2025-03-10 12:46:31 +01:00
Guido D'Orsi
68b0242793 feat: improve error logging 2025-03-10 12:40:55 +01:00
Anselm Eickhoff
9d9a067df5 Merge pull request #1621 from garden-co/fix/react-guide-optional-field
fix(react guide): update syntax for optional field
2025-03-10 10:30:11 +00:00
Trisha Lim
99779b522b fix(react guide): update syntax for optional field 2025-03-10 17:24:30 +07:00
103 changed files with 572 additions and 202 deletions

View File

@@ -1,5 +1,14 @@
# chat-rn-clerk
## 1.0.84
### Patch Changes
- jazz-react-native@0.11.3
- jazz-react-native-auth-clerk@0.11.3
- jazz-tools@0.11.3
- jazz-react-native-media-images@0.11.3
## 1.0.83
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "chat-rn-clerk",
"main": "index.js",
"version": "1.0.83",
"version": "1.0.84",
"scripts": {
"build": "expo export -p ios",
"start": "expo start",

View File

@@ -1,5 +1,12 @@
# chat-rn
## 1.0.80
### Patch Changes
- jazz-react-native@0.11.3
- jazz-tools@0.11.3
## 1.0.79
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "chat-rn",
"version": "1.0.79",
"version": "1.0.80",
"main": "index.js",
"scripts": {
"build": "expo export -p ios",

View File

@@ -1,5 +1,13 @@
# chat-vue
## 0.0.65
### Patch Changes
- jazz-browser@0.11.3
- jazz-tools@0.11.3
- jazz-vue@0.11.3
## 0.0.64
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "chat-vue",
"version": "0.0.64",
"version": "0.0.65",
"private": true,
"type": "module",
"scripts": {

View File

@@ -1,5 +1,13 @@
# jazz-example-chat
## 0.0.162
### Patch Changes
- jazz-react@0.11.3
- jazz-tools@0.11.3
- jazz-browser-media-images@0.11.3
## 0.0.161
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-example-chat",
"private": true,
"version": "0.0.161",
"version": "0.0.162",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,13 @@
# minimal-auth-clerk
## 0.0.61
### Patch Changes
- jazz-react@0.11.3
- jazz-react-auth-clerk@0.11.3
- jazz-tools@0.11.3
## 0.0.60
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "clerk",
"private": true,
"version": "0.0.60",
"version": "0.0.61",
"type": "module",
"scripts": {
"dev": "vite",
@@ -13,7 +13,7 @@
"dependencies": {
"@clerk/clerk-react": "^5.4.1",
"jazz-react": "workspace:*",
"jazz-react-auth-clerk": "workspace:0.11.2",
"jazz-react-auth-clerk": "workspace:0.11.3",
"jazz-tools": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1"

View File

@@ -1,5 +1,12 @@
# file-share-svelte
## 0.0.45
### Patch Changes
- jazz-svelte@0.11.3
- jazz-tools@0.11.3
## 0.0.44
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "file-share-svelte",
"version": "0.0.44",
"version": "0.0.45",
"private": true,
"type": "module",
"scripts": {

View File

@@ -1,5 +1,13 @@
# form
## 0.1.3
### Patch Changes
- jazz-react@0.11.3
- jazz-tools@0.11.3
- jazz-browser-media-images@0.11.3
## 0.1.2
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "form",
"private": true,
"version": "0.1.2",
"version": "0.1.3",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,13 @@
# image-upload
## 0.0.59
### Patch Changes
- jazz-react@0.11.3
- jazz-tools@0.11.3
- jazz-browser-media-images@0.11.3
## 0.0.58
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "image-upload",
"private": true,
"version": "0.0.58",
"version": "0.0.59",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,13 @@
# jazz-example-inspector
## 0.0.112
### Patch Changes
- Updated dependencies [68b0242]
- cojson-transport-ws@0.11.3
- cojson@0.11.3
## 0.0.111
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-inspector-app",
"private": true,
"version": "0.0.111",
"version": "0.0.112",
"type": "module",
"scripts": {
"dev": "vite",
@@ -16,8 +16,8 @@
"@radix-ui/react-toast": "^1.1.4",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"cojson": "workspace:0.11.0",
"cojson-transport-ws": "workspace:0.11.0",
"cojson": "workspace:0.11.3",
"cojson-transport-ws": "workspace:0.11.3",
"hash-slash": "workspace:0.2.2",
"lucide-react": "^0.274.0",
"qrcode": "^1.5.3",

View File

@@ -1,5 +1,13 @@
# multiauth
## 0.0.2
### Patch Changes
- jazz-react@0.11.3
- jazz-react-auth-clerk@0.11.3
- jazz-tools@0.11.3
## 0.0.1
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "multiauth",
"private": true,
"version": "0.0.1",
"version": "0.0.2",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,13 @@
# jazz-example-musicplayer
## 0.0.83
### Patch Changes
- jazz-inspector@0.11.3
- jazz-react@0.11.3
- jazz-tools@0.11.3
## 0.0.82
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-example-music-player",
"private": true,
"version": "0.0.82",
"version": "0.0.83",
"type": "module",
"scripts": {
"dev": "vite",
@@ -22,8 +22,8 @@
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"jazz-inspector": "workspace:*",
"jazz-react": "workspace:0.11.2",
"jazz-tools": "workspace:0.11.2",
"jazz-react": "workspace:0.11.3",
"jazz-tools": "workspace:0.11.3",
"lucide-react": "^0.274.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",

View File

@@ -1,5 +1,12 @@
# organization
## 0.0.55
### Patch Changes
- jazz-react@0.11.3
- jazz-tools@0.11.3
## 0.0.54
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "organization",
"private": true,
"version": "0.0.54",
"version": "0.0.55",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,11 @@
# passkey-svelte
## 0.0.49
### Patch Changes
- jazz-svelte@0.11.3
## 0.0.48
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "passkey-svelte",
"version": "0.0.48",
"version": "0.0.49",
"type": "module",
"private": true,
"scripts": {

View File

@@ -1,5 +1,12 @@
# minimal-auth-passkey
## 0.0.60
### Patch Changes
- jazz-react@0.11.3
- jazz-tools@0.11.3
## 0.0.59
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "passkey",
"private": true,
"version": "0.0.59",
"version": "0.0.60",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,12 @@
# passphrase
## 0.0.57
### Patch Changes
- jazz-react@0.11.3
- jazz-tools@0.11.3
## 0.0.56
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "passphrase",
"private": true,
"version": "0.0.56",
"version": "0.0.57",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,12 @@
# jazz-password-manager
## 0.0.81
### Patch Changes
- jazz-react@0.11.3
- jazz-tools@0.11.3
## 0.0.80
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-password-manager",
"private": true,
"version": "0.0.80",
"version": "0.0.81",
"type": "module",
"scripts": {
"dev": "vite",
@@ -12,8 +12,8 @@
"clean-install": "rm -rf node_modules pnpm-lock.yaml && pnpm install"
},
"dependencies": {
"jazz-react": "workspace:0.11.2",
"jazz-tools": "workspace:0.11.2",
"jazz-react": "workspace:0.11.3",
"jazz-tools": "workspace:0.11.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-hook-form": "^7.41.5",

View File

@@ -1,5 +1,13 @@
# jazz-example-pets
## 0.0.179
### Patch Changes
- jazz-react@0.11.3
- jazz-tools@0.11.3
- jazz-browser-media-images@0.11.3
## 0.0.178
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-example-pets",
"private": true,
"version": "0.0.178",
"version": "0.0.179",
"type": "module",
"scripts": {
"dev": "vite",
@@ -19,9 +19,9 @@
"@radix-ui/react-toast": "^1.1.4",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"jazz-browser-media-images": "workspace:0.11.2",
"jazz-react": "workspace:0.11.2",
"jazz-tools": "workspace:0.11.2",
"jazz-browser-media-images": "workspace:0.11.3",
"jazz-react": "workspace:0.11.3",
"jazz-tools": "workspace:0.11.3",
"lucide-react": "^0.274.0",
"qrcode": "^1.5.3",
"react": "^18.3.1",
@@ -41,7 +41,7 @@
"@vitejs/plugin-react-swc": "^3.3.2",
"autoprefixer": "^10.4.20",
"is-ci": "^3.0.1",
"jazz-run": "workspace:0.11.2",
"jazz-run": "workspace:0.11.3",
"postcss": "^8.4.27",
"tailwindcss": "^3.4.17",
"typescript": "~5.6.2",

View File

@@ -1,5 +1,13 @@
# reactions
## 0.0.59
### Patch Changes
- jazz-react@0.11.3
- jazz-tools@0.11.3
- jazz-browser-media-images@0.11.3
## 0.0.58
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "reactions",
"private": true,
"version": "0.0.58",
"version": "0.0.59",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,13 @@
# todo-vue
## 0.0.63
### Patch Changes
- jazz-browser@0.11.3
- jazz-tools@0.11.3
- jazz-vue@0.11.3
## 0.0.62
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "todo-vue",
"version": "0.0.62",
"version": "0.0.63",
"private": true,
"type": "module",
"scripts": {

View File

@@ -1,5 +1,12 @@
# jazz-example-todo
## 0.0.178
### Patch Changes
- jazz-react@0.11.3
- jazz-tools@0.11.3
## 0.0.177
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-example-todo",
"private": true,
"version": "0.0.177",
"version": "0.0.178",
"type": "module",
"scripts": {
"dev": "vite",
@@ -16,8 +16,8 @@
"@radix-ui/react-toast": "^1.1.4",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"jazz-react": "workspace:0.11.2",
"jazz-tools": "workspace:0.11.2",
"jazz-react": "workspace:0.11.3",
"jazz-tools": "workspace:0.11.3",
"lucide-react": "^0.274.0",
"qrcode": "^1.5.3",
"react": "^18.3.1",

View File

@@ -1,5 +1,12 @@
# version-history
## 0.0.56
### Patch Changes
- jazz-react@0.11.3
- jazz-tools@0.11.3
## 0.0.55
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "version-history",
"private": true,
"version": "0.0.55",
"version": "0.0.56",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -98,7 +98,7 @@ export class Issue extends CoMap {
title = co.string;
description = co.string;
estimate = co.number;
status? = co.literal("backlog", "in progress", "done");
status = co.optional.literal("backlog", "in progress", "done");
}
```
</CodeGroup>
@@ -514,7 +514,7 @@ export class Issue extends CoMap { // old
title = co.string; // old
description = co.string; // old
estimate = co.number; // old
status? = co.literal("backlog", "in progress", "done"); // old
status? = co.optional.literal("backlog", "in progress", "done"); // old
} // old
// old
export class ListOfIssues extends CoList.Of(co.ref(Issue)) {}

View File

@@ -1,10 +1,10 @@
import CreateJazzApp from "@/components/home/CreateJazzApp.mdx";
import { H1 } from "gcmp-design-system/src/app/components/atoms/Headings";
import { Icon } from "gcmp-design-system/src/app/components/atoms/Icon";
import { Prose } from "gcmp-design-system/src/app/components/molecules/Prose";
import Link from "next/link";
import { CopyButton } from "gcmp-design-system/src/app/components/molecules/CodeGroup";
import CreateJazzApp from "@/components/home/CreateJazzApp.mdx";
import { Prose } from "gcmp-design-system/src/app/components/molecules/Prose";
import { SectionHeader } from "gcmp-design-system/src/app/components/molecules/SectionHeader";
import Link from "next/link";
const features = [
{
@@ -84,17 +84,24 @@ export function HeroSection() {
</div>
<div className="h-full pt-12 group grid md:grid-cols-2 items-center lg:grid-cols-1">
<SectionHeader className="md:col-span-2 lg:sr-only" title="Get a Jazz app running in minutes."/>
<SectionHeader
className="md:col-span-2 lg:sr-only"
title="Get a Jazz app running in minutes."
/>
<div className=" overflow-hidden sm:rounded-xl sm:border h-full sm:px-8 sm:pt-6 bg-stone-50 dark:bg-stone-950">
<div className="rounded-lg bg-white dark:bg-stone-925 sm:ring-4 ring-stone-400/20 sm:shadow-xl shadow-blue/20 border relative sm:top-2 h-full w-full">
<div className="py-4 flex items-center gap-2.5 px-6 border-b">
<span className="rounded-full size-3 bg-stone-200 dark:bg-stone-900"/>
<span className="rounded-full size-3 bg-stone-200 dark:bg-stone-900"/>
<span className="rounded-full size-3 bg-stone-200 dark:bg-stone-900"/>
<CopyButton code="npx create-jazz-app@latest" size="md" className="mt-0.5 mr-0.5" />
<span className="rounded-full size-3 bg-stone-200 dark:bg-stone-900" />
<span className="rounded-full size-3 bg-stone-200 dark:bg-stone-900" />
<span className="rounded-full size-3 bg-stone-200 dark:bg-stone-900" />
<CopyButton
code="npx create-jazz-app@latest"
size="md"
className="mt-0.5 mr-0.5"
/>
</div>
<div className="p-3">
<CreateJazzApp/>
<CreateJazzApp />
</div>
</div>
</div>

View File

@@ -1,5 +1,13 @@
# cojson-storage-indexeddb
## 0.11.3
### Patch Changes
- Updated dependencies [68b0242]
- cojson-storage@0.11.3
- cojson@0.11.3
## 0.11.0
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "cojson-storage-indexeddb",
"version": "0.11.0",
"version": "0.11.3",
"main": "dist/index.js",
"type": "module",
"types": "dist/index.d.ts",

View File

@@ -1,5 +1,13 @@
# cojson-storage-sqlite
## 0.11.3
### Patch Changes
- Updated dependencies [68b0242]
- cojson-storage@0.11.3
- cojson@0.11.3
## 0.11.1
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "cojson-storage-rn-sqlite",
"type": "module",
"version": "0.11.1",
"version": "0.11.3",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"license": "MIT",

View File

@@ -1,5 +1,14 @@
# cojson-storage-sqlite
## 0.11.3
### Patch Changes
- 68b0242: Improve the error logging to have more information on errors leveraging the pino err serializer
- Updated dependencies [68b0242]
- cojson-storage@0.11.3
- cojson@0.11.3
## 0.11.0
### Patch Changes

View File

@@ -1,13 +1,13 @@
{
"name": "cojson-storage-sqlite",
"type": "module",
"version": "0.11.0",
"version": "0.11.3",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"license": "MIT",
"dependencies": {
"better-sqlite3": "^11.7.0",
"cojson": "workspace:0.11.0",
"cojson": "workspace:0.11.3",
"cojson-storage": "workspace:*"
},
"devDependencies": {

View File

@@ -61,6 +61,7 @@ export class SQLiteClient implements DBClientInterface {
const headerValue = coValueRow?.header ?? "";
logger.warn(`Invalid JSON in header: ${headerValue}`, {
id: coValueId,
err: e,
});
return;
}
@@ -99,7 +100,7 @@ export class SQLiteClient implements DBClientInterface {
tx: JSON.parse(transactionRow.tx) as Transaction,
}));
} catch (e) {
logger.warn("Invalid JSON in transaction");
logger.warn("Invalid JSON in transaction", { err: e });
return [];
}
}

View File

@@ -41,21 +41,16 @@ export class SQLiteNode {
await new Promise((resolve) => setTimeout(resolve, 0));
}
} catch (e) {
logger.error(
`Error reading from localNode, handling msg\n\n${JSON.stringify(
msg,
(k, v) =>
k === "changes" || k === "encryptedChanges"
? `${v.slice(0, 20)}...`
: v,
)}`,
);
logger.error("Error reading from localNode, handling msg", {
msg,
err: e,
});
}
}
};
processMessages().catch((e) =>
logger.error("Error in processMessages in sqlite", e),
logger.error("Error in processMessages in sqlite", { err: e }),
);
}

View File

@@ -1,5 +1,13 @@
# cojson-storage
## 0.11.3
### Patch Changes
- 68b0242: Improve the error logging to have more information on errors leveraging the pino err serializer
- Updated dependencies [68b0242]
- cojson@0.11.3
## 0.11.0
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "cojson-storage",
"version": "0.11.0",
"version": "0.11.3",
"main": "dist/index.js",
"type": "module",
"types": "dist/index.d.ts",

View File

@@ -320,10 +320,10 @@ export class SyncManager {
| CojsonInternalTypes.KnownStateMessage
| CojsonInternalTypes.NewContentMessage,
): Promise<unknown> {
return this.toLocalNode
.push(msg)
.catch((e) =>
logger.error(`Error sending ${msg.action} state, id ${msg.id}`, e),
);
return this.toLocalNode.push(msg).catch((e) =>
logger.error(`Error sending ${msg.action} state, id ${msg.id}`, {
err: e,
}),
);
}
}

View File

@@ -1,5 +1,13 @@
# cojson-transport-nodejs-ws
## 0.11.3
### Patch Changes
- 68b0242: Improve the error logging to have more information on errors leveraging the pino err serializer
- Updated dependencies [68b0242]
- cojson@0.11.3
## 0.11.0
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "cojson-transport-ws",
"type": "module",
"version": "0.11.0",
"version": "0.11.3",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"license": "MIT",

View File

@@ -139,7 +139,9 @@ export function createWebSocketPeer({
function handleClose() {
incoming
.push("Disconnected")
.catch((e) => logger.error("Error while pushing disconnect msg", e));
.catch((e) =>
logger.error("Error while pushing disconnect msg", { err: e }),
);
emitClosedEvent();
}
@@ -148,7 +150,7 @@ export function createWebSocketPeer({
// biome-ignore lint/suspicious/noExplicitAny: WebSocket error event type
websocket.addEventListener("error" as any, (err) => {
if (err.message) {
logger.warn(err.message);
logger.warn("WebSocket error", { err });
}
handleClose();
@@ -157,7 +159,9 @@ export function createWebSocketPeer({
const pingTimeout = createPingTimeoutListener(expectPings, () => {
incoming
.push("PingTimeout")
.catch((e) => logger.error("Error while pushing ping timeout", e));
.catch((e) =>
logger.error("Error while pushing ping timeout", { err: e }),
);
emitClosedEvent();
});
@@ -175,9 +179,7 @@ export function createWebSocketPeer({
const result = deserializeMessages(event.data);
if (!result.ok) {
logger.warn(
`Error while deserializing messages: ${getErrorMessage(result.error)}`,
);
logger.warn("Error while deserializing messages", { err: result.error });
return;
}
@@ -201,7 +203,9 @@ export function createWebSocketPeer({
if (msg && "action" in msg) {
incoming
.push(msg)
.catch((e) => logger.error("Error while pushing incoming msg", e));
.catch((e) =>
logger.error("Error while pushing incoming msg", { err: e }),
);
}
}
}

View File

@@ -28,7 +28,7 @@ export function deserializeMessages(messages: unknown) {
| PingMsg[],
} as const;
} catch (e) {
logger.error(`Error while deserializing messages: ${getErrorMessage(e)}`);
logger.error("Error while deserializing messages", { err: e });
return {
ok: false,
error: e,

View File

@@ -1,5 +1,11 @@
# cojson
## 0.11.3
### Patch Changes
- 68b0242: Improve the error logging to have more information on errors leveraging the pino err serializer
## 0.11.0
### Minor Changes

View File

@@ -25,7 +25,7 @@
},
"type": "module",
"license": "MIT",
"version": "0.11.0",
"version": "0.11.3",
"devDependencies": {
"@opentelemetry/sdk-metrics": "^1.29.0",
"typescript": "~5.6.2",

View File

@@ -328,10 +328,7 @@ export class CoValueCore {
try {
listener(content);
} catch (e) {
logger.error(
"Error in listener for coValue " + this.id,
parseError(e),
);
logger.error("Error in listener for coValue " + this.id, { err: e });
}
}
} else {
@@ -345,10 +342,9 @@ export class CoValueCore {
try {
listener(content);
} catch (e) {
logger.error(
"Error in listener for coValue " + this.id,
parseError(e),
);
logger.error("Error in listener for coValue " + this.id, {
err: e,
});
}
}
resolve();
@@ -545,7 +541,9 @@ export class CoValueCore {
}
if (!decryptedChanges) {
logger.error("Failed to decrypt transaction despite having key");
logger.error("Failed to decrypt transaction despite having key", {
err: new Error("Failed to decrypt transaction despite having key"),
});
continue;
}

View File

@@ -285,7 +285,9 @@ async function loadCoValueFromPeers(
...coValueEntry.state.coValue.knownState(),
})
.catch((err) => {
logger.warn(`Failed to push load message to peer ${peer.id}`, err);
logger.warn(`Failed to push load message to peer ${peer.id}`, {
err,
});
});
} else {
/**
@@ -299,7 +301,9 @@ async function loadCoValueFromPeers(
sessions: {},
})
.catch((err) => {
logger.warn(`Failed to push load message to peer ${peer.id}`, err);
logger.warn(`Failed to push load message to peer ${peer.id}`, {
err,
});
});
}

View File

@@ -195,9 +195,7 @@ export class PureJSCrypto extends CryptoProvider<Blake3State> {
try {
return JSON.parse(textDecoder.decode(plaintext));
} catch (e) {
logger.error(
"Failed to decrypt/parse sealed message: " + (e as Error)?.message,
);
logger.error("Failed to decrypt/parse sealed message", { err: e });
return undefined;
}
}

View File

@@ -179,9 +179,7 @@ export class WasmCrypto extends CryptoProvider<Blake3State> {
try {
return JSON.parse(plaintext) as T;
} catch (e) {
logger.error(
"Failed to decrypt/parse sealed message: " + (e as Error)?.message,
);
logger.error("Failed to decrypt/parse sealed message", { err: e });
return undefined;
}
}

View File

@@ -163,7 +163,7 @@ export abstract class CryptoProvider<Blake3State = any> {
try {
return parseJSON(this.decryptRaw(encrypted, keySecret, nOnceMaterial));
} catch (e) {
logger.error("Decryption error: " + (e as Error)?.message);
logger.error("Decryption error", { err: e });
return undefined;
}
}

View File

@@ -231,7 +231,7 @@ export class LocalNode {
return node;
} catch (e) {
logger.error("Error withLoadedAccount: " + (e as Error)?.message);
logger.error("Error withLoadedAccount", { err: e });
throw e;
}
}
@@ -270,8 +270,9 @@ export class LocalNode {
this.syncManager.getServerAndStoragePeers(skipLoadingFromPeer);
await entry.loadFromPeers(peers).catch((e) => {
logger.error("Error loading from peers: " + (e as Error)?.message, {
logger.error("Error loading from peers", {
id,
err: e,
});
});
}
@@ -326,9 +327,10 @@ export class LocalNode {
unsubscribe = coValue.subscribe(callback);
})
.catch((e) => {
logger.error(
"Error subscribing to " + id + ": " + (e as Error)?.message,
);
logger.error("Subscription error", {
id,
err: e,
});
});
return () => {

View File

@@ -8,11 +8,19 @@ export enum LogLevel {
NONE = 4,
}
type ErrorAttributes = { err: unknown };
export interface LogSystem {
debug(message: string, attributes?: Record<string, JsonValue>): void;
info(message: string, attributes?: Record<string, JsonValue>): void;
warn(message: string, attributes?: Record<string, JsonValue>): void;
error(message: string, attributes?: Record<string, JsonValue>): void;
warn(
message: string,
attributes?: Record<string, JsonValue> | ErrorAttributes,
): void;
error(
message: string,
attributes?: Record<string, JsonValue> | ErrorAttributes,
): void;
}
// Default console-based logging system
@@ -23,10 +31,16 @@ export class ConsoleLogSystem implements LogSystem {
info(message: string, attributes?: Record<string, JsonValue>) {
console.info(message, attributes);
}
warn(message: string, attributes?: Record<string, JsonValue>) {
warn(
message: string,
attributes?: Record<string, JsonValue> | ErrorAttributes,
) {
console.warn(message, attributes);
}
error(message: string, attributes?: Record<string, JsonValue>) {
error(
message: string,
attributes?: Record<string, JsonValue> | ErrorAttributes,
) {
console.error(message, attributes);
}
}
@@ -63,13 +77,19 @@ export class Logger {
}
}
warn(message: string, attributes?: Record<string, JsonValue>) {
warn(
message: string,
attributes?: Record<string, JsonValue> | ErrorAttributes,
) {
if (this.level <= LogLevel.WARN) {
this.logSystem.warn(message, attributes);
}
}
error(message: string, attributes?: Record<string, JsonValue>) {
error(
message: string,
attributes?: Record<string, JsonValue> | ErrorAttributes,
) {
if (this.level <= LogLevel.ERROR) {
this.logSystem.error(message, attributes);
}

View File

@@ -83,30 +83,23 @@ export class LSMStorage<WH, RH, FS extends FileSystem<WH, RH>> {
await this.sendNewContent(msg.id, msg, undefined);
}
} catch (e) {
logger.error(
`Error reading from localNode, handling msg\n\n${JSON.stringify(
msg,
(k, v) =>
k === "changes" || k === "encryptedChanges"
? v.slice(0, 20) + "..."
: v,
)}
Error: ${e instanceof Error ? e.message : "Unknown error"},
`,
);
logger.error(`Error reading from localNode, handling msg`, {
msg,
err: e,
});
}
nMsg++;
}
};
processMessages().catch((e) =>
logger.error("Error in processMessages in storage", e),
logger.error("Error in processMessages in storage", { err: e }),
);
setTimeout(
() =>
this.compact().catch((e) => {
logger.error("Error while compacting", e);
logger.error("Error while compacting", { err: e });
}),
20000,
);
@@ -132,7 +125,7 @@ export class LSMStorage<WH, RH, FS extends FileSystem<WH, RH>> {
sessions: {},
asDependencyOf,
})
.catch((e) => logger.error("Error while pushing known", e));
.catch((e) => logger.error("Error while pushing known", { err: e }));
return;
}
@@ -188,13 +181,15 @@ export class LSMStorage<WH, RH, FS extends FileSystem<WH, RH>> {
...ourKnown,
asDependencyOf,
})
.catch((e) => logger.error("Error while pushing known", e));
.catch((e) => logger.error("Error while pushing known", { err: e }));
for (const message of newContentMessages) {
if (Object.keys(message.new).length === 0) continue;
this.toLocalNode
.push(message)
.catch((e) => logger.error("Error while pushing new content", e));
.catch((e) =>
logger.error("Error while pushing new content", { err: e }),
);
}
this.coValues[id] = coValue;
@@ -502,7 +497,7 @@ export class LSMStorage<WH, RH, FS extends FileSystem<WH, RH>> {
setTimeout(
() =>
this.compact().catch((e) => {
logger.error("Error while compacting", e);
logger.error("Error while compacting", { err: e });
}),
5000,
);

View File

@@ -187,7 +187,7 @@ export class SyncManager {
if (entry.state.type !== "available") {
entry.loadFromPeers([peer]).catch((e: unknown) => {
logger.error("Error sending load: " + getErrorMessage(e));
logger.error("Error sending load", { err: e });
});
return;
}
@@ -204,7 +204,7 @@ export class SyncManager {
action: "load",
...coValue.knownState(),
}).catch((e: unknown) => {
logger.error("Error sending load: " + getErrorMessage(e));
logger.error("Error sending load", { err: e });
});
}
}
@@ -234,7 +234,7 @@ export class SyncManager {
asDependencyOf,
...coValue.knownState(),
}).catch((e: unknown) => {
logger.error("Error sending known state: " + getErrorMessage(e));
logger.error("Error sending known state", { err: e });
});
peer.toldKnownState.add(id);
@@ -262,7 +262,7 @@ export class SyncManager {
let lastYield = performance.now();
for (const [_i, piece] of newContentPieces.entries()) {
this.trySendToPeer(peer, piece).catch((e: unknown) => {
logger.error("Error sending content piece: " + getErrorMessage(e));
logger.error("Error sending content piece", { err: e });
});
if (performance.now() - lastYield > 10) {
@@ -275,7 +275,7 @@ export class SyncManager {
};
sendPieces().catch((e) => {
logger.error("Error sending new content piece, retrying", e);
logger.error("Error sending new content piece, retrying", { err: e });
peer.optimisticKnownStates.dispatch({
type: "SET",
id,
@@ -358,13 +358,11 @@ export class SyncManager {
}
})
.catch((e) => {
logger.error(
"Error processing messages from peer: " + getErrorMessage(e),
{
peerId: peer.id,
peerRole: peer.role,
},
);
logger.error("Error processing messages from peer", {
err: e,
peerId: peer.id,
peerRole: peer.role,
});
if (peer.crashOnClose) {
this.local.crashed = e;
throw new Error(e);
@@ -404,13 +402,13 @@ export class SyncManager {
// where we can get informations about the coValue
if (msg.header || Object.keys(msg.sessions).length > 0) {
entry.loadFromPeers([peer]).catch((e) => {
logger.error("Error loading coValue in handleLoad", e);
logger.error("Error loading coValue in handleLoad", { err: e });
});
}
return;
} else {
this.local.loadCoValueCore(msg.id, peer.id).catch((e) => {
logger.error("Error loading coValue in handleLoad", e);
logger.error("Error loading coValue in handleLoad", { err: e });
});
}
}
@@ -437,7 +435,7 @@ export class SyncManager {
header: false,
sessions: {},
}).catch((e) => {
logger.error("Error sending known state back", e);
logger.error("Error sending known state back", { err: e });
});
return;
@@ -447,7 +445,9 @@ export class SyncManager {
await this.sendNewContentIncludingDependencies(msg.id, peer);
})
.catch((e) => {
logger.error("Error loading coValue in handleLoad loading state", e);
logger.error("Error loading coValue in handleLoad loading state", {
err: e,
});
});
}
@@ -484,7 +484,7 @@ export class SyncManager {
.catch((e) => {
logger.error(
`Error loading coValue ${msg.id} to create loading state, as dependency of ${msg.asDependencyOf}`,
e,
{ err: e },
);
});
}
@@ -604,10 +604,11 @@ export class SyncManager {
// );
if (result.isErr()) {
logger.error("Failed to add transactions: " + result.error.type, {
logger.error("Failed to add transactions", {
peerId: peer.id,
peerRole: peer.role,
id: msg.id,
err: result.error,
});
peer.erroredCoValues.set(msg.id, result.error);
continue;
@@ -629,13 +630,11 @@ export class SyncManager {
isCorrection: true,
...coValue.knownState(),
}).catch((e) => {
logger.error(
"Error sending known state correction: " + getErrorMessage(e),
{
peerId: peer.id,
peerRole: peer.role,
},
);
logger.error("Error sending known state correction", {
peerId: peer.id,
peerRole: peer.role,
err: e,
});
});
} else {
/**
@@ -649,9 +648,10 @@ export class SyncManager {
action: "known",
...coValue.knownState(),
}).catch((e: unknown) => {
logger.error("Error sending known state: " + getErrorMessage(e), {
logger.error("Error sending known state", {
peerId: peer.id,
peerRole: peer.role,
err: e,
});
});
}

View File

@@ -1,5 +1,14 @@
# jazz-browser-media-images
## 0.11.3
### Patch Changes
- Updated dependencies [68b0242]
- cojson@0.11.3
- jazz-browser@0.11.3
- jazz-tools@0.11.3
## 0.11.2
### Patch Changes

View File

@@ -1,14 +1,14 @@
{
"name": "jazz-auth-clerk",
"version": "0.11.2",
"version": "0.11.3",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"license": "MIT",
"dependencies": {
"cojson": "workspace:0.11.0",
"jazz-browser": "workspace:0.11.2",
"jazz-tools": "workspace:0.11.2"
"cojson": "workspace:0.11.3",
"jazz-browser": "workspace:0.11.3",
"jazz-tools": "workspace:0.11.3"
},
"scripts": {
"format-and-lint": "biome check .",

View File

@@ -1,5 +1,12 @@
# jazz-browser-media-images
## 0.11.3
### Patch Changes
- jazz-browser@0.11.3
- jazz-tools@0.11.3
## 0.11.2
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-browser-media-images",
"version": "0.11.2",
"version": "0.11.3",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
@@ -8,8 +8,8 @@
"dependencies": {
"@types/image-blob-reduce": "^4.1.1",
"image-blob-reduce": "^4.1.0",
"jazz-browser": "workspace:0.11.2",
"jazz-tools": "workspace:0.11.2",
"jazz-browser": "workspace:0.11.3",
"jazz-tools": "workspace:0.11.3",
"pica": "^9.0.1",
"typescript": "~5.6.2"
},

View File

@@ -1,5 +1,15 @@
# jazz-browser
## 0.11.3
### Patch Changes
- Updated dependencies [68b0242]
- cojson-transport-ws@0.11.3
- cojson@0.11.3
- cojson-storage-indexeddb@0.11.3
- jazz-tools@0.11.3
## 0.11.2
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-browser",
"version": "0.11.2",
"version": "0.11.3",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View File

@@ -1,5 +1,14 @@
# jazz-inspector
## 0.11.3
### Patch Changes
- Updated dependencies [68b0242]
- cojson@0.11.3
- jazz-react-core@0.11.3
- jazz-tools@0.11.3
## 0.11.2
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-inspector",
"version": "0.11.2",
"version": "0.11.3",
"type": "module",
"main": "./dist/app.js",
"types": "./dist/app.d.ts",

View File

@@ -1,5 +1,14 @@
# jazz-autosub
## 0.11.3
### Patch Changes
- Updated dependencies [68b0242]
- cojson-transport-ws@0.11.3
- cojson@0.11.3
- jazz-tools@0.11.3
## 0.11.2
### Patch Changes

View File

@@ -5,7 +5,7 @@
"types": "dist/index.d.ts",
"type": "module",
"license": "MIT",
"version": "0.11.2",
"version": "0.11.3",
"dependencies": {
"cojson": "workspace:*",
"cojson-transport-ws": "workspace:*",

View File

@@ -1,5 +1,16 @@
# jazz-browser-media-images
## 0.11.3
### Patch Changes
- Updated dependencies [68b0242]
- cojson@0.11.3
- jazz-browser@0.11.3
- jazz-auth-clerk@0.11.3
- jazz-react@0.11.3
- jazz-tools@0.11.3
## 0.11.2
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-react-auth-clerk",
"version": "0.11.2",
"version": "0.11.3",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View File

@@ -1,5 +1,13 @@
# jazz-react-core
## 0.11.3
### Patch Changes
- Updated dependencies [68b0242]
- cojson@0.11.3
- jazz-tools@0.11.3
## 0.11.2
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-react-core",
"version": "0.11.2",
"version": "0.11.3",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View File

@@ -1,5 +1,15 @@
# jazz-react-native-auth-clerk
## 0.11.3
### Patch Changes
- Updated dependencies [68b0242]
- cojson@0.11.3
- jazz-react-native@0.11.3
- jazz-auth-clerk@0.11.3
- jazz-tools@0.11.3
## 0.11.2
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-react-native-auth-clerk",
"version": "0.11.2",
"version": "0.11.3",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View File

@@ -1,5 +1,11 @@
# jazz-browser-media-images
## 0.11.3
### Patch Changes
- jazz-tools@0.11.3
## 0.11.2
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-react-native-media-images",
"version": "0.11.2",
"version": "0.11.3",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View File

@@ -1,5 +1,16 @@
# jazz-browser
## 0.11.3
### Patch Changes
- Updated dependencies [68b0242]
- cojson-transport-ws@0.11.3
- cojson@0.11.3
- cojson-storage-rn-sqlite@0.11.3
- jazz-react-core@0.11.3
- jazz-tools@0.11.3
## 0.11.2
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-react-native",
"version": "0.11.2",
"version": "0.11.3",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",

View File

@@ -1,5 +1,15 @@
# jazz-react
## 0.11.3
### Patch Changes
- Updated dependencies [68b0242]
- cojson@0.11.3
- jazz-browser@0.11.3
- jazz-react-core@0.11.3
- jazz-tools@0.11.3
## 0.11.2
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-react",
"version": "0.11.2",
"version": "0.11.3",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
@@ -17,10 +17,10 @@
},
"dependencies": {
"@scure/bip39": "^1.3.0",
"cojson": "workspace:0.11.0",
"jazz-browser": "workspace:0.11.2",
"cojson": "workspace:0.11.3",
"jazz-browser": "workspace:0.11.3",
"jazz-react-core": "workspace:*",
"jazz-tools": "workspace:0.11.2"
"jazz-tools": "workspace:0.11.3"
},
"devDependencies": {
"@testing-library/dom": "^10.4.0",

View File

@@ -1,5 +1,15 @@
# jazz-run
## 0.11.3
### Patch Changes
- Updated dependencies [68b0242]
- cojson-storage-sqlite@0.11.3
- cojson-transport-ws@0.11.3
- cojson@0.11.3
- jazz-tools@0.11.3
## 0.11.2
### Patch Changes

View File

@@ -3,7 +3,7 @@
"bin": "./dist/index.js",
"type": "module",
"license": "MIT",
"version": "0.11.2",
"version": "0.11.3",
"exports": {
"./startSyncServer": {
"import": "./dist/startSyncServer.js",
@@ -27,11 +27,11 @@
"@effect/printer-ansi": "^0.34.5",
"@effect/schema": "^0.71.1",
"@effect/typeclass": "^0.25.5",
"cojson": "workspace:0.11.0",
"cojson-storage-sqlite": "workspace:0.11.0",
"cojson-transport-ws": "workspace:0.11.0",
"cojson": "workspace:0.11.3",
"cojson-storage-sqlite": "workspace:0.11.3",
"cojson-transport-ws": "workspace:0.11.3",
"effect": "^3.6.5",
"jazz-tools": "workspace:0.11.2",
"jazz-tools": "workspace:0.11.3",
"ws": "^8.14.2"
},
"devDependencies": {

View File

@@ -1,5 +1,14 @@
# jazz-svelte
## 0.11.3
### Patch Changes
- Updated dependencies [68b0242]
- cojson@0.11.3
- jazz-browser@0.11.3
- jazz-tools@0.11.3
## 0.11.2
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-svelte",
"version": "0.11.2",
"version": "0.11.3",
"scripts": {
"dev": "vite dev",
"build": "vite build && npm run package",

View File

@@ -1,5 +1,12 @@
# jazz-tools
## 0.11.3
### Patch Changes
- Updated dependencies [68b0242]
- cojson@0.11.3
## 0.11.2
### Patch Changes

View File

@@ -17,7 +17,7 @@
},
"type": "module",
"license": "MIT",
"version": "0.11.2",
"version": "0.11.3",
"dependencies": {
"@scure/bip39": "^1.3.0",
"cojson": "workspace:*",

View File

@@ -1,5 +1,14 @@
# jazz-react
## 0.11.3
### Patch Changes
- Updated dependencies [68b0242]
- cojson@0.11.3
- jazz-browser@0.11.3
- jazz-tools@0.11.3
## 0.11.2
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "jazz-vue",
"version": "0.11.2",
"version": "0.11.3",
"type": "module",
"main": "dist/index.js",
"types": "src/index.ts",

Some files were not shown because too many files have changed in this diff Show More