@fluidframework/legacy-dds 2.70.0-361092 → 2.70.0-361788

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.
@@ -12,11 +12,13 @@ import type {
12
12
  IChannelFactory,
13
13
  } from "@fluidframework/datastore-definitions/internal";
14
14
  import { FileMode, MessageType, TreeEntry } from "@fluidframework/driver-definitions/internal";
15
+ import type { ITree } from "@fluidframework/driver-definitions/internal";
15
16
  import type {
16
- ISequencedDocumentMessage,
17
- ITree,
18
- } from "@fluidframework/driver-definitions/internal";
19
- import type { ISummaryTreeWithStats } from "@fluidframework/runtime-definitions/internal";
17
+ ISummaryTreeWithStats,
18
+ IRuntimeMessageCollection,
19
+ IRuntimeMessagesContent,
20
+ ISequencedMessageEnvelope,
21
+ } from "@fluidframework/runtime-definitions/internal";
20
22
  import { convertToSummaryTreeWithStats } from "@fluidframework/runtime-utils/internal";
21
23
  import type { IFluidSerializer } from "@fluidframework/shared-object-base/internal";
22
24
  import { SharedObject } from "@fluidframework/shared-object-base/internal";
@@ -119,7 +121,7 @@ export class SharedSignalClass<T extends SerializableTypeForSharedSignal = any>
119
121
  * Load share signal from snapshot
120
122
  *
121
123
  * @param _storage - the storage to get the snapshot from
122
- * @returns - promise that resolved when the load is completed
124
+ * @returns promise that resolved when the load is completed
123
125
  */
124
126
  protected async loadCore(_storage: IChannelStorageService): Promise<void> {}
125
127
 
@@ -131,20 +133,22 @@ export class SharedSignalClass<T extends SerializableTypeForSharedSignal = any>
131
133
  protected onDisconnect(): void {}
132
134
 
133
135
  /**
134
- * Process a shared signal operation
135
- *
136
- * @param message - the message to prepare
137
- * @param local - whether the message was sent by the local client
138
- * @param _localOpMetadata - For local client messages, this is the metadata that was submitted with the message.
139
- * For messages from a remote client, this will be undefined.
136
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.processMessagesCore}
140
137
  */
141
- protected processCore(
142
- message: ISequencedDocumentMessage,
138
+ protected processMessagesCore(messagesCollection: IRuntimeMessageCollection): void {
139
+ const { envelope, local, messagesContent } = messagesCollection;
140
+ for (const messageContent of messagesContent) {
141
+ this.processMessage(envelope, messageContent, local);
142
+ }
143
+ }
144
+
145
+ private processMessage(
146
+ messageEnvelope: ISequencedMessageEnvelope,
147
+ messageContent: IRuntimeMessagesContent,
143
148
  local: boolean,
144
- _localOpMetadata: unknown,
145
149
  ): void {
146
- if ((message.type as MessageType) === MessageType.Operation && !local) {
147
- const op = message.contents as ISignalOperation<T>;
150
+ if ((messageEnvelope.type as MessageType) === MessageType.Operation && !local) {
151
+ const op = messageContent.contents as ISignalOperation<T>;
148
152
 
149
153
  switch (op.type) {
150
154
  case "signal": {
@@ -158,7 +162,6 @@ export class SharedSignalClass<T extends SerializableTypeForSharedSignal = any>
158
162
  }
159
163
  }
160
164
  }
161
-
162
165
  private notifyCore(op: ISignalOperation<T>, isLocal: boolean): void {
163
166
  this.emit("notify", op.metadata, isLocal);
164
167
  }