jazz-tools 0.13.4 → 0.13.5
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.
- package/.turbo/turbo-build.log +5 -5
- package/CHANGELOG.md +8 -0
- package/dist/{chunk-JNC2UVYB.js → chunk-IYNL2EJM.js} +18 -8
- package/dist/chunk-IYNL2EJM.js.map +1 -0
- package/dist/coValues/inbox.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/testing.js +1 -1
- package/package.json +2 -2
- package/src/coValues/inbox.ts +26 -12
- package/src/tests/inbox.test.ts +57 -1
- package/dist/chunk-JNC2UVYB.js.map +0 -1
package/.turbo/turbo-build.log
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
> jazz-tools@0.13.
|
2
|
+
> jazz-tools@0.13.5 build /home/runner/_work/jazz/jazz/packages/jazz-tools
|
3
3
|
> tsup && pnpm types
|
4
4
|
|
5
5
|
[34mCLI[39m Building entry: {"index":"src/index.ts","testing":"src/testing.ts"}
|
@@ -11,12 +11,12 @@
|
|
11
11
|
[34mESM[39m Build start
|
12
12
|
[32mESM[39m [1mdist/index.js [22m[32m1.50 KB[39m
|
13
13
|
[32mESM[39m [1mdist/testing.js [22m[32m6.26 KB[39m
|
14
|
-
[32mESM[39m [1mdist/chunk-
|
14
|
+
[32mESM[39m [1mdist/chunk-IYNL2EJM.js [22m[32m127.59 KB[39m
|
15
15
|
[32mESM[39m [1mdist/index.js.map [22m[32m259.00 B[39m
|
16
16
|
[32mESM[39m [1mdist/testing.js.map [22m[32m12.37 KB[39m
|
17
|
-
[32mESM[39m [1mdist/chunk-
|
18
|
-
[32mESM[39m ⚡️ Build success in
|
17
|
+
[32mESM[39m [1mdist/chunk-IYNL2EJM.js.map [22m[32m300.73 KB[39m
|
18
|
+
[32mESM[39m ⚡️ Build success in 69ms
|
19
19
|
|
20
|
-
> jazz-tools@0.13.
|
20
|
+
> jazz-tools@0.13.5 types /home/runner/_work/jazz/jazz/packages/jazz-tools
|
21
21
|
> tsc --outDir dist
|
22
22
|
|
package/CHANGELOG.md
CHANGED
@@ -1152,7 +1152,7 @@ function createInboxRoot(account) {
|
|
1152
1152
|
inviteLink
|
1153
1153
|
};
|
1154
1154
|
}
|
1155
|
-
function createInboxMessage(payload, inboxOwner) {
|
1155
|
+
async function createInboxMessage(payload, inboxOwner) {
|
1156
1156
|
const group = payload._raw.group;
|
1157
1157
|
if (group instanceof RawAccount4) {
|
1158
1158
|
throw new Error("Inbox messages should be owned by a group");
|
@@ -1164,6 +1164,8 @@ function createInboxMessage(payload, inboxOwner) {
|
|
1164
1164
|
processed: false,
|
1165
1165
|
error: void 0
|
1166
1166
|
});
|
1167
|
+
await payload._raw.core.waitForSync();
|
1168
|
+
await message.core.waitForSync();
|
1167
1169
|
return message;
|
1168
1170
|
}
|
1169
1171
|
var Inbox = class _Inbox {
|
@@ -1236,10 +1238,14 @@ var Inbox = class _Inbox {
|
|
1236
1238
|
const errors = failed.get(txKey) ?? [];
|
1237
1239
|
const stringifiedError = String(error);
|
1238
1240
|
errors.push(stringifiedError);
|
1239
|
-
|
1240
|
-
|
1241
|
+
let inboxMessage;
|
1242
|
+
try {
|
1243
|
+
inboxMessage = node.expectCoValueLoaded(item.value).getCurrentContent();
|
1244
|
+
inboxMessage.set("error", stringifiedError);
|
1245
|
+
} catch (error2) {
|
1246
|
+
}
|
1241
1247
|
if (errors.length > retries) {
|
1242
|
-
inboxMessage
|
1248
|
+
inboxMessage?.set("processed", true);
|
1243
1249
|
this.processed.push(txKey);
|
1244
1250
|
this.failed.push({ errors, value: item.value });
|
1245
1251
|
} else {
|
@@ -1256,7 +1262,11 @@ var Inbox = class _Inbox {
|
|
1256
1262
|
}
|
1257
1263
|
}
|
1258
1264
|
};
|
1259
|
-
|
1265
|
+
const unsubscribe = this.messages.subscribe(handleNewMessages);
|
1266
|
+
return () => {
|
1267
|
+
unsubscribe();
|
1268
|
+
clearFailTimer();
|
1269
|
+
};
|
1260
1270
|
}
|
1261
1271
|
static async load(account) {
|
1262
1272
|
const profile = account.profile;
|
@@ -1291,8 +1301,8 @@ var InboxSender = class _InboxSender {
|
|
1291
1301
|
getOwnerAccount() {
|
1292
1302
|
return this.owner;
|
1293
1303
|
}
|
1294
|
-
sendMessage(message) {
|
1295
|
-
const inboxMessage = createInboxMessage(message, this.owner);
|
1304
|
+
async sendMessage(message) {
|
1305
|
+
const inboxMessage = await createInboxMessage(message, this.owner);
|
1296
1306
|
this.messages.push(inboxMessage.id);
|
1297
1307
|
return new Promise((resolve, reject) => {
|
1298
1308
|
inboxMessage.subscribe((message2) => {
|
@@ -4431,4 +4441,4 @@ export {
|
|
4431
4441
|
consumeInviteLink
|
4432
4442
|
};
|
4433
4443
|
/* istanbul ignore file -- @preserve */
|
4434
|
-
//# sourceMappingURL=chunk-
|
4444
|
+
//# sourceMappingURL=chunk-IYNL2EJM.js.map
|