@atproto/dev-env 0.6.36 → 0.7.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 +24 -0
- package/dist/bsky.js +1 -1
- package/dist/bsky.js.map +1 -1
- package/package.json +9 -9
- package/src/bsky.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @atproto/dev-env
|
|
2
2
|
|
|
3
|
+
## 0.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#5748](https://github.com/bluesky-social/atproto/pull/5748) [`87faedd`](https://github.com/bluesky-social/atproto/commit/87faeddd9cc708e520e3c9e1d2c0486e84a1b931) Thanks [@rafaeleyng](https://github.com/rafaeleyng)! - Group new-post notifications across accounts in All while keeping individual posts separate in Activity.
|
|
8
|
+
|
|
9
|
+
Add a notification grouping compute-time histogram with sub-millisecond buckets and an algorithm label.
|
|
10
|
+
|
|
11
|
+
Track the number of dataplane notification fetches per grouped notifications response.
|
|
12
|
+
|
|
13
|
+
Rename `notificationsV2MaxReads` to `notificationsV2MaxFetches` and `BSKY_NOTIFICATIONS_V2_MAX_READS` to `BSKY_NOTIFICATIONS_V2_MAX_FETCHES`.
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [[`3bfd00f`](https://github.com/bluesky-social/atproto/commit/3bfd00f484dc144482c82a4ed248adc49e6be769), [`87faedd`](https://github.com/bluesky-social/atproto/commit/87faeddd9cc708e520e3c9e1d2c0486e84a1b931), [`54f54ea`](https://github.com/bluesky-social/atproto/commit/54f54ea831f37fe9f722844177f7e1bed8ae8bdc), [`6ed6fe3`](https://github.com/bluesky-social/atproto/commit/6ed6fe39dded20f1e8995042135fba83b31d7b26), [`03a76ee`](https://github.com/bluesky-social/atproto/commit/03a76ee15e4acc123dc45446fc7b6fa46ba0e64e), [`ea28612`](https://github.com/bluesky-social/atproto/commit/ea286121ab421e320bf70f7e5a5dbb82c4c8b15e), [`78b3e20`](https://github.com/bluesky-social/atproto/commit/78b3e206286a3a02ef6693f2a66b4fa234532fbd), [`1c8c3a3`](https://github.com/bluesky-social/atproto/commit/1c8c3a3a8ea27a060f38cda71172339aa1728113), [`3bfd00f`](https://github.com/bluesky-social/atproto/commit/3bfd00f484dc144482c82a4ed248adc49e6be769), [`b33e55b`](https://github.com/bluesky-social/atproto/commit/b33e55b4aa5e4b3b031a2830856300350d9ef798)]:
|
|
18
|
+
- @atproto/bsky@0.4.0
|
|
19
|
+
- @atproto/ozone@0.11.0
|
|
20
|
+
- @atproto/api@0.29.6
|
|
21
|
+
- @atproto/pds@0.5.52
|
|
22
|
+
- @atproto/bsync@0.1.6
|
|
23
|
+
- @atproto/xrpc-server@0.13.7
|
|
24
|
+
- @atproto/sync@0.4.20
|
|
25
|
+
- @atproto/lex@0.4.4
|
|
26
|
+
|
|
3
27
|
## 0.6.36
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
package/dist/bsky.js
CHANGED
|
@@ -83,7 +83,7 @@ export class TestBsky {
|
|
|
83
83
|
...cfg,
|
|
84
84
|
notificationsV2MinRawLimit: cfg.notificationsV2MinRawLimit ?? 300,
|
|
85
85
|
notificationsV2MaxRawItems: cfg.notificationsV2MaxRawItems ?? 3000,
|
|
86
|
-
|
|
86
|
+
notificationsV2MaxFetches: cfg.notificationsV2MaxFetches ?? 3,
|
|
87
87
|
notificationsV2MaxGroupItemsWithRelatedViews: cfg.notificationsV2MaxGroupItemsWithRelatedViews ?? 10,
|
|
88
88
|
bskyFeedgenDids: cfg.bskyFeedgenDids ?? new Set(),
|
|
89
89
|
adminPasswords: [ADMIN_PASSWORD],
|
package/dist/bsky.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bsky.js","sourceRoot":"","sources":["../src/bsky.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,S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CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,cAAc,CAAA;QAC9C,OAAO,CACL,QAAQ;YACR,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,SAAS,QAAQ,EAAE,EAAE,MAAM,CAAC,EAAE,WAAW,CAAC,CACvE,CAAA;IACH,CAAC;IAED,gBAAgB;QACd,OAAO;YACL,aAAa,EAAE,IAAI,CAAC,SAAS,EAAE;SAChC,CAAA;IACH,CAAC;IAED,KAAK,CAAC,KAAK;QACT,iEAAiE;QACjE,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAA;QAC7B,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC;gBACH,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAA;YAC/B,CAAC;oBAAS,CAAC;gBACT,IAAI,CAAC;oBACH,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAA;gBAChC,CAAC;wBAAS,CAAC;oBACT,IAAI,CAAC;wBACH,MAAM,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAA;oBAC1B,CAAC;4BAAS,CAAC;wBACT,MAAM,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,CAAA;oBACvB,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,KAAK,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC;QACzB,MAAM,IAAI,CAAC,KAAK,EAAE,CAAA;IACpB,CAAC;CACF","sourcesContent":["import { Client as PlcClient } from '@did-plc/lib'\nimport * as ui8 from 'uint8arrays'\nimport { AtpAgent } from '@atproto/api'\nimport * as bsky from '@atproto/bsky'\nimport { SECOND } from '@atproto/common-web'\nimport { Secp256k1Keypair } from '@atproto/crypto'\nimport { Client, type UriString } from '@atproto/lex'\nimport type { DidString } from '@atproto/syntax'\nimport { ADMIN_PASSWORD, EXAMPLE_LABELER } from './const.js'\nimport getPort from './get-port.js'\nimport type { BskyConfig } from './types.js'\nexport * from '@atproto/bsky'\n\nexport class TestBsky {\n constructor(\n public url: UriString,\n public port: number,\n public db: bsky.Database,\n public server: bsky.BskyAppView,\n public dataplane: bsky.DataPlaneServer,\n public bsyncSub: bsky.BsyncSubscription,\n public sub: bsky.RepoSubscription,\n public serverDid: DidString,\n ) {}\n\n static async create(cfg: BskyConfig): Promise<TestBsky> {\n const serviceKeypair = cfg.privateKey\n ? await Secp256k1Keypair.import(cfg.privateKey)\n : await Secp256k1Keypair.create()\n const plcClient = new PlcClient(cfg.plcUrl)\n\n const port = cfg.port || (await getPort())\n const url: UriString = `http://localhost:${port}`\n const serverDid = (await plcClient.createDid({\n signingKey: serviceKeypair.did(),\n rotationKeys: [serviceKeypair.did()],\n handle: 'bsky.test',\n pds: `http://localhost:${port}`,\n signer: serviceKeypair,\n })) as DidString\n\n const endpoint = `http://localhost:${port}`\n\n await plcClient.updateData(serverDid, serviceKeypair, (x) => {\n x.services['bsky_notif'] = {\n type: 'BskyNotificationService',\n endpoint,\n }\n x.services['bsky_appview'] = {\n type: 'BskyAppView',\n endpoint,\n }\n return x\n })\n\n // shared across server, ingester, and indexer in order to share pool, avoid too many pg connections.\n const db = new bsky.Database({\n url: cfg.dbPostgresUrl,\n schema: cfg.dbPostgresSchema,\n poolSize: 10,\n })\n\n const dataplanePort = await getPort()\n const dataplane = await bsky.DataPlaneServer.create(\n db,\n dataplanePort,\n cfg.plcUrl,\n // Resolves against an in-process PLC on localhost.\n globalThis.fetch,\n )\n\n const config = new bsky.ServerConfig({\n version: 'unknown',\n port,\n didPlcUrl: cfg.plcUrl,\n publicUrl: 'https://bsky.public.url',\n serverDid,\n alternateAudienceDids: [],\n dataplaneUrls: [`http://localhost:${dataplanePort}`],\n dataplaneHttpVersion: '1.1',\n bsyncHttpVersion: '1.1',\n bsyncApiKey: 'bsync-api-key',\n modServiceDid: cfg.modServiceDid ?? 'did:example:invalidMod',\n labelsFromIssuerDids: [EXAMPLE_LABELER],\n bigThreadUris: new Set(),\n maxThreadParents: cfg.maxThreadParents ?? 50,\n disableSsrfProtection: true,\n searchTagsHide: new Set(),\n searchTagsHideAll: new Set(),\n threadTagsBumpDown: new Set(),\n threadTagsHide: new Set(),\n visibilityTagHide: '',\n visibilityTagRankPrefix: '',\n debugFieldAllowedDids: new Set(),\n draftsLimit: 500,\n feedGenSkeletonTimeout: 5 * SECOND,\n ...cfg,\n notificationsV2MinRawLimit: cfg.notificationsV2MinRawLimit ?? 300,\n notificationsV2MaxRawItems: cfg.notificationsV2MaxRawItems ?? 3000,\n notificationsV2MaxReads: cfg.notificationsV2MaxReads ?? 3,\n notificationsV2MaxGroupItemsWithRelatedViews:\n cfg.notificationsV2MaxGroupItemsWithRelatedViews ?? 10,\n bskyFeedgenDids: cfg.bskyFeedgenDids ?? new Set(),\n adminPasswords: [ADMIN_PASSWORD],\n etcdHosts: [],\n })\n\n // Separate migration db in case migration changes some connection state that we need in the tests, e.g. \"alter database ... set ...\"\n const migrationDb = new bsky.Database({\n url: cfg.dbPostgresUrl,\n schema: cfg.dbPostgresSchema,\n })\n if (cfg.migration) {\n await migrationDb.migrateToOrThrow(cfg.migration)\n } else {\n await migrationDb.migrateToLatestOrThrow()\n }\n await migrationDb.close()\n\n // api server\n const server = bsky.BskyAppView.create({\n config,\n signingKey: serviceKeypair,\n })\n\n const bsyncSub = new bsky.BsyncSubscription({\n config,\n db,\n })\n\n const sub = new bsky.RepoSubscription({\n service: cfg.repoProvider,\n db,\n idResolver: dataplane.idResolver,\n })\n\n await server.start()\n\n bsyncSub.start()\n void sub.start()\n\n return new TestBsky(\n url,\n port,\n db,\n server,\n dataplane,\n bsyncSub,\n sub,\n serverDid,\n )\n }\n\n get ctx(): bsky.AppContext {\n return this.server.ctx\n }\n\n getAgent(): AtpAgent {\n const agent = new AtpAgent({ service: this.url })\n agent.configureLabelers([EXAMPLE_LABELER])\n return agent\n }\n\n getClient(): Client {\n const client = new Client({ service: this.url })\n client.setLabelers([EXAMPLE_LABELER])\n return client\n }\n\n adminAuth(): string {\n const [password] = this.ctx.cfg.adminPasswords\n return (\n 'Basic ' +\n ui8.toString(ui8.fromString(`admin:${password}`, 'utf8'), 'base64pad')\n )\n }\n\n adminAuthHeaders() {\n return {\n authorization: this.adminAuth(),\n }\n }\n\n async close() {\n // @TODO Use disposable stack when it becomes available (Node24+)\n try {\n await this.server.destroy()\n } finally {\n try {\n await this.bsyncSub.destroy()\n } finally {\n try {\n await this.dataplane.destroy()\n } finally {\n try {\n await this.sub.destroy()\n } finally {\n await this.db.close()\n }\n }\n }\n }\n }\n\n async [Symbol.asyncDispose]() {\n await this.close()\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"bsky.js","sourceRoot":"","sources":["../src/bsky.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,KAAK,GAAG,MAAM,aAAa,CAAA;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,KAAK,IAAI,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,MAAM,EAAkB,MAAM,cAAc,CAAA;AAErD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC5D,OAAO,OAAO,MAAM,eAAe,CAAA;AAEnC,cAAc,eAAe,CAAA;AAE7B,MAAM,OAAO,QAAQ;IACnB,YACS,GAAc,EACd,IAAY,EACZ,EAAiB,EACjB,MAAwB,EACxB,SAA+B,EAC/B,QAAgC,EAChC,GAA0B,EAC1B,SAAoB;mBAPpB,GAAG;oBACH,IAAI;kBACJ,EAAE;sBACF,MAAM;yBACN,SAAS;wBACT,QAAQ;mBACR,GAAG;yBACH,SAAS;IACf,CAAC;IAEJ,MAAM,CAAC,KAAK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BAC1B,CAAC;4BAAS,CAAC;wBACT,MAAM,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,CAAA;oBACvB,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,KAAK,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC;QACzB,MAAM,IAAI,CAAC,KAAK,EAAE,CAAA;IACpB,CAAC;CACF","sourcesContent":["import { Client as PlcClient } from '@did-plc/lib'\nimport * as ui8 from 'uint8arrays'\nimport { AtpAgent } from '@atproto/api'\nimport * as bsky from '@atproto/bsky'\nimport { SECOND } from '@atproto/common-web'\nimport { Secp256k1Keypair } from '@atproto/crypto'\nimport { Client, type UriString } from '@atproto/lex'\nimport type { DidString } from '@atproto/syntax'\nimport { ADMIN_PASSWORD, EXAMPLE_LABELER } from './const.js'\nimport getPort from './get-port.js'\nimport type { BskyConfig } from './types.js'\nexport * from '@atproto/bsky'\n\nexport class TestBsky {\n constructor(\n public url: UriString,\n public port: number,\n public db: bsky.Database,\n public server: bsky.BskyAppView,\n public dataplane: bsky.DataPlaneServer,\n public bsyncSub: bsky.BsyncSubscription,\n public sub: bsky.RepoSubscription,\n public serverDid: DidString,\n ) {}\n\n static async create(cfg: BskyConfig): Promise<TestBsky> {\n const serviceKeypair = cfg.privateKey\n ? await Secp256k1Keypair.import(cfg.privateKey)\n : await Secp256k1Keypair.create()\n const plcClient = new PlcClient(cfg.plcUrl)\n\n const port = cfg.port || (await getPort())\n const url: UriString = `http://localhost:${port}`\n const serverDid = (await plcClient.createDid({\n signingKey: serviceKeypair.did(),\n rotationKeys: [serviceKeypair.did()],\n handle: 'bsky.test',\n pds: `http://localhost:${port}`,\n signer: serviceKeypair,\n })) as DidString\n\n const endpoint = `http://localhost:${port}`\n\n await plcClient.updateData(serverDid, serviceKeypair, (x) => {\n x.services['bsky_notif'] = {\n type: 'BskyNotificationService',\n endpoint,\n }\n x.services['bsky_appview'] = {\n type: 'BskyAppView',\n endpoint,\n }\n return x\n })\n\n // shared across server, ingester, and indexer in order to share pool, avoid too many pg connections.\n const db = new bsky.Database({\n url: cfg.dbPostgresUrl,\n schema: cfg.dbPostgresSchema,\n poolSize: 10,\n })\n\n const dataplanePort = await getPort()\n const dataplane = await bsky.DataPlaneServer.create(\n db,\n dataplanePort,\n cfg.plcUrl,\n // Resolves against an in-process PLC on localhost.\n globalThis.fetch,\n )\n\n const config = new bsky.ServerConfig({\n version: 'unknown',\n port,\n didPlcUrl: cfg.plcUrl,\n publicUrl: 'https://bsky.public.url',\n serverDid,\n alternateAudienceDids: [],\n dataplaneUrls: [`http://localhost:${dataplanePort}`],\n dataplaneHttpVersion: '1.1',\n bsyncHttpVersion: '1.1',\n bsyncApiKey: 'bsync-api-key',\n modServiceDid: cfg.modServiceDid ?? 'did:example:invalidMod',\n labelsFromIssuerDids: [EXAMPLE_LABELER],\n bigThreadUris: new Set(),\n maxThreadParents: cfg.maxThreadParents ?? 50,\n disableSsrfProtection: true,\n searchTagsHide: new Set(),\n searchTagsHideAll: new Set(),\n threadTagsBumpDown: new Set(),\n threadTagsHide: new Set(),\n visibilityTagHide: '',\n visibilityTagRankPrefix: '',\n debugFieldAllowedDids: new Set(),\n draftsLimit: 500,\n feedGenSkeletonTimeout: 5 * SECOND,\n ...cfg,\n notificationsV2MinRawLimit: cfg.notificationsV2MinRawLimit ?? 300,\n notificationsV2MaxRawItems: cfg.notificationsV2MaxRawItems ?? 3000,\n notificationsV2MaxFetches: cfg.notificationsV2MaxFetches ?? 3,\n notificationsV2MaxGroupItemsWithRelatedViews:\n cfg.notificationsV2MaxGroupItemsWithRelatedViews ?? 10,\n bskyFeedgenDids: cfg.bskyFeedgenDids ?? new Set(),\n adminPasswords: [ADMIN_PASSWORD],\n etcdHosts: [],\n })\n\n // Separate migration db in case migration changes some connection state that we need in the tests, e.g. \"alter database ... set ...\"\n const migrationDb = new bsky.Database({\n url: cfg.dbPostgresUrl,\n schema: cfg.dbPostgresSchema,\n })\n if (cfg.migration) {\n await migrationDb.migrateToOrThrow(cfg.migration)\n } else {\n await migrationDb.migrateToLatestOrThrow()\n }\n await migrationDb.close()\n\n // api server\n const server = bsky.BskyAppView.create({\n config,\n signingKey: serviceKeypair,\n })\n\n const bsyncSub = new bsky.BsyncSubscription({\n config,\n db,\n })\n\n const sub = new bsky.RepoSubscription({\n service: cfg.repoProvider,\n db,\n idResolver: dataplane.idResolver,\n })\n\n await server.start()\n\n bsyncSub.start()\n void sub.start()\n\n return new TestBsky(\n url,\n port,\n db,\n server,\n dataplane,\n bsyncSub,\n sub,\n serverDid,\n )\n }\n\n get ctx(): bsky.AppContext {\n return this.server.ctx\n }\n\n getAgent(): AtpAgent {\n const agent = new AtpAgent({ service: this.url })\n agent.configureLabelers([EXAMPLE_LABELER])\n return agent\n }\n\n getClient(): Client {\n const client = new Client({ service: this.url })\n client.setLabelers([EXAMPLE_LABELER])\n return client\n }\n\n adminAuth(): string {\n const [password] = this.ctx.cfg.adminPasswords\n return (\n 'Basic ' +\n ui8.toString(ui8.fromString(`admin:${password}`, 'utf8'), 'base64pad')\n )\n }\n\n adminAuthHeaders() {\n return {\n authorization: this.adminAuth(),\n }\n }\n\n async close() {\n // @TODO Use disposable stack when it becomes available (Node24+)\n try {\n await this.server.destroy()\n } finally {\n try {\n await this.bsyncSub.destroy()\n } finally {\n try {\n await this.dataplane.destroy()\n } finally {\n try {\n await this.sub.destroy()\n } finally {\n await this.db.close()\n }\n }\n }\n }\n }\n\n async [Symbol.asyncDispose]() {\n await this.close()\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atproto/dev-env",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Local development environment helper for atproto development",
|
|
6
6
|
"keywords": [
|
|
@@ -39,19 +39,19 @@
|
|
|
39
39
|
"multiformats": "^13.0.0",
|
|
40
40
|
"uint8arrays": "^5.0.0",
|
|
41
41
|
"undici": "^8.12.2",
|
|
42
|
-
"@atproto/
|
|
43
|
-
"@atproto/
|
|
42
|
+
"@atproto/api": "^0.29.6",
|
|
43
|
+
"@atproto/bsky": "^0.4.0",
|
|
44
|
+
"@atproto/bsync": "^0.1.6",
|
|
44
45
|
"@atproto/common-web": "^0.5.15",
|
|
45
46
|
"@atproto/crypto": "^0.5.7",
|
|
46
|
-
"@atproto/bsync": "^0.1.5",
|
|
47
47
|
"@atproto/identity": "^0.5.20",
|
|
48
|
-
"@atproto/lex": "^0.4.3",
|
|
49
48
|
"@atproto/lexicon": "^0.7.17",
|
|
50
|
-
"@atproto/
|
|
51
|
-
"@atproto/
|
|
52
|
-
"@atproto/
|
|
49
|
+
"@atproto/lex": "^0.4.4",
|
|
50
|
+
"@atproto/ozone": "^0.11.0",
|
|
51
|
+
"@atproto/pds": "^0.5.52",
|
|
53
52
|
"@atproto/syntax": "^0.7.7",
|
|
54
|
-
"@atproto/
|
|
53
|
+
"@atproto/sync": "^0.4.20",
|
|
54
|
+
"@atproto/xrpc-server": "^0.13.7"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@types/express": "^4.17.13"
|
package/src/bsky.ts
CHANGED
|
@@ -97,7 +97,7 @@ export class TestBsky {
|
|
|
97
97
|
...cfg,
|
|
98
98
|
notificationsV2MinRawLimit: cfg.notificationsV2MinRawLimit ?? 300,
|
|
99
99
|
notificationsV2MaxRawItems: cfg.notificationsV2MaxRawItems ?? 3000,
|
|
100
|
-
|
|
100
|
+
notificationsV2MaxFetches: cfg.notificationsV2MaxFetches ?? 3,
|
|
101
101
|
notificationsV2MaxGroupItemsWithRelatedViews:
|
|
102
102
|
cfg.notificationsV2MaxGroupItemsWithRelatedViews ?? 10,
|
|
103
103
|
bskyFeedgenDids: cfg.bskyFeedgenDids ?? new Set(),
|