@fluid-experimental/last-edited 1.3.0 → 2.0.0-dev.1.4.5.105745

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.
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluid-experimental/last-edited";
8
- export declare const pkgVersion = "1.3.0";
8
+ export declare const pkgVersion = "2.0.0-dev.1.4.5.105745";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,oCAAoC,CAAC;AACzD,eAAO,MAAM,UAAU,UAAU,CAAC"}
1
+ {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,oCAAoC,CAAC;AACzD,eAAO,MAAM,UAAU,2BAA2B,CAAC"}
@@ -8,5 +8,5 @@
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.pkgVersion = exports.pkgName = void 0;
10
10
  exports.pkgName = "@fluid-experimental/last-edited";
11
- exports.pkgVersion = "1.3.0";
11
+ exports.pkgVersion = "2.0.0-dev.1.4.5.105745";
12
12
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,iCAAiC,CAAC;AAC5C,QAAA,UAAU,GAAG,OAAO,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluid-experimental/last-edited\";\nexport const pkgVersion = \"1.3.0\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,iCAAiC,CAAC;AAC5C,QAAA,UAAU,GAAG,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluid-experimental/last-edited\";\nexport const pkgVersion = \"2.0.0-dev.1.4.5.105745\";\n"]}
package/dist/setup.d.ts CHANGED
@@ -7,12 +7,15 @@ import { IContainerRuntime } from "@fluidframework/container-runtime-definitions
7
7
  import { IFluidLastEditedTracker } from "./interfaces";
8
8
  /**
9
9
  * Helper function to set up a data object that provides IFluidLastEditedTracker to track last edited in a Container.
10
+ *
10
11
  * It does the following:
12
+ *
11
13
  * - Registers an "op" listener on the runtime. On each message, it calls the shouldDiscardMessageFn to check
12
- * if the message should be discarded. It also discards all scheduler message. If a message is not discarded,
13
- * it passes the last edited information from the message to the last edited tracker.
14
+ * if the message should be discarded. It also discards all scheduler message. If a message is not discarded,
15
+ * it passes the last edited information from the message to the last edited tracker.
16
+ *
14
17
  * - The last edited information from the last message received before the lastEditedTracker is
15
- * loaded is stored and passed to the tracker once it loads.
18
+ * loaded is stored and passed to the tracker once it loads.
16
19
  * @param lastEditedTracker - The last edited tracker.
17
20
  * @param runtime - The container runtime whose messages are to be tracked.
18
21
  * @param shouldDiscardMessageFn - Function that tells if a message should not be considered in computing last edited.
@@ -1 +1 @@
1
- {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,yBAAyB,EAAkB,MAAM,sCAAsC,CAAC;AAEjG,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAAoB,uBAAuB,EAAE,MAAM,cAAc,CAAC;AA2BzE;;;;;;;;;;;GAWG;AACH,wBAAgB,kCAAkC,CAC9C,iBAAiB,EAAE,uBAAuB,EAC1C,OAAO,EAAE,iBAAiB,EAC1B,sBAAsB,GAAE,CAAC,OAAO,EAAE,yBAAyB,KAAK,OAAqC,QAmBxG"}
1
+ {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,yBAAyB,EAAkB,MAAM,sCAAsC,CAAC;AAEjG,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAAoB,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAkCzE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kCAAkC,CAC9C,iBAAiB,EAAE,uBAAuB,EAC1C,OAAO,EAAE,iBAAiB,EAC1B,sBAAsB,GAAE,CAAC,OAAO,EAAE,yBAAyB,KAAK,OAAqC,QAmBxG"}
package/dist/setup.js CHANGED
@@ -6,13 +6,20 @@
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.setupLastEditedTrackerForContainer = void 0;
8
8
  const container_runtime_1 = require("@fluidframework/container-runtime");
9
- // Default implementation of the shouldDiscardMessageFn function below that tells that all messages other
10
- // than "Alias", "Attach" and "Operation" type messages should be discarded.
9
+ /**
10
+ * Default implementation of {@link setupLastEditedTrackerForContainer}'s `shouldDiscardMessageFn` parameter,
11
+ * which tells that all messages other than {@link @fluidframework/container-runtime#ContainerMessageType.Alias},
12
+ * {@link @fluidframework/container-runtime#ContainerMessageType.Attach}, and
13
+ * {@link @fluidframework/container-runtime#ContainerMessageType.FluidDataStoreOp} type messages should be
14
+ * discarded.
15
+ */
11
16
  const shouldDiscardMessageDefault = (message) => message.type !== container_runtime_1.ContainerMessageType.Attach &&
12
17
  message.type !== container_runtime_1.ContainerMessageType.FluidDataStoreOp &&
13
18
  message.type !== container_runtime_1.ContainerMessageType.Alias;
