@gryt/core 0.18.1 → 0.18.2
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/dist/mls/dmDriver.js +10 -1
- package/package.json +2 -2
package/dist/mls/dmDriver.js
CHANGED
|
@@ -718,12 +718,17 @@ export function createMlsDmDriver(options) {
|
|
|
718
718
|
const deadline = Date.now() + giveUpMs;
|
|
719
719
|
const flight = { conversationId, message: null, seq: null };
|
|
720
720
|
flights.add(flight);
|
|
721
|
+
let rejoined = false;
|
|
721
722
|
try {
|
|
722
723
|
for (;;) {
|
|
723
724
|
try {
|
|
724
725
|
return await sendOnce(flight, peer, plaintext, attachmentIds);
|
|
725
726
|
}
|
|
726
727
|
catch (e) {
|
|
728
|
+
if (e instanceof MlsDriverError && e.code === "not_in_group" && !rejoined && !left.has(conversationId)) {
|
|
729
|
+
rejoined = true;
|
|
730
|
+
continue;
|
|
731
|
+
}
|
|
727
732
|
const why = unreachable(e);
|
|
728
733
|
if (!why || stopped)
|
|
729
734
|
throw e;
|
|
@@ -747,8 +752,12 @@ export function createMlsDmDriver(options) {
|
|
|
747
752
|
return run(conversationId, async () => {
|
|
748
753
|
const d = await ownDevice();
|
|
749
754
|
const open = await load(conversationId);
|
|
750
|
-
if (!open || !(await catchUp(open)))
|
|
755
|
+
if (!open || !(await catchUp(open))) {
|
|
756
|
+
// A copy that can't follow the log is dead weight: drop it, so the retry joins again.
|
|
757
|
+
if (open && !left.has(conversationId) && !flight.message)
|
|
758
|
+
await store.deleteGroup(conversationId);
|
|
751
759
|
throw new MlsDriverError("not_in_group", "This device isn't in that group.");
|
|
760
|
+
}
|
|
752
761
|
if (flight.seq !== null)
|
|
753
762
|
return { seq: flight.seq };
|
|
754
763
|
if (flight.message) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gryt/core",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.2",
|
|
4
4
|
"description": "Gryt's shared application logic: one implementation of the things the desktop and mobile apps both do.",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"repository": {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"access": "public"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@gryt/crypto": "0.11.
|
|
46
|
+
"@gryt/crypto": "0.11.1",
|
|
47
47
|
"@noble/hashes": "^2.3.0"
|
|
48
48
|
}
|
|
49
49
|
}
|