@atlaskit/collab-provider 27.0.12 → 28.1.0

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 CHANGED
@@ -1,5 +1,26 @@
1
1
  # @atlaskit/collab-provider
2
2
 
3
+ ## 28.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`36e3ed7c27a98`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/36e3ed7c27a98) -
8
+ Fix missing userIds in steps by using the already known confluence userId, gated by
9
+ `confluence_ncs_step_diffing_version_history`.
10
+
11
+ ### Patch Changes
12
+
13
+ - [`6f50f448a393e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6f50f448a393e) -
14
+ Stop deriving agent participants from editor steps when platform_editor_agent_edit_presence is
15
+ enabled.
16
+ - Updated dependencies
17
+
18
+ ## 28.0.0
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies
23
+
3
24
  ## 27.0.12
4
25
 
5
26
  ### Patch Changes
@@ -17,6 +17,7 @@ var _prosemirrorCollab = require("@atlaskit/prosemirror-collab");
17
17
  var _state = require("@atlaskit/editor-prosemirror/state");
18
18
  var _JSONTransformer = require("@atlaskit/editor-json-transformer/JSONTransformer-2");
19
19
  var _unsafeExpValNoExposure = require("@atlaskit/platform-feature-experiments/unsafe-exp-val-no-exposure");
20
+ var _fg = require("@atlaskit/platform-feature-flags/fg");
20
21
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
21
22
  var _const = require("../helpers/const");
22
23
  var _performance = require("../analytics/performance");
@@ -953,10 +954,12 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
953
954
  * milestone independently — the milestone attributes its own local steps, which are echoed back
954
955
  * to this client, so it needs the facepile without the backend streaming visuals.
955
956
  *
957
+ * When agent edit presence is enabled, the canonical presence channel owns agent participants.
958
+ * Skip this step-derived fallback entirely in that cohort to avoid duplicate or stale participants.
959
+ *
956
960
  * The milestone value is read without logging an exposure: this runs on every received step
957
961
  * batch, whereas the canonical exposure is logged at the action-driven call sites that decide
958
- * whether to attribute a step. The backend experiment is evaluated first so its exposure
959
- * population is unchanged.
962
+ * whether to attribute a step.
960
963
  *
961
964
  * Known limitation (PoC): steps replayed via catch-up/reconnect can briefly re-surface an agent
962
965
  * whose activity is stale — a freshness guard is a follow-up.
@@ -965,7 +968,7 @@ var DocumentService = exports.DocumentService = /*#__PURE__*/function () {
965
968
  key: "maybeAddAgentPresenceFromSteps",
966
969
  value: function maybeAddAgentPresenceFromSteps(steps) {
967
970
  var _this3 = this;
968
- if (!(0, _expValEquals.expValEquals)('platform_editor_agent_be_streaming', 'isEnabled', true) && !(0, _unsafeExpValNoExposure.UNSAFE_expValNoExposure)('platform_editor_ai_streaming_ux_experience_m1', 'isEnabled', false)) {
971
+ if ((0, _fg.fg)('platform_editor_agent_edit_presence') || !(0, _expValEquals.expValEquals)('platform_editor_agent_be_streaming', 'isEnabled', true) && !(0, _unsafeExpValNoExposure.UNSAFE_expValNoExposure)('platform_editor_ai_streaming_ux_experience_m1', 'isEnabled', false)) {
969
972
  return;
970
973
  }
971
974
  try {
@@ -859,9 +859,9 @@ var ParticipantsService = exports.ParticipantsService = /*#__PURE__*/function ()
859
859
  (0, _defineProperty2.default)(this, "onPresence", function (payload) {
860
860
  try {
861
861
  logger('onPresence userId: ', payload.userId);
862
- // Ignored via go/ees005
863
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
864
- _this.setUserId(payload.userId);
862
+ if (payload.userId) {
863
+ _this.setUserId(payload.userId);
864
+ }
865
865
  _this.sendPresence();
866
866
  _this.sendPresenceJoined();
867
867
  } catch (error) {
@@ -444,6 +444,7 @@ var Provider = exports.Provider = /*#__PURE__*/function (_Emitter) {
444
444
  _this.channel = new _channel.Channel(config, _this.analyticsHelper);
445
445
  _this.isChannelInitialized = false;
446
446
  _this.initialDraft = _this.config.initialDraft;
447
+ _this.userId = _this.config.userId;
447
448
  _this.isBufferingEnabled = Boolean(_this.config.isBufferingEnabled);
448
449
  _this.isProviderInitialized = false;
449
450
  _this.participantsService = new _participantsService.ParticipantsService(_this.analyticsHelper, undefined, _this.emitCallback, _this.config.getUser, _this.config.batchProps, _this.channel.broadcast, _this.channel.sendPresenceJoined, _this.getPresenceData, _this.setUserId, _this.getAIProviderActiveIds, _this.config.fetchAnonymousAsset);
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.version = exports.nextMajorVersion = exports.name = void 0;
7
7
  var name = exports.name = "@atlaskit/collab-provider";
8
- var version = exports.version = "27.0.11";
8
+ var version = exports.version = "28.0.0";
9
9
  var nextMajorVersion = exports.nextMajorVersion = function nextMajorVersion() {
10
10
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
11
11
  };
@@ -5,6 +5,7 @@ import { getCollabState, sendableSteps } from '@atlaskit/prosemirror-collab';
5
5
  import { Transaction } from '@atlaskit/editor-prosemirror/state';
6
6
  import { JSONTransformer } from '@atlaskit/editor-json-transformer/JSONTransformer-2';
7
7
  import { UNSAFE_expValNoExposure } from '@atlaskit/platform-feature-experiments/unsafe-exp-val-no-exposure';
8
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
8
9
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
9
10
  import { ACK_MAX_TRY, EVENT_ACTION, EVENT_STATUS, CatchupEventReason } from '../helpers/const';
10
11
  import { MEASURE_NAME, startMeasure, stopMeasure } from '../analytics/performance';
@@ -831,16 +832,18 @@ export class DocumentService {
831
832
  * milestone independently — the milestone attributes its own local steps, which are echoed back
832
833
  * to this client, so it needs the facepile without the backend streaming visuals.
833
834
  *
835
+ * When agent edit presence is enabled, the canonical presence channel owns agent participants.
836
+ * Skip this step-derived fallback entirely in that cohort to avoid duplicate or stale participants.
837
+ *
834
838
  * The milestone value is read without logging an exposure: this runs on every received step
835
839
  * batch, whereas the canonical exposure is logged at the action-driven call sites that decide
836
- * whether to attribute a step. The backend experiment is evaluated first so its exposure
837
- * population is unchanged.
840
+ * whether to attribute a step.
838
841
  *
839
842
  * Known limitation (PoC): steps replayed via catch-up/reconnect can briefly re-surface an agent
840
843
  * whose activity is stale — a freshness guard is a follow-up.
841
844
  */
842
845
  maybeAddAgentPresenceFromSteps(steps) {
843
- if (!expValEquals('platform_editor_agent_be_streaming', 'isEnabled', true) && !UNSAFE_expValNoExposure('platform_editor_ai_streaming_ux_experience_m1', 'isEnabled', false)) {
846
+ if (fg('platform_editor_agent_edit_presence') || !expValEquals('platform_editor_agent_be_streaming', 'isEnabled', true) && !UNSAFE_expValNoExposure('platform_editor_ai_streaming_ux_experience_m1', 'isEnabled', false)) {
844
847
  return;
845
848
  }
846
849
  try {
@@ -698,9 +698,9 @@ export class ParticipantsService {
698
698
  _defineProperty(this, "onPresence", payload => {
699
699
  try {
700
700
  logger('onPresence userId: ', payload.userId);
701
- // Ignored via go/ees005
702
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
703
- this.setUserId(payload.userId);
701
+ if (payload.userId) {
702
+ this.setUserId(payload.userId);
703
+ }
704
704
  this.sendPresence();
705
705
  this.sendPresenceJoined();
706
706
  } catch (error) {
@@ -361,6 +361,7 @@ export class Provider extends Emitter {
361
361
  this.channel = new Channel(config, this.analyticsHelper);
362
362
  this.isChannelInitialized = false;
363
363
  this.initialDraft = this.config.initialDraft;
364
+ this.userId = this.config.userId;
364
365
  this.isBufferingEnabled = Boolean(this.config.isBufferingEnabled);
365
366
  this.isProviderInitialized = false;
366
367
  this.participantsService = new ParticipantsService(this.analyticsHelper, undefined, this.emitCallback, this.config.getUser, this.config.batchProps, this.channel.broadcast, this.channel.sendPresenceJoined, this.getPresenceData, this.setUserId, this.getAIProviderActiveIds, this.config.fetchAnonymousAsset);
@@ -1,5 +1,5 @@
1
1
  export const name = "@atlaskit/collab-provider";
2
- export const version = "27.0.11";
2
+ export const version = "28.0.0";
3
3
  export const nextMajorVersion = () => {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -15,6 +15,7 @@ import { getCollabState, sendableSteps } from '@atlaskit/prosemirror-collab';
15
15
  import { Transaction } from '@atlaskit/editor-prosemirror/state';
16
16
  import { JSONTransformer } from '@atlaskit/editor-json-transformer/JSONTransformer-2';
17
17
  import { UNSAFE_expValNoExposure } from '@atlaskit/platform-feature-experiments/unsafe-exp-val-no-exposure';
18
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
18
19
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
19
20
  import { ACK_MAX_TRY, EVENT_ACTION, EVENT_STATUS, CatchupEventReason } from '../helpers/const';
20
21
  import { MEASURE_NAME, startMeasure, stopMeasure } from '../analytics/performance';
@@ -947,10 +948,12 @@ export var DocumentService = /*#__PURE__*/function () {
947
948
  * milestone independently — the milestone attributes its own local steps, which are echoed back
948
949
  * to this client, so it needs the facepile without the backend streaming visuals.
949
950
  *
951
+ * When agent edit presence is enabled, the canonical presence channel owns agent participants.
952
+ * Skip this step-derived fallback entirely in that cohort to avoid duplicate or stale participants.
953
+ *
950
954
  * The milestone value is read without logging an exposure: this runs on every received step
951
955
  * batch, whereas the canonical exposure is logged at the action-driven call sites that decide
952
- * whether to attribute a step. The backend experiment is evaluated first so its exposure
953
- * population is unchanged.
956
+ * whether to attribute a step.
954
957
  *
955
958
  * Known limitation (PoC): steps replayed via catch-up/reconnect can briefly re-surface an agent
956
959
  * whose activity is stale — a freshness guard is a follow-up.
@@ -959,7 +962,7 @@ export var DocumentService = /*#__PURE__*/function () {
959
962
  key: "maybeAddAgentPresenceFromSteps",
960
963
  value: function maybeAddAgentPresenceFromSteps(steps) {
961
964
  var _this3 = this;
962
- if (!expValEquals('platform_editor_agent_be_streaming', 'isEnabled', true) && !UNSAFE_expValNoExposure('platform_editor_ai_streaming_ux_experience_m1', 'isEnabled', false)) {
965
+ if (fg('platform_editor_agent_edit_presence') || !expValEquals('platform_editor_agent_be_streaming', 'isEnabled', true) && !UNSAFE_expValNoExposure('platform_editor_ai_streaming_ux_experience_m1', 'isEnabled', false)) {
963
966
  return;
964
967
  }
965
968
  try {
@@ -852,9 +852,9 @@ export var ParticipantsService = /*#__PURE__*/function () {
852
852
  _defineProperty(this, "onPresence", function (payload) {
853
853
  try {
854
854
  logger('onPresence userId: ', payload.userId);
855
- // Ignored via go/ees005
856
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
857
- _this.setUserId(payload.userId);
855
+ if (payload.userId) {
856
+ _this.setUserId(payload.userId);
857
+ }
858
858
  _this.sendPresence();
859
859
  _this.sendPresenceJoined();
860
860
  } catch (error) {
@@ -438,6 +438,7 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
438
438
  _this.channel = new Channel(config, _this.analyticsHelper);
439
439
  _this.isChannelInitialized = false;
440
440
  _this.initialDraft = _this.config.initialDraft;
441
+ _this.userId = _this.config.userId;
441
442
  _this.isBufferingEnabled = Boolean(_this.config.isBufferingEnabled);
442
443
  _this.isProviderInitialized = false;
443
444
  _this.participantsService = new ParticipantsService(_this.analyticsHelper, undefined, _this.emitCallback, _this.config.getUser, _this.config.batchProps, _this.channel.broadcast, _this.channel.sendPresenceJoined, _this.getPresenceData, _this.setUserId, _this.getAIProviderActiveIds, _this.config.fetchAnonymousAsset);
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/collab-provider";
2
- export var version = "27.0.11";
2
+ export var version = "28.0.0";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -104,10 +104,12 @@ export declare class DocumentService implements DocumentServiceInterface {
104
104
  * milestone independently — the milestone attributes its own local steps, which are echoed back
105
105
  * to this client, so it needs the facepile without the backend streaming visuals.
106
106
  *
107
+ * When agent edit presence is enabled, the canonical presence channel owns agent participants.
108
+ * Skip this step-derived fallback entirely in that cohort to avoid duplicate or stale participants.
109
+ *
107
110
  * The milestone value is read without logging an exposure: this runs on every received step
108
111
  * batch, whereas the canonical exposure is logged at the action-driven call sites that decide
109
- * whether to attribute a step. The backend experiment is evaluated first so its exposure
110
- * population is unchanged.
112
+ * whether to attribute a step.
111
113
  *
112
114
  * Known limitation (PoC): steps replayed via catch-up/reconnect can briefly re-surface an agent
113
115
  * whose activity is stale — a freshness guard is a follow-up.
@@ -86,6 +86,8 @@ export interface Config {
86
86
  * multiple websocket connections, the presenceId is used to correlate the two.
87
87
  */
88
88
  presenceId?: string;
89
+ /** The authenticated account ID used to attribute locally committed steps. */
90
+ userId?: string;
89
91
  productInfo?: ProductInformation;
90
92
  /**
91
93
  * Configure the client side circuit breaker in the event that abnormal behaviour causes the client to flood
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/collab-provider",
3
- "version": "27.0.12",
3
+ "version": "28.1.0",
4
4
  "description": "A provider for collaborative editing.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -20,17 +20,17 @@
20
20
  "dependencies": {
21
21
  "@atlaskit/adf-utils": "^20.9.0",
22
22
  "@atlaskit/analytics-gas-types": "^6.2.0",
23
- "@atlaskit/analytics-listeners": "^11.3.0",
23
+ "@atlaskit/analytics-listeners": "^11.4.0",
24
24
  "@atlaskit/anonymous-assets": "^2.9.0",
25
25
  "@atlaskit/atlassian-context": "^1.2.0",
26
26
  "@atlaskit/editor-json-transformer": "^9.8.0",
27
- "@atlaskit/editor-prosemirror": "^8.0.0",
27
+ "@atlaskit/editor-prosemirror": "^9.0.0",
28
28
  "@atlaskit/feature-gate-js-client": "^6.0.0",
29
29
  "@atlaskit/platform-feature-experiments": "^0.3.0",
30
30
  "@atlaskit/platform-feature-flags": "^2.2.0",
31
31
  "@atlaskit/prosemirror-collab": "^1.1.0",
32
- "@atlaskit/react-ufo": "^7.11.0",
33
- "@atlaskit/tmp-editor-statsig": "^199.0.0",
32
+ "@atlaskit/react-ufo": "^7.13.0",
33
+ "@atlaskit/tmp-editor-statsig": "^200.0.0",
34
34
  "@atlaskit/ufo": "^1.2.0",
35
35
  "@atlaskit/util-service-support": "^7.4.0",
36
36
  "@babel/runtime": "^7.0.0",
@@ -57,6 +57,10 @@
57
57
  "type": "boolean",
58
58
  "referenceOnly": true
59
59
  },
60
+ "platform_editor_agent_edit_presence": {
61
+ "type": "boolean",
62
+ "referenceOnly": true
63
+ },
60
64
  "platform_editor_agentic_step_attribution": {
61
65
  "type": "boolean"
62
66
  },
@@ -71,6 +75,6 @@
71
75
  }
72
76
  },
73
77
  "peerDependencies": {
74
- "@atlaskit/editor-common": "^122.11.0"
78
+ "@atlaskit/editor-common": "^123.0.0"
75
79
  }
76
80
  }