14
- // Extracts the user information and timestamp from a message. Returns undefined if the user information for the
15
- // client who sent the message doesn't exist in the quorum.
19
+ /**
20
+ * Extracts the user information and timestamp from a message. Returns undefined if the user information for the
21
+ * client who sent the message doesn't exist in the quorum.
22
+ */
16
23
  function getLastEditDetailsFromMessage(message, quorum) {
17
24
  const sequencedClient = quorum.getMember(message.clientId);
18
25
  const user = sequencedClient === null || sequencedClient === void 0 ? void 0 : sequencedClient.client.user;
@@ -27,12 +34,15 @@ function getLastEditDetailsFromMessage(message, quorum) {
27
34
  }
28
35
  /**
29
36
  * Helper function to set up a data object that provides IFluidLastEditedTracker to track last edited in a Container.
37
+ *
30
38
  * It does the following:
39
+ *
31
40
  * - Registers an "op" listener on the runtime. On each message, it calls the shouldDiscardMessageFn to check
32
- * if the message should be discarded. It also discards all scheduler message. If a message is not discarded,
33
- * it passes the last edited information from the message to the last edited tracker.
41
+ * if the message should be discarded. It also discards all scheduler message. If a message is not discarded,
42
+ * it passes the last edited information from the message to the last edited tracker.
43
+ *
34
44
  * - The last edited information from the last message received before the lastEditedTracker is
35
- * loaded is stored and passed to the tracker once it loads.
45
+ * loaded is stored and passed to the tracker once it loads.
36
46
  * @param lastEditedTracker - The last edited tracker.
37
47
  * @param runtime - The container runtime whose messages are to be tracked.
38
48
  * @param shouldDiscardMessageFn - Function that tells if a message should not be considered in computing last edited.
@@ -41,9 +51,9 @@ function setupLastEditedTrackerForContainer(lastEditedTracker, runtime, shouldDi
41
51
  // Register an op listener on the runtime. If the lastEditedTracker has loaded,
42
52
  // it passes the last edited information to its
43
53
  // last edited tracker. If the lastEditedTracker hasn't loaded, store the last edited information temporarily.
44
- runtime.on("op", (message) => {
54
+ runtime.on("op", (message, runtimeMessage) => {
45
55
  // If this message should be discarded as per shouldDiscardMessageFn, return.
46
- if (shouldDiscardMessageFn(message)) {
56
+ if (runtimeMessage === false || shouldDiscardMessageFn(message)) {
47
57
  return;
48
58
  }
49
59
  // Get the last edited details from the message. If it doesn't exist, return.
package/dist/setup.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"setup.js","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,yEAAyE;AAIzE,yGAAyG;AACzG,4EAA4E;AAC5E,MAAM,2BAA2B,GAAG,CAAC,OAAkC,EAAE,EAAE,CACvE,OAAO,CAAC,IAAI,KAAK,wCAAoB,CAAC,MAAM;IAC5C,OAAO,CAAC,IAAI,KAAK,wCAAoB,CAAC,gBAAgB;IACtD,OAAO,CAAC,IAAI,KAAK,wCAAoB,CAAC,KAAK,CAAC;AAEhD,gHAAgH;AAChH,2DAA2D;AAC3D,SAAS,6BAA6B,CAClC,OAAkC,EAClC,MAAsB;IAEtB,MAAM,eAAe,GAAG,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC3D,MAAM,IAAI,GAAG,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,MAAM,CAAC,IAAI,CAAC;IAC1C,IAAI,IAAI,KAAK,SAAS,EAAE;QACpB,MAAM,eAAe,GAAqB;YACtC,IAAI;YACJ,SAAS,EAAE,OAAO,CAAC,SAAS;SAC/B,CAAC;QACF,OAAO,eAAe,CAAC;KAC1B;IACD,OAAO,SAAS,CAAC;AACrB,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAgB,kCAAkC,CAC9C,iBAA0C,EAC1C,OAA0B,EAC1B,yBAA0E,2BAA2B;IAErG,+EAA+E;IAC/E,+CAA+C;IAC/C,8GAA8G;IAC9G,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,OAAkC,EAAE,EAAE;QACpD,6EAA6E;QAC7E,IAAI,sBAAsB,CAAC,OAAO,CAAC,EAAE;YACjC,OAAO;SACV;QAED,6EAA6E;QAC7E,MAAM,eAAe,GAAG,6BAA6B,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;QACpF,IAAI,eAAe,KAAK,SAAS,EAAE;YAC/B,OAAO;SACV;QAED,iBAAiB,CAAC,qBAAqB,CAAC,eAAe,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;AACP,CAAC;AAtBD,gFAsBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISequencedDocumentMessage, IQuorumClients } from \"@fluidframework/protocol-definitions\";\nimport { ContainerMessageType } from \"@fluidframework/container-runtime\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport { ILastEditDetails, IFluidLastEditedTracker } from \"./interfaces\";\n\n// Default implementation of the shouldDiscardMessageFn function below that tells that all messages other\n// than \"Alias\", \"Attach\" and \"Operation\" type messages should be discarded.\nconst shouldDiscardMessageDefault = (message: ISequencedDocumentMessage) =>\n message.type !== ContainerMessageType.Attach &&\n message.type !== ContainerMessageType.FluidDataStoreOp &&\n message.type !== ContainerMessageType.Alias;\n\n// Extracts the user information and timestamp from a message. Returns undefined if the user information for the\n// client who sent the message doesn't exist in the quorum.\nfunction getLastEditDetailsFromMessage(\n message: ISequencedDocumentMessage,\n quorum: IQuorumClients,\n): ILastEditDetails | undefined {\n const sequencedClient = quorum.getMember(message.clientId);\n const user = sequencedClient?.client.user;\n if (user !== undefined) {\n const lastEditDetails: ILastEditDetails = {\n user,\n timestamp: message.timestamp,\n };\n return lastEditDetails;\n }\n return undefined;\n}\n\n/**\n * Helper function to set up a data object that provides IFluidLastEditedTracker to track last edited in a Container.\n * It does the following:\n * - Registers an \"op\" listener on the runtime. On each message, it calls the shouldDiscardMessageFn to check\n * if the message should be discarded. It also discards all scheduler message. If a message is not discarded,\n * it passes the last edited information from the message to the last edited tracker.\n * - The last edited information from the last message received before the lastEditedTracker is\n * loaded is stored and passed to the tracker once it loads.\n * @param lastEditedTracker - The last edited tracker.\n * @param runtime - The container runtime whose messages are to be tracked.\n * @param shouldDiscardMessageFn - Function that tells if a message should not be considered in computing last edited.\n */\nexport function setupLastEditedTrackerForContainer(\n lastEditedTracker: IFluidLastEditedTracker,\n runtime: IContainerRuntime,\n shouldDiscardMessageFn: (message: ISequencedDocumentMessage) => boolean = shouldDiscardMessageDefault,\n) {\n // Register an op listener on the runtime. If the lastEditedTracker has loaded,\n // it passes the last edited information to its\n // last edited tracker. If the lastEditedTracker hasn't loaded, store the last edited information temporarily.\n runtime.on(\"op\", (message: ISequencedDocumentMessage) => {\n // If this message should be discarded as per shouldDiscardMessageFn, return.\n if (shouldDiscardMessageFn(message)) {\n return;\n }\n\n // Get the last edited details from the message. If it doesn't exist, return.\n const lastEditDetails = getLastEditDetailsFromMessage(message, runtime.getQuorum());\n if (lastEditDetails === undefined) {\n return;\n }\n\n lastEditedTracker.updateLastEditDetails(lastEditDetails);\n });\n}\n"]}
1
+ {"version":3,"file":"setup.js","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,yEAAyE;AAIzE;;;;;;GAMG;AACH,MAAM,2BAA2B,GAAG,CAAC,OAAkC,EAAE,EAAE,CACvE,OAAO,CAAC,IAAI,KAAK,wCAAoB,CAAC,MAAM;IAC5C,OAAO,CAAC,IAAI,KAAK,wCAAoB,CAAC,gBAAgB;IACtD,OAAO,CAAC,IAAI,KAAK,wCAAoB,CAAC,KAAK,CAAC;AAEhD;;;GAGG;AACH,SAAS,6BAA6B,CAClC,OAAkC,EAClC,MAAsB;IAEtB,MAAM,eAAe,GAAG,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC3D,MAAM,IAAI,GAAG,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,MAAM,CAAC,IAAI,CAAC;IAC1C,IAAI,IAAI,KAAK,SAAS,EAAE;QACpB,MAAM,eAAe,GAAqB;YACtC,IAAI;YACJ,SAAS,EAAE,OAAO,CAAC,SAAS;SAC/B,CAAC;QACF,OAAO,eAAe,CAAC;KAC1B;IACD,OAAO,SAAS,CAAC;AACrB,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,SAAgB,kCAAkC,CAC9C,iBAA0C,EAC1C,OAA0B,EAC1B,yBAA0E,2BAA2B;IAErG,+EAA+E;IAC/E,+CAA+C;IAC/C,8GAA8G;IAC9G,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,OAAkC,EAAE,cAAwB,EAAE,EAAE;QAC9E,6EAA6E;QAC7E,IAAI,cAAc,KAAK,KAAK,IAAI,sBAAsB,CAAC,OAAO,CAAC,EAAE;YAC7D,OAAO;SACV;QAED,6EAA6E;QAC7E,MAAM,eAAe,GAAG,6BAA6B,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;QACpF,IAAI,eAAe,KAAK,SAAS,EAAE;YAC/B,OAAO;SACV;QAED,iBAAiB,CAAC,qBAAqB,CAAC,eAAe,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;AACP,CAAC;AAtBD,gFAsBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISequencedDocumentMessage, IQuorumClients } from \"@fluidframework/protocol-definitions\";\nimport { ContainerMessageType } from \"@fluidframework/container-runtime\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport { ILastEditDetails, IFluidLastEditedTracker } from \"./interfaces\";\n\n/**\n * Default implementation of {@link setupLastEditedTrackerForContainer}'s `shouldDiscardMessageFn` parameter,\n * which tells that all messages other than {@link @fluidframework/container-runtime#ContainerMessageType.Alias},\n * {@link @fluidframework/container-runtime#ContainerMessageType.Attach}, and\n * {@link @fluidframework/container-runtime#ContainerMessageType.FluidDataStoreOp} type messages should be\n * discarded.\n */\nconst shouldDiscardMessageDefault = (message: ISequencedDocumentMessage) =>\n message.type !== ContainerMessageType.Attach &&\n message.type !== ContainerMessageType.FluidDataStoreOp &&\n message.type !== ContainerMessageType.Alias;\n\n/**\n * Extracts the user information and timestamp from a message. Returns undefined if the user information for the\n * client who sent the message doesn't exist in the quorum.\n */\nfunction getLastEditDetailsFromMessage(\n message: ISequencedDocumentMessage,\n quorum: IQuorumClients,\n): ILastEditDetails | undefined {\n const sequencedClient = quorum.getMember(message.clientId);\n const user = sequencedClient?.client.user;\n if (user !== undefined) {\n const lastEditDetails: ILastEditDetails = {\n user,\n timestamp: message.timestamp,\n };\n return lastEditDetails;\n }\n return undefined;\n}\n\n/**\n * Helper function to set up a data object that provides IFluidLastEditedTracker to track last edited in a Container.\n *\n * It does the following:\n *\n * - Registers an \"op\" listener on the runtime. On each message, it calls the shouldDiscardMessageFn to check\n * if the message should be discarded. It also discards all scheduler message. If a message is not discarded,\n * it passes the last edited information from the message to the last edited tracker.\n *\n * - The last edited information from the last message received before the lastEditedTracker is\n * loaded is stored and passed to the tracker once it loads.\n * @param lastEditedTracker - The last edited tracker.\n * @param runtime - The container runtime whose messages are to be tracked.\n * @param shouldDiscardMessageFn - Function that tells if a message should not be considered in computing last edited.\n */\nexport function setupLastEditedTrackerForContainer(\n lastEditedTracker: IFluidLastEditedTracker,\n runtime: IContainerRuntime,\n shouldDiscardMessageFn: (message: ISequencedDocumentMessage) => boolean = shouldDiscardMessageDefault,\n) {\n // Register an op listener on the runtime. If the lastEditedTracker has loaded,\n // it passes the last edited information to its\n // last edited tracker. If the lastEditedTracker hasn't loaded, store the last edited information temporarily.\n runtime.on(\"op\", (message: ISequencedDocumentMessage, runtimeMessage?: boolean) => {\n // If this message should be discarded as per shouldDiscardMessageFn, return.\n if (runtimeMessage === false || shouldDiscardMessageFn(message)) {\n return;\n }\n\n // Get the last edited details from the message. If it doesn't exist, return.\n const lastEditDetails = getLastEditDetailsFromMessage(message, runtime.getQuorum());\n if (lastEditDetails === undefined) {\n return;\n }\n\n lastEditedTracker.updateLastEditDetails(lastEditDetails);\n });\n}\n"]}
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluid-experimental/last-edited";
8
- export declare const pkgVersion = "1.3.0";
8
+ export declare const pkgVersion = "2.0.0-dev.1.4.5.105745";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,oCAAoC,CAAC;AACzD,eAAO,MAAM,UAAU,UAAU,CAAC"}
1
+ {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,oCAAoC,CAAC;AACzD,eAAO,MAAM,UAAU,2BAA2B,CAAC"}
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export const pkgName = "@fluid-experimental/last-edited";
8
- export const pkgVersion = "1.3.0";
8
+ export const pkgVersion = "2.0.0-dev.1.4.5.105745";
9
9
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,iCAAiC,CAAC;AACzD,MAAM,CAAC,MAAM,UAAU,GAAG,OAAO,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluid-experimental/last-edited\";\nexport const pkgVersion = \"1.3.0\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,iCAAiC,CAAC;AACzD,MAAM,CAAC,MAAM,UAAU,GAAG,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluid-experimental/last-edited\";\nexport const pkgVersion = \"2.0.0-dev.1.4.5.105745\";\n"]}
package/lib/setup.d.ts CHANGED
@@ -7,12 +7,15 @@ import { IContainerRuntime } from "@fluidframework/container-runtime-definitions
7
7
  import { IFluidLastEditedTracker } from "./interfaces";
