@agentunion/fastaun-browser 0.5.8 → 0.5.9
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/CHANGELOG.md +30 -0
- package/_packed_docs/CHANGELOG.md +30 -0
- package/_packed_docs/agent.md/examples//347/276/244/347/273/204-/345/274/200/345/217/221/345/233/242/351/230/237.md +21 -0
- package/dist/agent-md.d.ts.map +1 -1
- package/dist/agent-md.js +1 -0
- package/dist/agent-md.js.map +1 -1
- package/dist/aid-store.d.ts.map +1 -1
- package/dist/aid-store.js +1 -3
- package/dist/aid-store.js.map +1 -1
- package/dist/bundle.js +454 -83
- package/dist/client/delivery.d.ts +7 -0
- package/dist/client/delivery.d.ts.map +1 -1
- package/dist/client/delivery.js +140 -19
- package/dist/client/delivery.js.map +1 -1
- package/dist/client/group-state.js +2 -2
- package/dist/client/group-state.js.map +1 -1
- package/dist/client/lifecycle.d.ts.map +1 -1
- package/dist/client/lifecycle.js +15 -4
- package/dist/client/lifecycle.js.map +1 -1
- package/dist/client/rpc-pipeline.d.ts +8 -0
- package/dist/client/rpc-pipeline.d.ts.map +1 -1
- package/dist/client/rpc-pipeline.js +149 -34
- package/dist/client/rpc-pipeline.js.map +1 -1
- package/dist/client/v2-e2ee.d.ts.map +1 -1
- package/dist/client/v2-e2ee.js +50 -12
- package/dist/client/v2-e2ee.js.map +1 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +105 -13
- package/dist/client.js.map +1 -1
- package/dist/facades.d.ts.map +1 -1
- package/dist/facades.js +7 -3
- package/dist/facades.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/_packed_docs//345/217/221/345/270/203/346/212/245/345/221/212-0.5.6.md +0 -260
|
@@ -11,6 +11,9 @@ export declare class MessageDeliveryEngine {
|
|
|
11
11
|
private realtimeSyncing;
|
|
12
12
|
private pendingP2pPullUpper;
|
|
13
13
|
private pendingGroupPullUpper;
|
|
14
|
+
private pendingPullNoProgressAcks;
|
|
15
|
+
private onlineUnreadHintTargets;
|
|
16
|
+
private onlineUnreadHintOwners;
|
|
14
17
|
private realtimeAcking;
|
|
15
18
|
private pendingP2PInlineAcks;
|
|
16
19
|
private pendingGroupInlineAcks;
|
|
@@ -20,6 +23,8 @@ export declare class MessageDeliveryEngine {
|
|
|
20
23
|
constructor(runtime: ClientRuntime);
|
|
21
24
|
resetInlineAckState(): void;
|
|
22
25
|
private isInlineGenerationCurrent;
|
|
26
|
+
private isPullOperationCurrent;
|
|
27
|
+
private ensurePullOperationCurrent;
|
|
23
28
|
captureInlineGeneration(): number;
|
|
24
29
|
private beginRealtimeSync;
|
|
25
30
|
private endRealtimeSync;
|
|
@@ -27,6 +32,7 @@ export declare class MessageDeliveryEngine {
|
|
|
27
32
|
onPullGateIdle(ns: string): void;
|
|
28
33
|
private recordPendingPull;
|
|
29
34
|
private consumePendingPull;
|
|
35
|
+
private markPendingPullNoProgress;
|
|
30
36
|
private schedulePendingPullIfNeeded;
|
|
31
37
|
private beginRealtimeAck;
|
|
32
38
|
private finishRealtimeAck;
|
|
@@ -114,6 +120,7 @@ export declare class MessageDeliveryEngine {
|
|
|
114
120
|
private runP2PForwardRecovery;
|
|
115
121
|
private runGroupForwardRecovery;
|
|
116
122
|
private syncState;
|
|
123
|
+
private forwardMaxPages;
|
|
117
124
|
private inlineMessage;
|
|
118
125
|
private boundString;
|
|
119
126
|
private sameRequiredBinding;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delivery.d.ts","sourceRoot":"","sources":["../../src/client/delivery.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAiC,KAAK,UAAU,EAAkB,KAAK,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAE3H,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAgDlD,KAAK,oBA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AAC,qBAAqB;IAc7B,OAAO,CAAC,wBAAwB;IAWhC,OAAO,CAAC,wBAAwB;IAMhC,OAAO,CAAC,iBAAiB;IAQzB,OAAO,CAAC,sBAAsB;IAkB9B,OAAO,CAAC,uBAAuB;IAW/B,OAAO,CAAC,0BAA0B;YAQpB,oBAAoB;IAYlC,OAAO,CAAC,sBAAsB;YAMhB,uBAAuB;IA4CrC,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAqDpC,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM;IAwB3E,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,GAAG,SAAS;IA4BtD,oBAAoB,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,YAAY,UAAQ,EAAE,OAAO,UAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IA6BzG,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC;IAgCvG,oBAAoB,CACxB,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,UAAO,GAC7E,OAAO,CAAC,OAAO,CAAC;CAuCpB"}
|
package/dist/client/delivery.js
CHANGED
|
@@ -98,6 +98,9 @@ export class MessageDeliveryEngine {
|
|
|
98
98
|
realtimeSyncing = null;
|
|
99
99
|
pendingP2pPullUpper = null;
|
|
100
100
|
pendingGroupPullUpper = null;
|
|
101
|
+
pendingPullNoProgressAcks = null;
|
|
102
|
+
onlineUnreadHintTargets = null;
|
|
103
|
+
onlineUnreadHintOwners = null;
|
|
101
104
|
realtimeAcking = null;
|
|
102
105
|
pendingP2PInlineAcks = null;
|
|
103
106
|
pendingGroupInlineAcks = null;
|
|
@@ -111,9 +114,13 @@ export class MessageDeliveryEngine {
|
|
|
111
114
|
}
|
|
112
115
|
resetInlineAckState() {
|
|
113
116
|
this.inlineGeneration += 1;
|
|
117
|
+
void this.runtime.client._rpcPipeline?.invalidatePulls?.();
|
|
114
118
|
this.realtimeSyncing = null;
|
|
115
119
|
this.pendingP2pPullUpper = null;
|
|
116
120
|
this.pendingGroupPullUpper = null;
|
|
121
|
+
this.pendingPullNoProgressAcks = null;
|
|
122
|
+
this.onlineUnreadHintTargets = null;
|
|
123
|
+
this.onlineUnreadHintOwners = null;
|
|
117
124
|
this.realtimeTailResults = null;
|
|
118
125
|
this.realtimeAcking = null;
|
|
119
126
|
this.pendingP2PInlineAcks = null;
|
|
@@ -123,6 +130,20 @@ export class MessageDeliveryEngine {
|
|
|
123
130
|
isInlineGenerationCurrent(generation) {
|
|
124
131
|
return generation === this.inlineGeneration;
|
|
125
132
|
}
|
|
133
|
+
isPullOperationCurrent() {
|
|
134
|
+
const client = this.runtime.client;
|
|
135
|
+
const generation = client._pullOperationGeneration;
|
|
136
|
+
if (generation === undefined)
|
|
137
|
+
return true;
|
|
138
|
+
const pipeline = client._rpcPipeline;
|
|
139
|
+
return typeof pipeline?.isPullGenerationCurrent === 'function'
|
|
140
|
+
? pipeline.isPullGenerationCurrent(generation)
|
|
141
|
+
: true;
|
|
142
|
+
}
|
|
143
|
+
ensurePullOperationCurrent() {
|
|
144
|
+
if (!this.isPullOperationCurrent())
|
|
145
|
+
throw new Error('pull invalidated');
|
|
146
|
+
}
|
|
126
147
|
captureInlineGeneration() {
|
|
127
148
|
return this.inlineGeneration;
|
|
128
149
|
}
|
|
@@ -160,8 +181,15 @@ export class MessageDeliveryEngine {
|
|
|
160
181
|
}
|
|
161
182
|
consumePendingPull(ns, throughSeq) {
|
|
162
183
|
const pending = ns.startsWith('p2p:') ? this.pendingP2pPullUpper : this.pendingGroupPullUpper;
|
|
163
|
-
if ((pending?.get(ns) ?? 0) <= throughSeq)
|
|
184
|
+
if ((pending?.get(ns) ?? 0) <= throughSeq) {
|
|
164
185
|
pending?.delete(ns);
|
|
186
|
+
this.pendingPullNoProgressAcks?.delete(ns);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
markPendingPullNoProgress(ns, ack) {
|
|
190
|
+
const blocked = this.pendingPullNoProgressAcks ?? new Map();
|
|
191
|
+
this.pendingPullNoProgressAcks = blocked;
|
|
192
|
+
blocked.set(ns, ack);
|
|
165
193
|
}
|
|
166
194
|
schedulePendingPullIfNeeded(ns, reason) {
|
|
167
195
|
const pending = ns.startsWith('p2p:') ? this.pendingP2pPullUpper : this.pendingGroupPullUpper;
|
|
@@ -170,15 +198,21 @@ export class MessageDeliveryEngine {
|
|
|
170
198
|
const upper = pending.get(ns) ?? 0;
|
|
171
199
|
if (upper <= 0) {
|
|
172
200
|
pending.delete(ns);
|
|
201
|
+
this.pendingPullNoProgressAcks?.delete(ns);
|
|
173
202
|
return false;
|
|
174
203
|
}
|
|
175
204
|
const client = this.runtime.client;
|
|
176
205
|
const contiguous = client._seqTracker.getContiguousSeq(ns);
|
|
177
206
|
if (upper <= contiguous) {
|
|
178
207
|
pending.delete(ns);
|
|
208
|
+
this.pendingPullNoProgressAcks?.delete(ns);
|
|
179
209
|
client._clientLog?.debug(`pending pull upper already covered: ns=${ns}, upper_seq=${upper}, contiguous=${contiguous}, reason=${reason}`);
|
|
180
210
|
return false;
|
|
181
211
|
}
|
|
212
|
+
const blockedAck = this.pendingPullNoProgressAcks?.get(ns);
|
|
213
|
+
if (blockedAck !== undefined && contiguous <= blockedAck)
|
|
214
|
+
return false;
|
|
215
|
+
this.pendingPullNoProgressAcks?.delete(ns);
|
|
182
216
|
if (client.state !== ConnectionState.READY || client._closing || this.realtimeSyncing?.has(ns)
|
|
183
217
|
|| client._rpcPipeline?.hasPullActivity?.(ns, false))
|
|
184
218
|
return false;
|
|
@@ -620,6 +654,20 @@ export class MessageDeliveryEngine {
|
|
|
620
654
|
else if (Object.prototype.hasOwnProperty.call(row, 'ack_seq')) {
|
|
621
655
|
value = row.ack_seq;
|
|
622
656
|
}
|
|
657
|
+
else if (Object.prototype.hasOwnProperty.call(row, 'cursor')) {
|
|
658
|
+
const cursor = row.cursor;
|
|
659
|
+
const cursorRow = isJsonObject(cursor)
|
|
660
|
+
? cursor
|
|
661
|
+
: null;
|
|
662
|
+
if (cursorRow) {
|
|
663
|
+
if (!Object.prototype.hasOwnProperty.call(cursorRow, 'current_seq'))
|
|
664
|
+
return 0;
|
|
665
|
+
value = cursorRow.current_seq;
|
|
666
|
+
}
|
|
667
|
+
else {
|
|
668
|
+
value = cursor;
|
|
669
|
+
}
|
|
670
|
+
}
|
|
623
671
|
else {
|
|
624
672
|
return requestedSeq;
|
|
625
673
|
}
|
|
@@ -640,6 +688,7 @@ export class MessageDeliveryEngine {
|
|
|
640
688
|
}
|
|
641
689
|
async confirmPlainForwardAck(ns, method, ackSeq, groupId = '') {
|
|
642
690
|
const client = this.runtime.client;
|
|
691
|
+
this.ensurePullOperationCurrent();
|
|
643
692
|
const coordinator = this.forwardCoordinator();
|
|
644
693
|
const generation = this.captureInlineGeneration();
|
|
645
694
|
coordinator.recordForwardAck(ns, ackSeq);
|
|
@@ -658,6 +707,7 @@ export class MessageDeliveryEngine {
|
|
|
658
707
|
_rpc_background: true,
|
|
659
708
|
};
|
|
660
709
|
const result = await client._rpcPipeline.rawCall(method, params, { background: true });
|
|
710
|
+
this.ensurePullOperationCurrent();
|
|
661
711
|
const actualAckSeq = this.resolveForwardAckSeq(result, ackSeq);
|
|
662
712
|
if (actualAckSeq < ackSeq) {
|
|
663
713
|
throw new Error(`${method} server ACK watermark ${actualAckSeq} is below requested ${ackSeq}`);
|
|
@@ -675,6 +725,7 @@ export class MessageDeliveryEngine {
|
|
|
675
725
|
throw new Error(`${method} response must be an object`);
|
|
676
726
|
}
|
|
677
727
|
const client = this.runtime.client;
|
|
728
|
+
this.ensurePullOperationCurrent();
|
|
678
729
|
const response = result;
|
|
679
730
|
const messages = deduplicatePlainForwardPageMessages(response.messages, afterSeq);
|
|
680
731
|
const coordinator = this.forwardCoordinator();
|
|
@@ -705,25 +756,30 @@ export class MessageDeliveryEngine {
|
|
|
705
756
|
let committed = false;
|
|
706
757
|
try {
|
|
707
758
|
for (const rawMessage of messages) {
|
|
759
|
+
this.ensurePullOperationCurrent();
|
|
708
760
|
const seq = positiveSafeSequenceHint(rawMessage.seq);
|
|
709
761
|
if (method === 'message.pull') {
|
|
710
762
|
const appEvent = p2pAppEventFromPlainPullMessage(rawMessage);
|
|
711
763
|
if (await this.publishPulledMessage(appEvent.event, ns, seq, appEvent.payload, false)) {
|
|
712
764
|
publishedCount += 1;
|
|
713
765
|
}
|
|
766
|
+
this.ensurePullOperationCurrent();
|
|
714
767
|
continue;
|
|
715
768
|
}
|
|
716
769
|
const message = normalizeGroupMentionMode(rawMessage);
|
|
717
770
|
if (this.recallEventFromGroupMessage(message)) {
|
|
718
771
|
if (await this.publishGroupRecallTombstone(groupId, seq, message)) {
|
|
772
|
+
this.ensurePullOperationCurrent();
|
|
719
773
|
this.markPublishedSeq(ns, seq);
|
|
720
774
|
publishedCount += 1;
|
|
721
775
|
}
|
|
722
776
|
}
|
|
723
777
|
else if (await this.publishPulledMessage('group.message_created', ns, seq, message, false)) {
|
|
778
|
+
this.ensurePullOperationCurrent();
|
|
724
779
|
publishedCount += 1;
|
|
725
780
|
}
|
|
726
781
|
}
|
|
782
|
+
this.ensurePullOperationCurrent();
|
|
727
783
|
if (messages.length > 0)
|
|
728
784
|
client._seqTracker.onPullResult(ns, messages, afterSeq);
|
|
729
785
|
const commitTarget = Math.max(client._seqTracker.getContiguousSeq(ns), retentionFloor, visibilityFloor, deferredServerCursor);
|
|
@@ -731,18 +787,21 @@ export class MessageDeliveryEngine {
|
|
|
731
787
|
client._seqTracker.forceContiguousSeq(ns, commitTarget);
|
|
732
788
|
}
|
|
733
789
|
if (client._seqTracker.getContiguousSeq(ns) !== pageContigBefore) {
|
|
790
|
+
this.ensurePullOperationCurrent();
|
|
734
791
|
await this.drainOrderedMessages(ns, undefined, false, false);
|
|
792
|
+
this.ensurePullOperationCurrent();
|
|
735
793
|
await client._commitSeqTrackerState(ns);
|
|
736
794
|
}
|
|
737
795
|
committed = true;
|
|
738
796
|
}
|
|
739
797
|
catch (exc) {
|
|
740
|
-
if (!committed && typeof client._seqTracker.restoreNamespaceSnapshot === 'function') {
|
|
798
|
+
if (this.isPullOperationCurrent() && !committed && typeof client._seqTracker.restoreNamespaceSnapshot === 'function') {
|
|
741
799
|
client._seqTracker.restoreNamespaceSnapshot(ns, pageTrackerSnapshot);
|
|
742
800
|
this.dropSeqTrackerPending(ns);
|
|
743
801
|
}
|
|
744
802
|
throw exc;
|
|
745
803
|
}
|
|
804
|
+
this.ensurePullOperationCurrent();
|
|
746
805
|
const committedAck = client._seqTracker.getContiguousSeq(ns);
|
|
747
806
|
if (deferredServerCursor > 0 && committedAck >= deferredServerCursor) {
|
|
748
807
|
coordinator.clearForwardCursor(ns, committedAck);
|
|
@@ -773,6 +832,7 @@ export class MessageDeliveryEngine {
|
|
|
773
832
|
if (clampedAckSeq < pendingAckSeq) {
|
|
774
833
|
throw new Error(`${ackMethod} cannot confirm pending Forward watermark ${pendingAckSeq}`);
|
|
775
834
|
}
|
|
835
|
+
this.ensurePullOperationCurrent();
|
|
776
836
|
await this.confirmPlainForwardAck(ns, ackMethod, pendingAckSeq, groupId);
|
|
777
837
|
}
|
|
778
838
|
return { rawCount: messages.length, publishedCount };
|
|
@@ -2075,9 +2135,36 @@ export class MessageDeliveryEngine {
|
|
|
2075
2135
|
if (!groupId)
|
|
2076
2136
|
return;
|
|
2077
2137
|
const ns = `group:${groupId}`;
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2138
|
+
const targets = this.onlineUnreadHintTargets ?? new Map();
|
|
2139
|
+
const owners = this.onlineUnreadHintOwners ?? new Set();
|
|
2140
|
+
this.onlineUnreadHintTargets = targets;
|
|
2141
|
+
this.onlineUnreadHintOwners = owners;
|
|
2142
|
+
targets.set(ns, Math.max(targets.get(ns) ?? 0, positiveSafeSequenceHint(data.seq)));
|
|
2143
|
+
if (owners.has(ns))
|
|
2144
|
+
return;
|
|
2145
|
+
owners.add(ns);
|
|
2146
|
+
client._safeAsync((async () => {
|
|
2147
|
+
try {
|
|
2148
|
+
while (true) {
|
|
2149
|
+
const throughSeq = targets.get(ns) ?? 0;
|
|
2150
|
+
const ackBefore = this.syncState(ns).ack;
|
|
2151
|
+
await this.runGroupForwardRecovery(groupId, ns, 50, true, throughSeq);
|
|
2152
|
+
const ackAfter = this.syncState(ns).ack;
|
|
2153
|
+
const target = targets.get(ns) ?? 0;
|
|
2154
|
+
if (ackAfter >= target || ackAfter <= ackBefore)
|
|
2155
|
+
return;
|
|
2156
|
+
}
|
|
2157
|
+
}
|
|
2158
|
+
catch (exc) {
|
|
2159
|
+
client._clientLog?.debug(`online unread hint background Forward failed: ns=${ns} err=${formatDeliveryError(exc)}`);
|
|
2160
|
+
}
|
|
2161
|
+
finally {
|
|
2162
|
+
if (this.onlineUnreadHintTargets === targets)
|
|
2163
|
+
targets.delete(ns);
|
|
2164
|
+
if (this.onlineUnreadHintOwners === owners)
|
|
2165
|
+
owners.delete(ns);
|
|
2166
|
+
}
|
|
2167
|
+
})());
|
|
2081
2168
|
}
|
|
2082
2169
|
enqueueOnlineUnreadEventHint(data) {
|
|
2083
2170
|
const client = this.runtime.client;
|
|
@@ -2109,17 +2196,19 @@ export class MessageDeliveryEngine {
|
|
|
2109
2196
|
const key = pipeline.pullGateKeyForCall('message.pull', request);
|
|
2110
2197
|
return await pipeline.runPullSerialized(key, invoke, background);
|
|
2111
2198
|
}
|
|
2112
|
-
async runGroupForwardRecovery(groupId, ns, pageLimit, background = false) {
|
|
2199
|
+
async runGroupForwardRecovery(groupId, ns, pageLimit, background = false, throughSeq = 0) {
|
|
2113
2200
|
const client = this.runtime.client;
|
|
2201
|
+
const state = this.syncState(ns);
|
|
2202
|
+
const maxPages = this.forwardMaxPages(state.ack, throughSeq, pageLimit);
|
|
2114
2203
|
const request = {
|
|
2115
2204
|
group_id: groupId,
|
|
2116
|
-
after_seq:
|
|
2205
|
+
after_seq: state.ack,
|
|
2117
2206
|
limit: pageLimit,
|
|
2118
|
-
max_pages:
|
|
2207
|
+
max_pages: maxPages,
|
|
2119
2208
|
};
|
|
2120
2209
|
const invoke = async () => {
|
|
2121
2210
|
const after = this.syncState(ns).ack;
|
|
2122
|
-
const messages = await client._pullGroupV2(groupId, after, pageLimit, { gateLocked: true, maxPages
|
|
2211
|
+
const messages = await client._pullGroupV2(groupId, after, pageLimit, { gateLocked: true, maxPages });
|
|
2123
2212
|
return { messages, raw_count: messages.length };
|
|
2124
2213
|
};
|
|
2125
2214
|
const pipeline = client._rpcPipeline;
|
|
@@ -2135,6 +2224,10 @@ export class MessageDeliveryEngine {
|
|
|
2135
2224
|
const ack = Number(tracker.getContiguousSeq(ns) || 0);
|
|
2136
2225
|
return { ack, tail: ack, head: Math.max(ack, Number(tracker.getMaxSeenSeq?.(ns) || 0)) };
|
|
2137
2226
|
}
|
|
2227
|
+
forwardMaxPages(ack, throughSeq, pageLimit) {
|
|
2228
|
+
const limit = Number.isSafeInteger(pageLimit) && pageLimit > 0 ? pageLimit : 1;
|
|
2229
|
+
return Math.max(1, Math.ceil(Math.max(0, throughSeq - ack) / limit));
|
|
2230
|
+
}
|
|
2138
2231
|
inlineMessage(data) {
|
|
2139
2232
|
if (!isJsonObject(data))
|
|
2140
2233
|
return null;
|
|
@@ -2642,16 +2735,24 @@ export class MessageDeliveryEngine {
|
|
|
2642
2735
|
// 落盘的 ack 为起点,至多补一页普通 Forward 即可恢复该小窗口。
|
|
2643
2736
|
const tailMissedDuringPull = tailCompleted
|
|
2644
2737
|
&& Number(client._seqTracker.getMaxSeenSeq(ns) || 0) > state.head;
|
|
2738
|
+
const maxSeen = Number(client._seqTracker.getMaxSeenSeq(ns) || 0);
|
|
2645
2739
|
const pendingThroughSeq = tailMissedDuringPull
|
|
2646
|
-
?
|
|
2740
|
+
? maxSeen
|
|
2647
2741
|
: 0;
|
|
2648
2742
|
const tailForward = tailCompleted && (state.ack < state.tail - 1 || tailMissedDuringPull);
|
|
2649
2743
|
const backgroundWindowForward = order[0] === 'forward' && !headForward;
|
|
2650
2744
|
if (headForward || tailForward
|
|
2651
2745
|
|| (client._sessionOptions?.background_sync !== false && backgroundWindowForward)) {
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2746
|
+
const forwardTarget = Math.max(headForward ? Math.max(pushSeq, maxSeen) : 0, (tailForward || backgroundWindowForward) ? state.tail - 1 : 0, tailMissedDuringPull ? maxSeen : 0);
|
|
2747
|
+
const forwardMaxPages = this.forwardMaxPages(state.ack, forwardTarget, pageLimit);
|
|
2748
|
+
result = await run(false, !(headForward || tailForward), forwardMaxPages, headForward || tailMissedDuringPull);
|
|
2749
|
+
if (pendingThroughSeq > 0) {
|
|
2750
|
+
const committedAck = this.syncState(ns).ack;
|
|
2751
|
+
if (committedAck >= pendingThroughSeq)
|
|
2752
|
+
this.consumePendingPull(ns, pendingThroughSeq);
|
|
2753
|
+
else if (committedAck <= state.ack)
|
|
2754
|
+
this.markPendingPullNoProgress(ns, committedAck);
|
|
2755
|
+
}
|
|
2655
2756
|
}
|
|
2656
2757
|
const finalState = this.syncState(ns);
|
|
2657
2758
|
if (tailCompleted && finalState.ack < finalState.tail - 1) {
|
|
@@ -2706,16 +2807,24 @@ export class MessageDeliveryEngine {
|
|
|
2706
2807
|
// 期间新到达的序号;绝不重新规划或再执行 Tail。
|
|
2707
2808
|
const tailMissedDuringPull = tailCompleted
|
|
2708
2809
|
&& Number(client._seqTracker.getMaxSeenSeq(ns) || 0) > state.head;
|
|
2810
|
+
const maxSeen = Number(client._seqTracker.getMaxSeenSeq(ns) || 0);
|
|
2709
2811
|
const pendingThroughSeq = tailMissedDuringPull
|
|
2710
|
-
?
|
|
2812
|
+
? maxSeen
|
|
2711
2813
|
: 0;
|
|
2712
2814
|
const tailForward = tailCompleted && (state.ack < state.tail - 1 || tailMissedDuringPull);
|
|
2713
2815
|
const backgroundWindowForward = order[0] === 'forward' && !headForward;
|
|
2714
2816
|
if (headForward || tailForward
|
|
2715
2817
|
|| (client._sessionOptions?.background_sync !== false && backgroundWindowForward)) {
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2818
|
+
const forwardTarget = Math.max(headForward ? Math.max(pushSeq, maxSeen) : 0, (tailForward || backgroundWindowForward) ? state.tail - 1 : 0, tailMissedDuringPull ? maxSeen : 0);
|
|
2819
|
+
const forwardMaxPages = this.forwardMaxPages(state.ack, forwardTarget, pageLimit);
|
|
2820
|
+
result = await run(false, !(headForward || tailForward), forwardMaxPages, headForward || tailMissedDuringPull);
|
|
2821
|
+
if (pendingThroughSeq > 0) {
|
|
2822
|
+
const committedAck = this.syncState(ns).ack;
|
|
2823
|
+
if (committedAck >= pendingThroughSeq)
|
|
2824
|
+
this.consumePendingPull(ns, pendingThroughSeq);
|
|
2825
|
+
else if (committedAck <= state.ack)
|
|
2826
|
+
this.markPendingPullNoProgress(ns, committedAck);
|
|
2827
|
+
}
|
|
2719
2828
|
}
|
|
2720
2829
|
const finalState = this.syncState(ns);
|
|
2721
2830
|
if (tailCompleted && finalState.ack < finalState.tail - 1) {
|
|
@@ -3339,6 +3448,7 @@ export class MessageDeliveryEngine {
|
|
|
3339
3448
|
}
|
|
3340
3449
|
async drainOrderedMessages(ns, beforeSeq, pullResponse = false, persist = true) {
|
|
3341
3450
|
const client = this.runtime.client;
|
|
3451
|
+
this.ensurePullOperationCurrent();
|
|
3342
3452
|
const queue = client._pendingOrderedMsgs.get(ns);
|
|
3343
3453
|
if (!queue || queue.size === 0)
|
|
3344
3454
|
return;
|
|
@@ -3348,18 +3458,22 @@ export class MessageDeliveryEngine {
|
|
|
3348
3458
|
.sort((a, b) => a - b);
|
|
3349
3459
|
let delivered = false;
|
|
3350
3460
|
for (const seq of ready) {
|
|
3461
|
+
this.ensurePullOperationCurrent();
|
|
3351
3462
|
const item = queue.get(seq);
|
|
3352
3463
|
queue.delete(seq);
|
|
3353
3464
|
if (!item || client._pushedSeqs.get(ns)?.has(seq))
|
|
3354
3465
|
continue;
|
|
3355
3466
|
await this.publishOrderedQueueItem(ns, item.event, seq, item.payload, pullResponse);
|
|
3467
|
+
this.ensurePullOperationCurrent();
|
|
3356
3468
|
this.markPublishedSeq(ns, seq);
|
|
3357
3469
|
delivered = true;
|
|
3358
3470
|
}
|
|
3359
3471
|
if (queue.size === 0) {
|
|
3360
3472
|
client._pendingOrderedMsgs.delete(ns);
|
|
3361
|
-
if (delivered && persist)
|
|
3473
|
+
if (delivered && persist) {
|
|
3474
|
+
this.ensurePullOperationCurrent();
|
|
3362
3475
|
await this.saveSeqTrackerState();
|
|
3476
|
+
}
|
|
3363
3477
|
}
|
|
3364
3478
|
}
|
|
3365
3479
|
async publishOrderedMessage(event, ns, seq, payload) {
|
|
@@ -3397,12 +3511,16 @@ export class MessageDeliveryEngine {
|
|
|
3397
3511
|
}
|
|
3398
3512
|
async publishPulledMessage(event, ns, seq, payload, persist = true) {
|
|
3399
3513
|
const client = this.runtime.client;
|
|
3514
|
+
this.ensurePullOperationCurrent();
|
|
3400
3515
|
const seqNum = Number(seq);
|
|
3401
3516
|
if (!Number.isFinite(seqNum) || !Number.isInteger(seqNum) || seqNum <= 0 || !ns) {
|
|
3402
3517
|
if (event === 'message.recalled') {
|
|
3403
|
-
|
|
3518
|
+
const published = await client._withPullResponseProcessing(ns, () => this.publishMessageRecallTombstone(seq, payload));
|
|
3519
|
+
this.ensurePullOperationCurrent();
|
|
3520
|
+
return published;
|
|
3404
3521
|
}
|
|
3405
3522
|
await client._withPullResponseProcessing(ns, () => client._publishAppEvent(event, payload));
|
|
3523
|
+
this.ensurePullOperationCurrent();
|
|
3406
3524
|
return true;
|
|
3407
3525
|
}
|
|
3408
3526
|
const queue = client._pendingOrderedMsgs.get(ns);
|
|
@@ -3413,15 +3531,18 @@ export class MessageDeliveryEngine {
|
|
|
3413
3531
|
return false;
|
|
3414
3532
|
}
|
|
3415
3533
|
await this.drainOrderedMessages(ns, seqNum, false, persist);
|
|
3534
|
+
this.ensurePullOperationCurrent();
|
|
3416
3535
|
queue?.delete(seqNum);
|
|
3417
3536
|
if (queue && queue.size === 0)
|
|
3418
3537
|
client._pendingOrderedMsgs.delete(ns);
|
|
3419
3538
|
if (event === 'message.recalled') {
|
|
3420
3539
|
const published = await client._withPullResponseProcessing(ns, () => this.publishMessageRecallTombstone(seqNum, payload));
|
|
3540
|
+
this.ensurePullOperationCurrent();
|
|
3421
3541
|
this.markPublishedSeq(ns, seqNum);
|
|
3422
3542
|
return published;
|
|
3423
3543
|
}
|
|
3424
3544
|
await client._withPullResponseProcessing(ns, () => client._publishAppEvent(event, payload));
|
|
3545
|
+
this.ensurePullOperationCurrent();
|
|
3425
3546
|
this.markPublishedSeq(ns, seqNum);
|
|
3426
3547
|
return true;
|
|
3427
3548
|
}
|