8
8
  /**
9
9
  * Helper function to set up a data object that provides IFluidLastEditedTracker to track last edited in a Container.
10
+ *
10
11
  * It does the following:
12
+ *
11
13
  * - Registers an "op" listener on the runtime. On each message, it calls the shouldDiscardMessageFn to check
12
- * if the message should be discarded. It also discards all scheduler message. If a message is not discarded,
13
- * it passes the last edited information from the message to the last edited tracker.
14
+ * if the message should be discarded. It also discards all scheduler message. If a message is not discarded,
15
+ * it passes the last edited information from the message to the last edited tracker.
16
+ *
14
17
  * - The last edited information from the last message received before the lastEditedTracker is
15
- * loaded is stored and passed to the tracker once it loads.
18
+ * loaded is stored and passed to the tracker once it loads.
16
19
  * @param lastEditedTracker - The last edited tracker.
17
20
  * @param runtime - The container runtime whose messages are to be tracked.
18
21
  * @param shouldDiscardMessageFn - Function that tells if a message should not be considered in computing last edited.
@@ -1 +1 @@
1
- {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,yBAAyB,EAAkB,MAAM,sCAAsC,CAAC;AAEjG,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAAoB,uBAAuB,EAAE,MAAM,cAAc,CAAC;AA2BzE;;;;;;;;;;;GAWG;AACH,wBAAgB,kCAAkC,CAC9C,iBAAiB,EAAE,uBAAuB,EAC1C,OAAO,EAAE,iBAAiB,EAC1B,sBAAsB,GAAE,CAAC,OAAO,EAAE,yBAAyB,KAAK,OAAqC,QAmBxG"}
1
+ {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,yBAAyB,EAAkB,MAAM,sCAAsC,CAAC;AAEjG,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAAoB,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAkCzE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kCAAkC,CAC9C,iBAAiB,EAAE,uBAAuB,EAC1C,OAAO,EAAE,iBAAiB,EAC1B,sBAAsB,GAAE,CAAC,OAAO,EAAE,yBAAyB,KAAK,OAAqC,QAmBxG"}
package/lib/setup.js CHANGED
@@ -3,13 +3,20 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { ContainerMessageType } from "@fluidframework/container-runtime";
6
- // Default implementation of the shouldDiscardMessageFn function below that tells that all messages other
7
- // than "Alias", "Attach" and "Operation" type messages should be discarded.
6
+ /**
7
+ * Default implementation of {@link setupLastEditedTrackerForContainer}'s `shouldDiscardMessageFn` parameter,
8
+ * which tells that all messages other than {@link @fluidframework/container-runtime#ContainerMessageType.Alias},
9
+ * {@link @fluidframework/container-runtime#ContainerMessageType.Attach}, and
10
+ * {@link @fluidframework/container-runtime#ContainerMessageType.FluidDataStoreOp} type messages should be
11
+ * discarded.
12
+ */
8
13
  const shouldDiscardMessageDefault = (message) => message.type !== ContainerMessageType.Attach &&
9
14
  message.type !== ContainerMessageType.FluidDataStoreOp &&
10
15
  message.type !== ContainerMessageType.Alias;
11
- // Extracts the user information and timestamp from a message. Returns undefined if the user information for the
12
- // client who sent the message doesn't exist in the quorum.
16
+ /**
17
+ * Extracts the user information and timestamp from a message. Returns undefined if the user information for the
18
+ * client who sent the message doesn't exist in the quorum.
19
+ */
13
20
  function getLastEditDetailsFromMessage(message, quorum) {
14
21
  const sequencedClient = quorum.getMember(message.clientId);
15
22
  const user = sequencedClient === null || sequencedClient === void 0 ? void 0 : sequencedClient.client.user;
@@ -24,12 +31,15 @@ function getLastEditDetailsFromMessage(message, quorum) {
24
31
  }
25
32
  /**
26
33
  * Helper function to set up a data object that provides IFluidLastEditedTracker to track last edited in a Container.
34
+ *
27
35
  * It does the following:
36
+ *
28
37
  * - Registers an "op" listener on the runtime. On each message, it calls the shouldDiscardMessageFn to check
29
- * if the message should be discarded. It also discards all scheduler message. If a message is not discarded,
30
- * it passes the last edited information from the message to the last edited tracker.
38
+ * if the message should be discarded. It also discards all scheduler message. If a message is not discarded,
39
+ * it passes the last edited information from the message to the last edited tracker.
40
+ *
31
41
  * - The last edited information from the last message received before the lastEditedTracker is
32
- * loaded is stored and passed to the tracker once it loads.
42
+ * loaded is stored and passed to the tracker once it loads.
33
43
  * @param lastEditedTracker - The last edited tracker.
34
44
  * @param runtime - The container runtime whose messages are to be tracked.
35
45
  * @param shouldDiscardMessageFn - Function that tells if a message should not be considered in computing last edited.
@@ -38,9 +48,9 @@ export function setupLastEditedTrackerForContainer(lastEditedTracker, runtime, s
38
48
  // Register an op listener on the runtime. If the lastEditedTracker has loaded,
39
49
  // it passes the last edited information to its
40
50
  // last edited tracker. If the lastEditedTracker hasn't loaded, store the last edited information temporarily.
41
- runtime.on("op", (message) => {
51
+ runtime.on("op", (message, runtimeMessage) => {
42
52
  // If this message should be discarded as per shouldDiscardMessageFn, return.
43
- if (shouldDiscardMessageFn(message)) {
53
+ if (runtimeMessage === false || shouldDiscardMessageFn(message)) {
44
54
  return;
45
55
  }
46
56
  // Get the last edited details from the message. If it doesn't exist, return.
package/lib/setup.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"setup.js","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAIzE,yGAAyG;AACzG,4EAA4E;AAC5E,MAAM,2BAA2B,GAAG,CAAC,OAAkC,EAAE,EAAE,CACvE,OAAO,CAAC,IAAI,KAAK,oBAAoB,CAAC,MAAM;IAC5C,OAAO,CAAC,IAAI,KAAK,oBAAoB,CAAC,gBAAgB;IACtD,OAAO,CAAC,IAAI,KAAK,oBAAoB,CAAC,KAAK,CAAC;AAEhD,gHAAgH;AAChH,2DAA2D;AAC3D,SAAS,6BAA6B,CAClC,OAAkC,EAClC,MAAsB;IAEtB,MAAM,eAAe,GAAG,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC3D,MAAM,IAAI,GAAG,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,MAAM,CAAC,IAAI,CAAC;IAC1C,IAAI,IAAI,KAAK,SAAS,EAAE;QACpB,MAAM,eAAe,GAAqB;YACtC,IAAI;YACJ,SAAS,EAAE,OAAO,CAAC,SAAS;SAC/B,CAAC;QACF,OAAO,eAAe,CAAC;KAC1B;IACD,OAAO,SAAS,CAAC;AACrB,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,kCAAkC,CAC9C,iBAA0C,EAC1C,OAA0B,EAC1B,yBAA0E,2BAA2B;IAErG,+EAA+E;IAC/E,+CAA+C;IAC/C,8GAA8G;IAC9G,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,OAAkC,EAAE,EAAE;QACpD,6EAA6E;QAC7E,IAAI,sBAAsB,CAAC,OAAO,CAAC,EAAE;YACjC,OAAO;SACV;QAED,6EAA6E;QAC7E,MAAM,eAAe,GAAG,6BAA6B,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;QACpF,IAAI,eAAe,KAAK,SAAS,EAAE;YAC/B,OAAO;SACV;QAED,iBAAiB,CAAC,qBAAqB,CAAC,eAAe,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISequencedDocumentMessage, IQuorumClients } from \"@fluidframework/protocol-definitions\";\nimport { ContainerMessageType } from \"@fluidframework/container-runtime\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport { ILastEditDetails, IFluidLastEditedTracker } from \"./interfaces\";\n\n// Default implementation of the shouldDiscardMessageFn function below that tells that all messages other\n// than \"Alias\", \"Attach\" and \"Operation\" type messages should be discarded.\nconst shouldDiscardMessageDefault = (message: ISequencedDocumentMessage) =>\n message.type !== ContainerMessageType.Attach &&\n message.type !== ContainerMessageType.FluidDataStoreOp &&\n message.type !== ContainerMessageType.Alias;\n\n// Extracts the user information and timestamp from a message. Returns undefined if the user information for the\n// client who sent the message doesn't exist in the quorum.\nfunction getLastEditDetailsFromMessage(\n message: ISequencedDocumentMessage,\n quorum: IQuorumClients,\n): ILastEditDetails | undefined {\n const sequencedClient = quorum.getMember(message.clientId);\n const user = sequencedClient?.client.user;\n if (user !== undefined) {\n const lastEditDetails: ILastEditDetails = {\n user,\n timestamp: message.timestamp,\n };\n return lastEditDetails;\n }\n return undefined;\n}\n\n/**\n * Helper function to set up a data object that provides IFluidLastEditedTracker to track last edited in a Container.\n * It does the following:\n * - Registers an \"op\" listener on the runtime. On each message, it calls the shouldDiscardMessageFn to check\n * if the message should be discarded. It also discards all scheduler message. If a message is not discarded,\n * it passes the last edited information from the message to the last edited tracker.\n * - The last edited information from the last message received before the lastEditedTracker is\n * loaded is stored and passed to the tracker once it loads.\n * @param lastEditedTracker - The last edited tracker.\n * @param runtime - The container runtime whose messages are to be tracked.\n * @param shouldDiscardMessageFn - Function that tells if a message should not be considered in computing last edited.\n */\nexport function setupLastEditedTrackerForContainer(\n lastEditedTracker: IFluidLastEditedTracker,\n runtime: IContainerRuntime,\n shouldDiscardMessageFn: (message: ISequencedDocumentMessage) => boolean = shouldDiscardMessageDefault,\n) {\n // Register an op listener on the runtime. If the lastEditedTracker has loaded,\n // it passes the last edited information to its\n // last edited tracker. If the lastEditedTracker hasn't loaded, store the last edited information temporarily.\n runtime.on(\"op\", (message: ISequencedDocumentMessage) => {\n // If this message should be discarded as per shouldDiscardMessageFn, return.\n if (shouldDiscardMessageFn(message)) {\n return;\n }\n\n // Get the last edited details from the message. If it doesn't exist, return.\n const lastEditDetails = getLastEditDetailsFromMessage(message, runtime.getQuorum());\n if (lastEditDetails === undefined) {\n return;\n }\n\n lastEditedTracker.updateLastEditDetails(lastEditDetails);\n });\n}\n"]}
1
+ {"version":3,"file":"setup.js","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAIzE;;;;;;GAMG;AACH,MAAM,2BAA2B,GAAG,CAAC,OAAkC,EAAE,EAAE,CACvE,OAAO,CAAC,IAAI,KAAK,oBAAoB,CAAC,MAAM;IAC5C,OAAO,CAAC,IAAI,KAAK,oBAAoB,CAAC,gBAAgB;IACtD,OAAO,CAAC,IAAI,KAAK,oBAAoB,CAAC,KAAK,CAAC;AAEhD;;;GAGG;AACH,SAAS,6BAA6B,CAClC,OAAkC,EAClC,MAAsB;IAEtB,MAAM,eAAe,GAAG,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC3D,MAAM,IAAI,GAAG,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,MAAM,CAAC,IAAI,CAAC;IAC1C,IAAI,IAAI,KAAK,SAAS,EAAE;QACpB,MAAM,eAAe,GAAqB;YACtC,IAAI;YACJ,SAAS,EAAE,OAAO,CAAC,SAAS;SAC/B,CAAC;QACF,OAAO,eAAe,CAAC;KAC1B;IACD,OAAO,SAAS,CAAC;AACrB,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,kCAAkC,CAC9C,iBAA0C,EAC1C,OAA0B,EAC1B,yBAA0E,2BAA2B;IAErG,+EAA+E;IAC/E,+CAA+C;IAC/C,8GAA8G;IAC9G,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,OAAkC,EAAE,cAAwB,EAAE,EAAE;QAC9E,6EAA6E;QAC7E,IAAI,cAAc,KAAK,KAAK,IAAI,sBAAsB,CAAC,OAAO,CAAC,EAAE;YAC7D,OAAO;SACV;QAED,6EAA6E;QAC7E,MAAM,eAAe,GAAG,6BAA6B,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;QACpF,IAAI,eAAe,KAAK,SAAS,EAAE;YAC/B,OAAO;SACV;QAED,iBAAiB,CAAC,qBAAqB,CAAC,eAAe,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISequencedDocumentMessage, IQuorumClients } from \"@fluidframework/protocol-definitions\";\nimport { ContainerMessageType } from \"@fluidframework/container-runtime\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport { ILastEditDetails, IFluidLastEditedTracker } from \"./interfaces\";\n\n/**\n * Default implementation of {@link setupLastEditedTrackerForContainer}'s `shouldDiscardMessageFn` parameter,\n * which tells that all messages other than {@link @fluidframework/container-runtime#ContainerMessageType.Alias},\n * {@link @fluidframework/container-runtime#ContainerMessageType.Attach}, and\n * {@link @fluidframework/container-runtime#ContainerMessageType.FluidDataStoreOp} type messages should be\n * discarded.\n */\nconst shouldDiscardMessageDefault = (message: ISequencedDocumentMessage) =>\n message.type !== ContainerMessageType.Attach &&\n message.type !== ContainerMessageType.FluidDataStoreOp &&\n message.type !== ContainerMessageType.Alias;\n\n/**\n * Extracts the user information and timestamp from a message. Returns undefined if the user information for the\n * client who sent the message doesn't exist in the quorum.\n */\nfunction getLastEditDetailsFromMessage(\n message: ISequencedDocumentMessage,\n quorum: IQuorumClients,\n): ILastEditDetails | undefined {\n const sequencedClient = quorum.getMember(message.clientId);\n const user = sequencedClient?.client.user;\n if (user !== undefined) {\n const lastEditDetails: ILastEditDetails = {\n user,\n timestamp: message.timestamp,\n };\n return lastEditDetails;\n }\n return undefined;\n}\n\n/**\n * Helper function to set up a data object that provides IFluidLastEditedTracker to track last edited in a Container.\n *\n * It does the following:\n *\n * - Registers an \"op\" listener on the runtime. On each message, it calls the shouldDiscardMessageFn to check\n * if the message should be discarded. It also discards all scheduler message. If a message is not discarded,\n * it passes the last edited information from the message to the last edited tracker.\n *\n * - The last edited information from the last message received before the lastEditedTracker is\n * loaded is stored and passed to the tracker once it loads.\n * @param lastEditedTracker - The last edited tracker.\n * @param runtime - The container runtime whose messages are to be tracked.\n * @param shouldDiscardMessageFn - Function that tells if a message should not be considered in computing last edited.\n */\nexport function setupLastEditedTrackerForContainer(\n lastEditedTracker: IFluidLastEditedTracker,\n runtime: IContainerRuntime,\n shouldDiscardMessageFn: (message: ISequencedDocumentMessage) => boolean = shouldDiscardMessageDefault,\n) {\n // Register an op listener on the runtime. If the lastEditedTracker has loaded,\n // it passes the last edited information to its\n // last edited tracker. If the lastEditedTracker hasn't loaded, store the last edited information temporarily.\n runtime.on(\"op\", (message: ISequencedDocumentMessage, runtimeMessage?: boolean) => {\n // If this message should be discarded as per shouldDiscardMessageFn, return.\n if (runtimeMessage === false || shouldDiscardMessageFn(message)) {\n return;\n }\n\n // Get the last edited details from the message. If it doesn't exist, return.\n const lastEditDetails = getLastEditDetailsFromMessage(message, runtime.getQuorum());\n if (lastEditDetails === undefined) {\n return;\n }\n\n lastEditedTracker.updateLastEditDetails(lastEditDetails);\n });\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-experimental/last-edited",
3
- "version": "1.3.0",
3
+ "version": "2.0.0-dev.1.4.5.105745",
4
4
  "description": "Tracks the last edited information in the Container.",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -54,25 +54,25 @@
54
54
  "temp-directory": "nyc/.nyc_output"
55
55
  },
56
56
  "dependencies": {
57
- "@fluidframework/aqueduct": "^1.3.0",
57
+ "@fluidframework/aqueduct": "2.0.0-dev.1.4.5.105745",
58
58
  "@fluidframework/common-definitions": "^0.20.1",
59
- "@fluidframework/container-runtime": "^1.3.0",
60
- "@fluidframework/container-runtime-definitions": "^1.3.0",
61
- "@fluidframework/core-interfaces": "^1.3.0",
62
- "@fluidframework/protocol-definitions": "^0.1028.2000",
63
- "@fluidframework/runtime-utils": "^1.3.0",
64
- "@fluidframework/shared-summary-block": "^1.3.0"
59
+ "@fluidframework/container-runtime": "2.0.0-dev.1.4.5.105745",
60
+ "@fluidframework/container-runtime-definitions": "2.0.0-dev.1.4.5.105745",
61
+ "@fluidframework/core-interfaces": "2.0.0-dev.1.4.5.105745",
62
+ "@fluidframework/protocol-definitions": "^1.0.0",
63
+ "@fluidframework/runtime-utils": "2.0.0-dev.1.4.5.105745",
64
+ "@fluidframework/shared-summary-block": "2.0.0-dev.1.4.5.105745"
65
65
  },
66
66
  "devDependencies": {
67
- "@fluidframework/build-common": "^0.24.0",
68
- "@fluidframework/eslint-config-fluid": "^0.28.2000",
69
- "@fluidframework/mocha-test-setup": "^1.3.0",
67
+ "@fluidframework/build-common": "^1.0.0",
68
+ "@fluidframework/eslint-config-fluid": "^1.0.0",
69
+ "@fluidframework/mocha-test-setup": "2.0.0-dev.1.4.5.105745",
70
70
  "@microsoft/api-extractor": "^7.22.2",
71
71
  "@rushstack/eslint-config": "^2.5.1",
72
72
  "@types/mocha": "^9.1.1",
73
73
  "@types/node": "^14.18.0",
74
74
  "concurrently": "^6.2.0",
75
- "copyfiles": "^2.1.0",
75
+ "copyfiles": "^2.4.1",
76
76
  "eslint": "~8.6.0",
77
77
  "mocha": "^10.0.0",
78
78
  "nyc": "^15.0.0",
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluid-experimental/last-edited";
9
- export const pkgVersion = "1.3.0";
9
+ export const pkgVersion = "2.0.0-dev.1.4.5.105745";
package/src/setup.ts CHANGED
@@ -8,15 +8,22 @@ import { ContainerMessageType } from "@fluidframework/container-runtime";
8
8
  import { IContainerRuntime } from "@fluidframework/container-runtime-definitions";
9
9
  import { ILastEditDetails, IFluidLastEditedTracker } from "./interfaces";
10
10
 
11
- // Default implementation of the shouldDiscardMessageFn function below that tells that all messages other
12
- // than "Alias", "Attach" and "Operation" type messages should be discarded.
11
+ /**
12
+ * Default implementation of {@link setupLastEditedTrackerForContainer}'s `shouldDiscardMessageFn` parameter,
13
+ * which tells that all messages other than {@link @fluidframework/container-runtime#ContainerMessageType.Alias},
14
+ * {@link @fluidframework/container-runtime#ContainerMessageType.Attach}, and
15
+ * {@link @fluidframework/container-runtime#ContainerMessageType.FluidDataStoreOp} type messages should be
16
+ * discarded.
17
+ */
13
18
  const shouldDiscardMessageDefault = (message: ISequencedDocumentMessage) =>
14
19
  message.type !== ContainerMessageType.Attach &&
15
20
  message.type !== ContainerMessageType.FluidDataStoreOp &&
16
21
  message.type !== ContainerMessageType.Alias;
17
22
 
18
- // Extracts the user information and timestamp from a message. Returns undefined if the user information for the
19
- // client who sent the message doesn't exist in the quorum.
23
+ /**
24
+ * Extracts the user information and timestamp from a message. Returns undefined if the user information for the
25
+ * client who sent the message doesn't exist in the quorum.
26
+ */
20
27
  function getLastEditDetailsFromMessage(
21
28
  message: ISequencedDocumentMessage,
22
29
  quorum: IQuorumClients,
@@ -35,12 +42,15 @@ function getLastEditDetailsFromMessage(
35
42
 
36
43
  /**
37
44
  * Helper function to set up a data object that provides IFluidLastEditedTracker to track last edited in a Container.
45
+ *
38
46
  * It does the following:
47
+ *
39
48
  * - Registers an "op" listener on the runtime. On each message, it calls the shouldDiscardMessageFn to check
40
- * if the message should be discarded. It also discards all scheduler message. If a message is not discarded,
41
- * it passes the last edited information from the message to the last edited tracker.
49
+ * if the message should be discarded. It also discards all scheduler message. If a message is not discarded,
50
+ * it passes the last edited information from the message to the last edited tracker.
51
+ *
42
52
  * - The last edited information from the last message received before the lastEditedTracker is
43
- * loaded is stored and passed to the tracker once it loads.
53
+ * loaded is stored and passed to the tracker once it loads.
44
54
  * @param lastEditedTracker - The last edited tracker.
45
55
  * @param runtime - The container runtime whose messages are to be tracked.
46
56
  * @param shouldDiscardMessageFn - Function that tells if a message should not be considered in computing last edited.
@@ -53,9 +63,9 @@ export function setupLastEditedTrackerForContainer(
53
63
  // Register an op listener on the runtime. If the lastEditedTracker has loaded,
54
64
  // it passes the last edited information to its
55
65
  // last edited tracker. If the lastEditedTracker hasn't loaded, store the last edited information temporarily.
56
- runtime.on("op", (message: ISequencedDocumentMessage) => {
66
+ runtime.on("op", (message: ISequencedDocumentMessage, runtimeMessage?: boolean) => {
57
67
  // If this message should be discarded as per shouldDiscardMessageFn, return.
58
- if (shouldDiscardMessageFn(message)) {
68
+ if (runtimeMessage === false || shouldDiscardMessageFn(message)) {
59
69
  return;
60
70
  }
61
71