@pkcprotocol/pkc-js 0.0.145 → 0.0.146

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.
Files changed (59) hide show
  1. package/dist/browser/generated-version.d.ts +1 -1
  2. package/dist/browser/generated-version.js +1 -1
  3. package/dist/browser/publications/publication.d.ts +1 -0
  4. package/dist/browser/publications/publication.js +24 -5
  5. package/dist/browser/publications/publication.js.map +1 -1
  6. package/dist/browser/runtime/node/community/challenges/index.js +14 -0
  7. package/dist/browser/runtime/node/community/challenges/index.js.map +1 -1
  8. package/dist/browser/runtime/node/community/local-community/db-state.d.ts +3 -1
  9. package/dist/browser/runtime/node/community/local-community/db-state.js +9 -3
  10. package/dist/browser/runtime/node/community/local-community/db-state.js.map +1 -1
  11. package/dist/browser/runtime/node/community/local-community/defaults.d.ts +1 -0
  12. package/dist/browser/runtime/node/community/local-community/defaults.js +5 -0
  13. package/dist/browser/runtime/node/community/local-community/defaults.js.map +1 -1
  14. package/dist/browser/runtime/node/community/local-community/editing.js +29 -2
  15. package/dist/browser/runtime/node/community/local-community/editing.js.map +1 -1
  16. package/dist/browser/runtime/node/community/local-community/ipns-publishing.js +2 -1
  17. package/dist/browser/runtime/node/community/local-community/ipns-publishing.js.map +1 -1
  18. package/dist/browser/runtime/node/community/local-community/lifecycle.js +84 -13
  19. package/dist/browser/runtime/node/community/local-community/lifecycle.js.map +1 -1
  20. package/dist/browser/runtime/node/community/local-community.d.ts +4 -0
  21. package/dist/browser/runtime/node/community/local-community.js +7 -1
  22. package/dist/browser/runtime/node/community/local-community.js.map +1 -1
  23. package/dist/bundled/bundle-manifest.json +53 -53
  24. package/dist/bundled/challenges.js +1 -1
  25. package/dist/bundled/chunks/{helia-for-pkc-7vdzP67t.js → helia-for-pkc-PaZmkxgn.js} +2 -2
  26. package/dist/bundled/chunks/{local-community-UB_rVgR9.js → local-community-BY1ouP1-.js} +90 -23
  27. package/dist/bundled/chunks/{local-community-Bi1JGMMa.js → local-community-CeuVhBBn.js} +1 -1
  28. package/dist/bundled/chunks/{node-BT3m9Nml.js → node-BXilwSVE.js} +16 -6
  29. package/dist/bundled/chunks/{page-sort-scoring-Bsc4MAy1.js → page-sort-scoring-DgSzIxmE.js} +1 -1
  30. package/dist/bundled/chunks/{rpc-local-community-DVykDP0T.js → rpc-local-community-BK_HGb_u.js} +12 -2
  31. package/dist/bundled/chunks/{util-D6z8nIoj.js → util-Bnqvxk-6.js} +1 -1
  32. package/dist/bundled/chunks/{util-BxfB5cRB.js → util-DRSzW-LU.js} +1 -1
  33. package/dist/bundled/chunks/{validate-package-factories-CiY6DjnH.js → validate-package-factories-MG5ehoSU.js} +2 -2
  34. package/dist/bundled/index.js +1 -1
  35. package/dist/bundled/page-sorts.js +1 -1
  36. package/dist/bundled/rpc/src/index.js +4 -4
  37. package/dist/node/generated-version.d.ts +1 -1
  38. package/dist/node/generated-version.js +1 -1
  39. package/dist/node/publications/publication.d.ts +1 -0
  40. package/dist/node/publications/publication.js +24 -5
  41. package/dist/node/publications/publication.js.map +1 -1
  42. package/dist/node/runtime/node/community/challenges/index.js +14 -0
  43. package/dist/node/runtime/node/community/challenges/index.js.map +1 -1
  44. package/dist/node/runtime/node/community/local-community/db-state.d.ts +3 -1
  45. package/dist/node/runtime/node/community/local-community/db-state.js +9 -3
  46. package/dist/node/runtime/node/community/local-community/db-state.js.map +1 -1
  47. package/dist/node/runtime/node/community/local-community/defaults.d.ts +1 -0
  48. package/dist/node/runtime/node/community/local-community/defaults.js +5 -0
  49. package/dist/node/runtime/node/community/local-community/defaults.js.map +1 -1
  50. package/dist/node/runtime/node/community/local-community/editing.js +29 -2
  51. package/dist/node/runtime/node/community/local-community/editing.js.map +1 -1
  52. package/dist/node/runtime/node/community/local-community/ipns-publishing.js +2 -1
  53. package/dist/node/runtime/node/community/local-community/ipns-publishing.js.map +1 -1
  54. package/dist/node/runtime/node/community/local-community/lifecycle.js +84 -13
  55. package/dist/node/runtime/node/community/local-community/lifecycle.js.map +1 -1
  56. package/dist/node/runtime/node/community/local-community.d.ts +4 -0
  57. package/dist/node/runtime/node/community/local-community.js +7 -1
  58. package/dist/node/runtime/node/community/local-community.js.map +1 -1
  59. package/package.json +1 -1
@@ -3,7 +3,7 @@
3
3
  "challenges.js": {
4
4
  "isEntry": true,
5
5
  "imports": [
6
- "chunks/validate-package-factories-CiY6DjnH.js"
6
+ "chunks/validate-package-factories-MG5ehoSU.js"
7
7
  ],
8
8
  "dynamicImports": [],
9
9
  "inputs": [
@@ -16,7 +16,7 @@
16
16
  "node:module"
17
17
  ],
18
18
  "dynamicImports": [
19
- "chunks/node-BT3m9Nml.js"
19
+ "chunks/node-BXilwSVE.js"
20
20
  ],
21
21
  "inputs": [
22
22
  "dist/node/runtime/node/compile-cache.js",
@@ -26,7 +26,7 @@
26
26
  "index.js": {
27
27
  "isEntry": true,
28
28
  "imports": [
29
- "chunks/node-BT3m9Nml.js"
29
+ "chunks/node-BXilwSVE.js"
30
30
  ],
31
31
  "dynamicImports": [],
32
32
  "inputs": []
@@ -34,7 +34,7 @@
34
34
  "page-sorts.js": {
35
35
  "isEntry": true,
36
36
  "imports": [
37
- "chunks/validate-package-factories-CiY6DjnH.js"
37
+ "chunks/validate-package-factories-MG5ehoSU.js"
38
38
  ],
39
39
  "dynamicImports": [],
40
40
  "inputs": [
@@ -44,10 +44,10 @@
44
44
  "rpc/src/index.js": {
45
45
  "isEntry": true,
46
46
  "imports": [
47
- "chunks/rpc-local-community-DVykDP0T.js",
48
- "chunks/node-BT3m9Nml.js",
49
- "chunks/util-D6z8nIoj.js",
50
- "chunks/local-community-UB_rVgR9.js",
47
+ "chunks/rpc-local-community-BK_HGb_u.js",
48
+ "chunks/node-BXilwSVE.js",
49
+ "chunks/util-Bnqvxk-6.js",
50
+ "chunks/local-community-BY1ouP1-.js",
51
51
  "node:url",
52
52
  "path",
53
53
  "assert",
@@ -77,12 +77,12 @@
77
77
  "\u0000rolldown/runtime.js"
78
78
  ]
79
79
  },
80
- "chunks/helia-for-pkc-7vdzP67t.js": {
80
+ "chunks/helia-for-pkc-PaZmkxgn.js": {
81
81
  "isEntry": false,
82
82
  "imports": [
83
83
  "chunks/chunk-2rV9d50f.js",
84
- "chunks/util-D6z8nIoj.js",
85
- "chunks/util-BxfB5cRB.js",
84
+ "chunks/util-Bnqvxk-6.js",
85
+ "chunks/util-DRSzW-LU.js",
86
86
  "chunks/src-DKntVmyX.js",
87
87
  "chunks/src-Cpx2Sts8.js",
88
88
  "node:url",
@@ -204,21 +204,13 @@
204
204
  "dist/node/helia/helia-for-pkc.js"
205
205
  ]
206
206
  },
207
- "chunks/local-community-Bi1JGMMa.js": {
208
- "isEntry": false,
209
- "imports": [
210
- "chunks/local-community-UB_rVgR9.js"
211
- ],
212
- "dynamicImports": [],
213
- "inputs": []
214
- },
215
- "chunks/local-community-UB_rVgR9.js": {
207
+ "chunks/local-community-BY1ouP1-.js": {
216
208
  "isEntry": false,
217
209
  "imports": [
218
210
  "chunks/chunk-2rV9d50f.js",
219
- "chunks/rpc-local-community-DVykDP0T.js",
220
- "chunks/util-D6z8nIoj.js",
221
- "chunks/page-sort-scoring-Bsc4MAy1.js",
211
+ "chunks/rpc-local-community-BK_HGb_u.js",
212
+ "chunks/util-Bnqvxk-6.js",
213
+ "chunks/page-sort-scoring-DgSzIxmE.js",
222
214
  "node:url",
223
215
  "node:path",
224
216
  "os",
@@ -270,13 +262,21 @@
270
262
  "dist/node/runtime/node/community/local-community.js"
271
263
  ]
272
264
  },
273
- "chunks/node-BT3m9Nml.js": {
265
+ "chunks/local-community-CeuVhBBn.js": {
266
+ "isEntry": false,
267
+ "imports": [
268
+ "chunks/local-community-BY1ouP1-.js"
269
+ ],
270
+ "dynamicImports": [],
271
+ "inputs": []
272
+ },
273
+ "chunks/node-BXilwSVE.js": {
274
274
  "isEntry": false,
275
275
  "imports": [
276
276
  "chunks/chunk-2rV9d50f.js",
277
- "chunks/rpc-local-community-DVykDP0T.js",
278
- "chunks/util-D6z8nIoj.js",
279
- "chunks/util-BxfB5cRB.js",
277
+ "chunks/rpc-local-community-BK_HGb_u.js",
278
+ "chunks/util-Bnqvxk-6.js",
279
+ "chunks/util-DRSzW-LU.js",
280
280
  "path",
281
281
  "assert",
282
282
  "fs",
@@ -287,8 +287,8 @@
287
287
  "rpc-websockets"
288
288
  ],
289
289
  "dynamicImports": [
290
- "chunks/helia-for-pkc-7vdzP67t.js",
291
- "chunks/local-community-UB_rVgR9.js"
290
+ "chunks/helia-for-pkc-PaZmkxgn.js",
291
+ "chunks/local-community-BY1ouP1-.js"
292
292
  ],
293
293
  "inputs": [
294
294
  "dist/node/zod-error-map.js",
@@ -448,22 +448,22 @@
448
448
  "dist/node/index.js"
449
449
  ]
450
450
  },
451
- "chunks/page-sort-scoring-Bsc4MAy1.js": {
451
+ "chunks/page-sort-scoring-DgSzIxmE.js": {
452
452
  "isEntry": false,
453
453
  "imports": [
454
- "chunks/util-D6z8nIoj.js"
454
+ "chunks/util-Bnqvxk-6.js"
455
455
  ],
456
456
  "dynamicImports": [],
457
457
  "inputs": [
458
458
  "dist/node/pages/page-sort-scoring.js"
459
459
  ]
460
460
  },
461
- "chunks/rpc-local-community-DVykDP0T.js": {
461
+ "chunks/rpc-local-community-BK_HGb_u.js": {
462
462
  "isEntry": false,
463
463
  "imports": [
464
464
  "chunks/chunk-2rV9d50f.js",
465
- "chunks/util-D6z8nIoj.js",
466
- "chunks/page-sort-scoring-Bsc4MAy1.js",
465
+ "chunks/util-Bnqvxk-6.js",
466
+ "chunks/page-sort-scoring-DgSzIxmE.js",
467
467
  "chunks/src-CYIMjhjK.js",
468
468
  "node:crypto",
469
469
  "node:url",
@@ -1576,22 +1576,7 @@
1576
1576
  "node_modules/kubo-rpc-client/dist/src/index.js"
1577
1577
  ]
1578
1578
  },
1579
- "chunks/util-BxfB5cRB.js": {
1580
- "isEntry": false,
1581
- "imports": [
1582
- "chunks/util-D6z8nIoj.js",
1583
- "ipns/selector",
1584
- "ipns/validator",
1585
- "ipns",
1586
- "uint8arrays/equals",
1587
- "@libp2p/utils"
1588
- ],
1589
- "dynamicImports": [],
1590
- "inputs": [
1591
- "dist/node/helia/util.js"
1592
- ]
1593
- },
1594
- "chunks/util-D6z8nIoj.js": {
1579
+ "chunks/util-Bnqvxk-6.js": {
1595
1580
  "isEntry": false,
1596
1581
  "imports": [
1597
1582
  "chunks/chunk-2rV9d50f.js",
@@ -1686,11 +1671,26 @@
1686
1671
  "dist/node/util.js"
1687
1672
  ]
1688
1673
  },
1689
- "chunks/validate-package-factories-CiY6DjnH.js": {
1674
+ "chunks/util-DRSzW-LU.js": {
1675
+ "isEntry": false,
1676
+ "imports": [
1677
+ "chunks/util-Bnqvxk-6.js",
1678
+ "ipns/selector",
1679
+ "ipns/validator",
1680
+ "ipns",
1681
+ "uint8arrays/equals",
1682
+ "@libp2p/utils"
1683
+ ],
1684
+ "dynamicImports": [],
1685
+ "inputs": [
1686
+ "dist/node/helia/util.js"
1687
+ ]
1688
+ },
1689
+ "chunks/validate-package-factories-MG5ehoSU.js": {
1690
1690
  "isEntry": false,
1691
1691
  "imports": [
1692
- "chunks/util-D6z8nIoj.js",
1693
- "chunks/page-sort-scoring-Bsc4MAy1.js"
1692
+ "chunks/util-Bnqvxk-6.js",
1693
+ "chunks/page-sort-scoring-DgSzIxmE.js"
1694
1694
  ],
1695
1695
  "dynamicImports": [],
1696
1696
  "inputs": [
@@ -1,2 +1,2 @@
1
- import { t as validateChallengeFileFactory } from "./chunks/validate-package-factories-CiY6DjnH.js";
1
+ import { t as validateChallengeFileFactory } from "./chunks/validate-package-factories-MG5ehoSU.js";
2
2
  export { validateChallengeFileFactory };
@@ -1,6 +1,6 @@
1
1
  import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-2rV9d50f.js";
2
- import { Br as logger_default, C as hideClassPrivateProps, Rr as PKCError, T as ipnsNameToIpnsOverPubsubTopic, n as binaryKeyToPubsubTopic } from "./util-D6z8nIoj.js";
3
- import { a as directFetchIpnsRecordFromProviders, c as readFreshCachedIpnsRecordFromPubsubLocalStore, i as connectToPubsubPeers, l as selectBitswapSessionSeedPeers, n as REACHABILITY_DOCS_URL, o as fetchBlockWithStalledSessionFailover, r as cacheIpnsRecordInPubsubLocalStore, s as getHeliaDebugContext, u as summarizeProviderReachability } from "./util-BxfB5cRB.js";
2
+ import { Br as logger_default, C as hideClassPrivateProps, Rr as PKCError, T as ipnsNameToIpnsOverPubsubTopic, n as binaryKeyToPubsubTopic } from "./util-Bnqvxk-6.js";
3
+ import { a as directFetchIpnsRecordFromProviders, c as readFreshCachedIpnsRecordFromPubsubLocalStore, i as connectToPubsubPeers, l as selectBitswapSessionSeedPeers, n as REACHABILITY_DOCS_URL, o as fetchBlockWithStalledSessionFailover, r as cacheIpnsRecordInPubsubLocalStore, s as getHeliaDebugContext, u as summarizeProviderReachability } from "./util-DRSzW-LU.js";
4
4
  import { t as map } from "./src-Cpx2Sts8.js";
5
5
  import { t as parallelBatch } from "./src-DKntVmyX.js";
6
6
  import { fileURLToPath } from "node:url";
@@ -1,7 +1,7 @@
1
1
  import { i as __toESM } from "./chunk-2rV9d50f.js";
2
- import { Ar as t$2, At as pTimeout, B as pubsubTopicToDhtKey, Bn as CommentUpdateSchema, Br as logger_default, Bt as DecryptedChallengeRequestPublicationSchema, C as hideClassPrivateProps, Cr as e, Dn as VotePubsubReservedFields, Dt as untrackUpdatingCommunity, En as VotePubsubMessagePublicationSchema, Er as t$3, F as isLinkOfVideo, Ft as ChallengeRequestMessageSchema, G as removeBlocksFromKuboNode, Hn as CommentUpdateTableRowSchema, I as isLinkValid, J as removeNullUndefinedValues, K as removeMfsFilesSafely, Lt as ChallengeVerificationMessageSchema, M as isLinkOfAudio, Mn as CommentIpfsSchema, Mr as require_retry, N as isLinkOfImage, Nn as CommentPubsubMessageReservedFields, Nt as ChallengeMessageSchema, Ot as require_sha256, P as isLinkOfMedia, Q as retryKuboBlockPutPinAndProvidePubsubTopic, Qn as CommentEditReservedFields, Rr as PKCError, Sr as e$1, St as trackStartedCommunity, T as ipnsNameToIpnsOverPubsubTopic, Tr as r$1, Tt as untrackStartedCommunity, Un as CommentsTableRowSchema, Vt as DecryptedChallengeRequestSchema, Xn as CommentEditPubsubMessagePublicationSchema, Yt as version_default, Zn as CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema, Zt as CommunityEditPublicationPubsubReservedFields, _ as genToArray, _r as n$3, an as CommentModerationsTableRowSchema, ar as AuthorReservedFields, b as getIpnsRecordInLocalKuboNode, br as t$5, c as contentContainsMarkdownImages, ct as withSortedKeys, dt as findCommunityInRegistry, er as CommentEditsTableRowSchema, et as retryKuboIpfsAddAndProvide, f as derivePublicationFromChallengeRequest, ft as findStartedCommunity, g as findMalformedUnicodeString, gr as isStringDomain, hn as CommunitySignedPropertyNames, i as calculateStringSizeSameAsIpfsAddCidV0, it as statMfsPathSafely, j as isLinkOfAnimatedImage, jt as ChallengeAnswerMessageSchema, kn as VoteTablesRowSchema, kr as t$4, l as contentContainsMarkdownVideos, lt as withSortedKeysDeep, mn as CommunityIpfsSchema, mt as findUpdatingCommunity, ni as ZodError, nn as CommentModerationPubsubMessagePublicationSchema, o as calculateUnixFsDagSizeCidV0, ot as timestamp, p as doesDomainAddressHaveCapitalLetter, r as calculateIpfsCidV0, rn as CommentModerationReservedFields, rt as sleepUntilTimeoutOrAbort, s as contentContainsMarkdownAudio, ut as writeKuboFilesWithTimeout, v as getEquivalentCommunityAddresses, vr as t$7, wt as trackUpdatingCommunity, xr as t$6, xt as syncCommunityRegistryEntry, y as getErrorCodeFromMessage, yr as n$2, zr as messages } from "./util-D6z8nIoj.js";
3
- import { $ as createSchemaRowParser, An as verifyChallengeAnswer, Bn as verifyCommunityEdit, Br as t$8, Cr as getThumbnailPropsOfLink, Dr as moveCommunityDbToDeletedDirectory, Dt as parseJsonWithPKCErrorIfFails, En as signCommunity, Fn as verifyCommentIpfs, Fr as isCommunityStartLocked, Gr as stringify, Hn as verifyVote, Hr as n$4, In as verifyCommentModeration, Ir as require_src, Kn as getAuthorNameFromWire, Ln as verifyCommentPubsubMessage, Lr as t$10, Mn as verifyChallengeRequest, Mr as findCommunitiesEntry, N as MAX_PAGE_SIZE_BYTES, Or as refreshCommunitiesList, Pn as verifyCommentEdit, Q as collectSchemaRowCoercions, Qn as effectiveMaxCrosspostDepth, Rn as verifyCommentUpdate, Rr as t$11, S as MAX_FILE_SIZE_BYTES_FOR_COMMUNITY_IPFS, Sn as signCommentEdit, Tn as signCommentUpdateForChallengeVerification, Un as buildRuntimeAuthor, Vr as n$5, W as pLimit, Wn as cleanWireAuthor, Wr as t$9, X as coerceSchemaRowBoolean, Xr as STORAGE_KEYS, Z as coerceSchemaRowJson, Zn as crosspostChainDepthUpTo, Zr as require_lodash_merge, _ as createAuthorIdentityMatcher, _r as deriveCommentIpfsFromCommentTableRow, a as generatePagesReportingFailedSorts, ar as encode, b as KeyvBetterSqlite3, bn as signChallengeVerification, c as resolvePageSortsOrThrow, cn as SignerWithPublicKeyAddress, cr as getPKCAddressFromPublicKey, d as getChallengeVerification, dr as BackupAbortError, dt as parseCommunityEditOptionsSchemaWithPKCErrorIfItFails, f as getCommunityChallengeFromCommunityChallengeSettings, fn as decryptEd25519AesGcmPublicKeyBuffer, fr as backupCommunityDb, g as authorNameResolveFailureReason, gn as cleanUpBeforePublishing, gr as deleteOldCommunityInWindows, h as authorIdentityMatcherForRequest, hn as _validateSignatureOfPKCRecord, i as derivePublicPageSorts, ir as decode, j as iterateOverPageCidsToFindAllCids, kr as resolveDbPostsCidRefs, lr as getPKCAddressFromPublicKeySync, m as pkcJsChallenges, mn as encryptEd25519AesGcmPublicKeyBuffer, mr as calculateInlineRepliesBudget, nr as getCommunityPublicKeyFromWire, o as loadPageSortsForStartedCommunity, p as loadChallengeFileFromCommunityChallengeSettings, pr as calculateExpectedSignatureSize, pt as parseCommunityIpfsSchemaPassthroughWithPKCErrorIfItFails, r as computePageSortsFingerprint, s as lookupPageSortFactories, sr as getIpfsKeyFromPrivateKey, t as RpcLocalCommunity, tr as getCommunityNameFromWire, u as deriveCommunityChallengesOrThrow, ur as getPublicKeyFromPrivateKey, v as TrackedInstanceRegistry, vn as signChallengeMessage, vr as deriveDbPosts, w as TIMEFRAMES_TO_SECONDS, wn as signCommentUpdate, wr as importSignerIntoKuboNode, wt as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, xn as signComment, xr as getDefaultCommunityDbConfig, y as LRUCache, yr as deriveDbReplies, zn as verifyCommunity, zr as r$2 } from "./rpc-local-community-DVykDP0T.js";
4
- import { a as scorePageCommentsWithFile, i as partitionPageCommentsForSort, n as filterRepliesForPageSort, o as stripRepliesFromPageComment, r as orderPageCommentsByScore, t as createDescendantsLookup } from "./page-sort-scoring-Bsc4MAy1.js";
2
+ import { Ar as t$2, At as pTimeout, B as pubsubTopicToDhtKey, Bn as CommentUpdateSchema, Br as logger_default, Bt as DecryptedChallengeRequestPublicationSchema, C as hideClassPrivateProps, Cr as e, Dn as VotePubsubReservedFields, Dt as untrackUpdatingCommunity, En as VotePubsubMessagePublicationSchema, Er as t$3, F as isLinkOfVideo, Ft as ChallengeRequestMessageSchema, G as removeBlocksFromKuboNode, Hn as CommentUpdateTableRowSchema, I as isLinkValid, J as removeNullUndefinedValues, K as removeMfsFilesSafely, Lt as ChallengeVerificationMessageSchema, M as isLinkOfAudio, Mn as CommentIpfsSchema, Mr as require_retry, N as isLinkOfImage, Nn as CommentPubsubMessageReservedFields, Nt as ChallengeMessageSchema, Ot as require_sha256, P as isLinkOfMedia, Q as retryKuboBlockPutPinAndProvidePubsubTopic, Qn as CommentEditReservedFields, Rr as PKCError, Sr as e$1, St as trackStartedCommunity, T as ipnsNameToIpnsOverPubsubTopic, Tr as r$1, Tt as untrackStartedCommunity, Un as CommentsTableRowSchema, Vt as DecryptedChallengeRequestSchema, Xn as CommentEditPubsubMessagePublicationSchema, Yt as version_default, Zn as CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema, Zt as CommunityEditPublicationPubsubReservedFields, _ as genToArray, _r as n$3, an as CommentModerationsTableRowSchema, ar as AuthorReservedFields, b as getIpnsRecordInLocalKuboNode, br as t$5, c as contentContainsMarkdownImages, ct as withSortedKeys, dt as findCommunityInRegistry, er as CommentEditsTableRowSchema, et as retryKuboIpfsAddAndProvide, f as derivePublicationFromChallengeRequest, ft as findStartedCommunity, g as findMalformedUnicodeString, gr as isStringDomain, hn as CommunitySignedPropertyNames, i as calculateStringSizeSameAsIpfsAddCidV0, it as statMfsPathSafely, j as isLinkOfAnimatedImage, jt as ChallengeAnswerMessageSchema, kn as VoteTablesRowSchema, kr as t$4, l as contentContainsMarkdownVideos, lt as withSortedKeysDeep, mn as CommunityIpfsSchema, mt as findUpdatingCommunity, ni as ZodError, nn as CommentModerationPubsubMessagePublicationSchema, o as calculateUnixFsDagSizeCidV0, ot as timestamp, p as doesDomainAddressHaveCapitalLetter, r as calculateIpfsCidV0, rn as CommentModerationReservedFields, rt as sleepUntilTimeoutOrAbort, s as contentContainsMarkdownAudio, ut as writeKuboFilesWithTimeout, v as getEquivalentCommunityAddresses, vr as t$7, wt as trackUpdatingCommunity, xr as t$6, xt as syncCommunityRegistryEntry, y as getErrorCodeFromMessage, yr as n$2, zr as messages } from "./util-Bnqvxk-6.js";
3
+ import { $ as createSchemaRowParser, An as verifyChallengeAnswer, Bn as verifyCommunityEdit, Br as t$8, Cr as getThumbnailPropsOfLink, Dr as moveCommunityDbToDeletedDirectory, Dt as parseJsonWithPKCErrorIfFails, En as signCommunity, Fn as verifyCommentIpfs, Fr as isCommunityStartLocked, Gr as stringify, Hn as verifyVote, Hr as n$4, In as verifyCommentModeration, Ir as require_src, Kn as getAuthorNameFromWire, Ln as verifyCommentPubsubMessage, Lr as t$10, Mn as verifyChallengeRequest, Mr as findCommunitiesEntry, N as MAX_PAGE_SIZE_BYTES, Or as refreshCommunitiesList, Pn as verifyCommentEdit, Q as collectSchemaRowCoercions, Qn as effectiveMaxCrosspostDepth, Rn as verifyCommentUpdate, Rr as t$11, S as MAX_FILE_SIZE_BYTES_FOR_COMMUNITY_IPFS, Sn as signCommentEdit, Tn as signCommentUpdateForChallengeVerification, Un as buildRuntimeAuthor, Vr as n$5, W as pLimit, Wn as cleanWireAuthor, Wr as t$9, X as coerceSchemaRowBoolean, Xr as STORAGE_KEYS, Z as coerceSchemaRowJson, Zn as crosspostChainDepthUpTo, Zr as require_lodash_merge, _ as createAuthorIdentityMatcher, _r as deriveCommentIpfsFromCommentTableRow, a as generatePagesReportingFailedSorts, ar as encode, b as KeyvBetterSqlite3, bn as signChallengeVerification, c as resolvePageSortsOrThrow, cn as SignerWithPublicKeyAddress, cr as getPKCAddressFromPublicKey, d as getChallengeVerification, dr as BackupAbortError, dt as parseCommunityEditOptionsSchemaWithPKCErrorIfItFails, f as getCommunityChallengeFromCommunityChallengeSettings, fn as decryptEd25519AesGcmPublicKeyBuffer, fr as backupCommunityDb, g as authorNameResolveFailureReason, gn as cleanUpBeforePublishing, gr as deleteOldCommunityInWindows, h as authorIdentityMatcherForRequest, hn as _validateSignatureOfPKCRecord, i as derivePublicPageSorts, ir as decode, j as iterateOverPageCidsToFindAllCids, kr as resolveDbPostsCidRefs, lr as getPKCAddressFromPublicKeySync, m as pkcJsChallenges, mn as encryptEd25519AesGcmPublicKeyBuffer, mr as calculateInlineRepliesBudget, nr as getCommunityPublicKeyFromWire, o as loadPageSortsForStartedCommunity, p as loadChallengeFileFromCommunityChallengeSettings, pr as calculateExpectedSignatureSize, pt as parseCommunityIpfsSchemaPassthroughWithPKCErrorIfItFails, r as computePageSortsFingerprint, s as lookupPageSortFactories, sr as getIpfsKeyFromPrivateKey, t as RpcLocalCommunity, tr as getCommunityNameFromWire, u as deriveCommunityChallengesOrThrow, ur as getPublicKeyFromPrivateKey, v as TrackedInstanceRegistry, vn as signChallengeMessage, vr as deriveDbPosts, w as TIMEFRAMES_TO_SECONDS, wn as signCommentUpdate, wr as importSignerIntoKuboNode, wt as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, xn as signComment, xr as getDefaultCommunityDbConfig, y as LRUCache, yr as deriveDbReplies, zn as verifyCommunity, zr as r$2 } from "./rpc-local-community-BK_HGb_u.js";
4
+ import { a as scorePageCommentsWithFile, i as partitionPageCommentsForSort, n as filterRepliesForPageSort, o as stripRepliesFromPageComment, r as orderPageCommentsByScore, t as createDescendantsLookup } from "./page-sort-scoring-DgSzIxmE.js";
5
5
  import { fileURLToPath, pathToFileURL } from "node:url";
6
6
  import path from "node:path";
7
7
  import os from "os";
@@ -223,6 +223,7 @@ const DUPLICATE_PUBLICATION_ERRORS = new Set([
223
223
  messages.ERR_DUPLICATE_COMMENT_MODERATION
224
224
  ]);
225
225
  const CHALLENGE_EXCHANGE_TTL_MS = 600 * 1e3;
226
+ const SLOW_GET_CHALLENGE_WARNING_MS = 60 * 1e3;
226
227
  const defaultChallengeQuestionText = "What is the answer to this community's challenge? (check community.settings.challenges to see the answer, or set your own challenge)";
227
228
  function generateDefaultChallenges(answer) {
228
229
  return [{
@@ -998,15 +999,17 @@ async function getDbInternalState(community, lock) {
998
999
  if (lockedIt) await community._dbHandler.unlockCommunityState();
999
1000
  }
1000
1001
  }
1001
- async function updateDbInternalState(community, props) {
1002
+ async function updateDbInternalState(community, propsOrBuildProps) {
1002
1003
  const log = logger_default("pkc-js:local-community:_updateDbInternalState");
1003
- if (e(props)) throw Error("props to update DB internal state should not be empty");
1004
+ if (typeof propsOrBuildProps !== "function" && e(propsOrBuildProps)) throw Error("props to update DB internal state should not be empty");
1004
1005
  await community._dbHandler.initDbIfNeeded();
1005
- props._internalStateUpdateId = v4();
1006
+ let props = typeof propsOrBuildProps === "function" ? {} : propsOrBuildProps;
1006
1007
  let lockedIt = false;
1007
1008
  try {
1008
1009
  await community._dbHandler.lockCommunityState();
1009
1010
  lockedIt = true;
1011
+ if (typeof propsOrBuildProps === "function") props = propsOrBuildProps();
1012
+ props._internalStateUpdateId = v4();
1010
1013
  const internalStateBefore = await community._getDbInternalState(false);
1011
1014
  const propsToStore = "posts" in props && props.posts ? {
1012
1015
  ...props,
@@ -6437,7 +6440,7 @@ async function publishCommunityRecordToIpns(community, build, newCommunityRecord
6437
6440
  }
6438
6441
  community._combinedHashOfPendingCommentsCids = newModQueue?.combinedHashOfCids || (0, import_sha256.sha256)("");
6439
6442
  log.trace("Updated combined hash of pending comments to", community._combinedHashOfPendingCommentsCids);
6440
- await community._updateDbInternalState(community.toJSONInternalAfterFirstUpdate());
6443
+ await community._updateDbInternalState(() => community.toJSONInternalAfterFirstUpdate());
6441
6444
  community._changeStateEmitEventEmitStateChangeEvent({
6442
6445
  newStartedState: "succeeded",
6443
6446
  event: {
@@ -6663,9 +6666,33 @@ async function emitChallengeSettingsValidationErrors(community, log) {
6663
6666
  community.emit("error", error);
6664
6667
  }
6665
6668
  }
6669
+ async function runAsStartOrUpdateInFlight({ community, setUp }) {
6670
+ let settle;
6671
+ const inFlight = new Promise((resolve) => settle = resolve);
6672
+ community._startOrUpdateInFlight = inFlight;
6673
+ const releaseMark = () => {
6674
+ if (community._startOrUpdateInFlight === inFlight) community._startOrUpdateInFlight = void 0;
6675
+ };
6676
+ try {
6677
+ await setUp(releaseMark);
6678
+ } finally {
6679
+ releaseMark();
6680
+ settle();
6681
+ }
6682
+ }
6666
6683
  async function start(community) {
6667
- const log = logger_default("pkc-js:local-community:start");
6668
6684
  if (community.state === "updating") throw new PKCError("ERR_NEED_TO_STOP_UPDATING_COMMUNITY_BEFORE_STARTING", { address: community.address });
6685
+ if (community.state === "started" || community._startOrUpdateInFlight) throw new PKCError("ERR_COMMUNITY_ALREADY_STARTED", { address: community.address });
6686
+ await runAsStartOrUpdateInFlight({
6687
+ community,
6688
+ setUp: (releaseMark) => startCommunity({
6689
+ community,
6690
+ releaseMark
6691
+ })
6692
+ });
6693
+ }
6694
+ async function startCommunity({ community, releaseMark }) {
6695
+ const log = logger_default("pkc-js:local-community:start");
6669
6696
  community._stopHasBeenCalled = false;
6670
6697
  community._firstUpdateAfterStart = true;
6671
6698
  community._lastProvidedBrowserDialableSelfAddrs = void 0;
@@ -6689,9 +6716,9 @@ async function start(community) {
6689
6716
  pkc: community._pkc,
6690
6717
  communityAddress: community.address
6691
6718
  });
6719
+ await community._dbHandler.lockCommunityStart();
6692
6720
  community._setState("started");
6693
6721
  await community._updateStartedValue();
6694
- await community._dbHandler.lockCommunityStart();
6695
6722
  trackStartedCommunity(community._pkc, community);
6696
6723
  syncProcessStartedCommunity(community);
6697
6724
  await community._updateStartedValue();
@@ -6718,7 +6745,9 @@ async function start(community) {
6718
6745
  community._pageSortFactories = void 0;
6719
6746
  await syncPageSortsWithRegistry(community);
6720
6747
  } catch (e) {
6748
+ releaseMark();
6721
6749
  await community.stop();
6750
+ if (community.state === "stopped" && !community._startOrUpdateInFlight) community._dbHandler.destoryConnection();
6722
6751
  e.details = {
6723
6752
  ...e.details,
6724
6753
  communityAddress: community.address
@@ -6845,19 +6874,40 @@ async function updateLoop(community) {
6845
6874
  async function update(community) {
6846
6875
  if (community.state === "started") throw new PKCError("ERR_COMMUNITY_ALREADY_STARTED", { address: community.address });
6847
6876
  if (community.state === "updating") return;
6848
- community._stopHasBeenCalled = false;
6849
- community._setState("updating");
6877
+ if (community._startOrUpdateInFlight) throw new PKCError("ERR_COMMUNITY_ALREADY_STARTED", { address: community.address });
6878
+ await runAsStartOrUpdateInFlight({
6879
+ community,
6880
+ setUp: async () => {
6881
+ community._stopHasBeenCalled = false;
6882
+ community._setState("updating");
6883
+ try {
6884
+ await updateOnce(community);
6885
+ } catch (e) {
6886
+ community.emit("error", e);
6887
+ }
6888
+ community._updateLoopAbortController = new AbortController();
6889
+ community._updateLoopPromise = updateLoop(community);
6890
+ }
6891
+ });
6892
+ }
6893
+ async function stop(community) {
6894
+ community._stopHasBeenCalled = true;
6895
+ while (community._startOrUpdateInFlight || community._stopInFlight || community._editStoresInFlight.size > 0) {
6896
+ await (community._startOrUpdateInFlight ?? community._stopInFlight ?? Promise.allSettled([...community._editStoresInFlight]));
6897
+ community._stopHasBeenCalled = true;
6898
+ }
6899
+ let settle;
6900
+ const stopInFlight = new Promise((resolve) => settle = resolve);
6901
+ community._stopInFlight = stopInFlight;
6850
6902
  try {
6851
- await updateOnce(community);
6852
- } catch (e) {
6853
- community.emit("error", e);
6903
+ await stopCommunity(community);
6904
+ } finally {
6905
+ if (community._stopInFlight === stopInFlight) community._stopInFlight = void 0;
6906
+ settle();
6854
6907
  }
6855
- community._updateLoopAbortController = new AbortController();
6856
- community._updateLoopPromise = updateLoop(community);
6857
6908
  }
6858
- async function stop(community) {
6909
+ async function stopCommunity(community) {
6859
6910
  const log = logger_default("pkc-js:local-community:stop");
6860
- community._stopHasBeenCalled = true;
6861
6911
  if (community._updateLoopAbortController) community._updateLoopAbortController.abort();
6862
6912
  community.posts._stop();
6863
6913
  if (community.state === "started") {
@@ -6883,7 +6933,7 @@ async function stop(community) {
6883
6933
  log.error("Failed to unpin stale cids and remove mfs paths before stopping", e);
6884
6934
  }
6885
6935
  try {
6886
- await updateDbInternalState(community, community.updateCid ? community.toJSONInternalAfterFirstUpdate() : community.toJSONInternalBeforeFirstUpdate());
6936
+ await updateDbInternalState(community, () => community.updateCid ? community.toJSONInternalAfterFirstUpdate() : community.toJSONInternalBeforeFirstUpdate());
6887
6937
  } catch (e) {
6888
6938
  log.error("Failed to update db internal state before stopping", e);
6889
6939
  }
@@ -7175,10 +7225,21 @@ async function editPropsOnStartedCommunity(community, parsedEditOptions, pagesEd
7175
7225
  editId: uniqueEditId
7176
7226
  });
7177
7227
  await community.start();
7178
- } else community._pendingEditProps.push({
7179
- ...parsedEditOptions,
7180
- editId: uniqueEditId
7181
- });
7228
+ } else {
7229
+ if (!e(parsedEditOptions)) {
7230
+ const store = updateDbInternalState(community, { ...parsedEditOptions });
7231
+ community._editStoresInFlight.add(store);
7232
+ try {
7233
+ await store;
7234
+ } finally {
7235
+ community._editStoresInFlight.delete(store);
7236
+ }
7237
+ }
7238
+ community._pendingEditProps.push({
7239
+ ...parsedEditOptions,
7240
+ editId: uniqueEditId
7241
+ });
7242
+ }
7182
7243
  if (community.updateCid) await community.initInternalCommunityAfterFirstUpdateNoMerge({
7183
7244
  ...community.toJSONInternalAfterFirstUpdate(),
7184
7245
  ...parsedEditOptions,
@@ -7224,6 +7285,7 @@ async function editPropsOnNotStartedCommunity(community, parsedEditOptions, page
7224
7285
  return community;
7225
7286
  }
7226
7287
  async function edit(community, newCommunityOptions) {
7288
+ while (community._stopInFlight) await community._stopInFlight;
7227
7289
  const startedCommunity = findStartedCommunity(community._pkc, {
7228
7290
  publicKey: community.publicKey,
7229
7291
  name: community.name
@@ -7254,6 +7316,7 @@ async function edit(community, newCommunityOptions) {
7254
7316
  ...n$2(editWithDerivedName, ["roles"]),
7255
7317
  ...newInternalProps
7256
7318
  };
7319
+ if (community._stopInFlight) return edit(community, newCommunityOptions);
7257
7320
  if (!community.started && !startedCommunity) return editPropsOnNotStartedCommunity(community, newProps, pagesEdit);
7258
7321
  if (findStartedCommunity(community._pkc, {
7259
7322
  publicKey: community.publicKey,
@@ -7476,6 +7539,7 @@ var LocalCommunity = class extends RpcLocalCommunity {
7476
7539
  this._inFlightPublicationExchanges = /* @__PURE__ */ new Map();
7477
7540
  this._pseudonymityAliasLocks = /* @__PURE__ */ new Map();
7478
7541
  this._challengeExchangeTtlMs = CHALLENGE_EXCHANGE_TTL_MS;
7542
+ this._slowGetChallengeWarningMs = SLOW_GET_CHALLENGE_WARNING_MS;
7479
7543
  this._cidsToUnPin = /* @__PURE__ */ new Set();
7480
7544
  this._mfsPathsToRemove = /* @__PURE__ */ new Set();
7481
7545
  this._communityUpdateTriggerValue = false;
@@ -7486,6 +7550,9 @@ var LocalCommunity = class extends RpcLocalCommunity {
7486
7550
  this._reportedChallengeLoadFailures = void 0;
7487
7551
  this._publishLoopPromise = void 0;
7488
7552
  this._updateLoopPromise = void 0;
7553
+ this._startOrUpdateInFlight = void 0;
7554
+ this._stopInFlight = void 0;
7555
+ this._editStoresInFlight = /* @__PURE__ */ new Set();
7489
7556
  this._firstUpdateAfterStart = true;
7490
7557
  this._internalStateUpdateId = "";
7491
7558
  this._lastPubsubTopicRoutingProvideAt = void 0;
@@ -1,2 +1,2 @@
1
- import { n as createNewLocalCommunityDb, r as updateInstancePropsWithStartedCommunityOrDb, t as LocalCommunity } from "./local-community-UB_rVgR9.js";
1
+ import { n as createNewLocalCommunityDb, r as updateInstancePropsWithStartedCommunityOrDb, t as LocalCommunity } from "./local-community-BY1ouP1-.js";
2
2
  export { LocalCommunity, createNewLocalCommunityDb, updateInstancePropsWithStartedCommunityOrDb };
@@ -1,7 +1,7 @@
1
1
  import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-2rV9d50f.js";
2
- import { $ as retryKuboIpfsAdd, At as pTimeout, Bn as CommentUpdateSchema, Br as logger_default, C as hideClassPrivateProps, Cr as e$1, Ct as trackUpdatingComment, D as isIpfsCid, Dt as untrackUpdatingCommunity, E as isAbortError, Et as untrackUpdatingComment, Ft as ChallengeRequestMessageSchema, Ln as CommentUpdateForChallengeVerificationSchema, Lt as ChallengeVerificationMessageSchema, Mn as CommentIpfsSchema, Mr as require_retry$1, Nr as FailedToFetchCommentIpfsFromGatewaysError, Nt as ChallengeMessageSchema, Ot as require_sha256, Pr as FailedToFetchCommentUpdateFromGatewaysError, Rr as PKCError, Sn as PubsubTopicSchema, Sr as e, T as ipnsNameToIpnsOverPubsubTopic, Tr as r, U as rejectWhenAbortSignalFires, Ur as setErrorMap, W as rejectWhenCommunityStopsOrAborts, X as replaceXWithY, Y as removeUndefinedValuesRecursively, Yt as version_default, Z as resolveWhenPredicateIsTrue, _r as n$2, _t as listUpdatingComments, a as calculateStringSizeSameAsIpfsAddCidV0Sync, at as throwIfAbortSignalAborted, d as deepMergeRuntimeFields, et as retryKuboIpfsAddAndProvide, ft as findStartedCommunity, gr as isStringDomain, gt as listStartedCommunities, i as calculateStringSizeSameAsIpfsAddCidV0, jt as ChallengeAnswerMessageSchema, k as isIpns, kt as TimeoutError, ln as CommunityAnchorSchema, mn as CommunityIpfsSchema, mt as findUpdatingCommunity, nt as shortifyCid, ot as timestamp, p as doesDomainAddressHaveCapitalLetter, pt as findUpdatingComment, r as calculateIpfsCidV0, ri as en_default, rt as sleepUntilTimeoutOrAbort, st as waitForUpdateInCommunityInstanceWithErrorAndTimeout, tt as shortifyAddress, u as createAbortError, vt as listUpdatingCommunities, x as getPostUpdateTimestampRange, xr as t$1, yr as n$1, yt as refreshTrackedCommentAliases, z as linkAbortSignals, zr as messages } from "./util-D6z8nIoj.js";
3
- import { $n as buildRuntimeCommunityFields, $t as RpcPublishCommunityListParamSchema, A as findCommentInParsedPages, Ar as setNativeFunctions$1, At as parseRpcCommentUpdateEventWithPKCErrorIfItFails, B as GenericStateClient, Bn as verifyCommunityEdit, Br as t$3, Bt as RpcCommunityIdentifierParamSchema, C as RepliesPages, Cn as signCommentModeration, Ct as parseCreateVoteOptionsSchemaWithPKCErrorIfItFails, D as extractCommunityRuntimeFieldsFromParsedPages, Dn as signCommunityEdit, Dt as parseJsonWithPKCErrorIfFails, Er as monitorCommunitiesDirectory, Et as parseDecryptedChallengeWithPKCErrorIfItFails, F as cloneCrosspostForRuntime, Fn as verifyCommentIpfs, Ft as RpcAuthorNameParamSchema, G as PKCTypedEmitter, Gn as getAuthorNameFromRuntime, Gt as RpcExportCommunityParamSchema, H as InflightResourceTypes, Hn as verifyVote, Ht as RpcEditCommunityParamSchema, I as collectCrosspostAuthorsToResolve, In as verifyCommentModeration, It as RpcCancelExportParamSchema, J as decodeRpcChallengeRequestPubsubMsg, Jn as CreateCommunityListWithCidOptionsSchema, Jr as NAME_RESOLVED_TRUE_TTL_MS, Jt as RpcFetchCidResultSchema, K as decodeRpcChallengeAnswerPubsubMsg, Kn as getAuthorNameFromWire, Kr as MAX_FILE_SIZE_BYTES_FOR_COMMENT_UPDATE, Kt as RpcExportCommunityResultSchema, Ln as verifyCommentPubsubMessage, Lr as t$5, Lt as RpcCidParamSchema, M as parseRawPages, Mr as findCommunitiesEntry, Nn as verifyChallengeVerification, Nr as toCommunitiesEntry, Nt as parseVotePubsubMessagePublicationSchemaWithPKCErrorIfItFails, O as findCommentInPageInstance, On as signCommunityList, Ot as parsePKCUserOptionsSchemaWithPKCErrorIfItFails, P as applyNameResolvedCacheToCrosspost, Pn as verifyCommentEdit, Pt as RpcAnchorPublishPreparationResultSchema, Qr as nativeFunctions$2, Qt as RpcPublishChallengeAnswersParamSchema, R as stripNameResolvedFromCrosspost, Rn as verifyCommentUpdate, Rt as RpcCommentRepliesPageParamSchema, Sn as signCommentEdit, Sr as getDefaultDataPath, St as parseCreateRpcCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, Tr as listCommunitiesSync, Tt as parseDecryptedChallengeVerification, Un as buildRuntimeAuthor, Ur as t$2, Ut as RpcExportCommunityModLogsParamSchema, V as InflightFetchManager, Vn as verifyCommunityList, Vr as n$3, Vt as RpcCommunityPageParamSchema, Wn as cleanWireAuthor, Wr as t$4, Wt as RpcExportCommunityModLogsResultSchema, Xn as MAX_COMMUNITY_LIST_SIZE_BYTES, Xt as RpcFetchCommunityListResultSchema, Y as decodeRpcChallengeVerificationPubsubMsg, Yn as CreateNewCommunityListOptionsSchema, Yr as NAME_RESOLVE_FAILED_RETRY_FLOOR_MS, Yt as RpcFetchCommunityListParamSchema, Zt as RpcPublishAnchorRecordParamSchema, _n as signChallengeAnswer, _t as parseCreateCommentOptionsSchemaWithPKCErrorIfItFails, an as RpcUnsubscribeParamSchema, b as KeyvBetterSqlite3, br as findLocalCommunityAddress, ct as parseCommentUpdateSchemaWithPKCErrorIfItFails, dn as decryptEd25519AesGcm, en as RpcPublishCommunityListResultSchema, er as getCommunityAddressFromRecord, et as parseCidStringSchemaWithPKCErrorIfItFails, ft as parseCommunityEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails, gn as cleanUpBeforePublishing, gt as parseCreateCommentModerationOptionsSchemaWithPKCErrorIfItFails, hr as createKuboRpcClient, ht as parseCreateCommentEditOptionsSchemaWithPKCErrorIfItFails, in as RpcSuccessResultSchema, ir as decode, it as parseCommentIpfsSchemaWithPKCErrorIfItFails, jn as verifyChallengeMessage, jr as tryToDeleteCommunitiesThatFailedToBeDeletedBefore, jt as parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails, k as findCommentInPageInstanceRecursively, kn as signVote, kt as parseRpcCommentEventWithPKCErrorIfItFails, l as pkcJsPageSorts, ln as createSigner, lr as getPKCAddressFromPublicKeySync, lt as parseCommunityAddressWithPKCErrorIfItFails, m as pkcJsChallenges, mt as parseCommunityListSchemaWithPKCErrorIfItFails, n as RpcRemoteCommunity, nn as RpcResolveAuthorNameResultSchema, nr as getCommunityPublicKeyFromWire, on as findCommunityRecordNameMismatch, or as getBufferedPKCAddressFromPublicKey, ot as parseCommentModerationPubsubMessagePublicationSchemaWithPKCErrorIfItFails, pn as encryptEd25519AesGcm, q as decodeRpcChallengePubsubMsg, qn as normalizeCreatePublicationAuthor, qr as NAME_RESOLVED_FALSE_TTL_MS, qt as RpcFetchCidParamSchema, rn as RpcSubscriptionIdResultSchema, rr as normalizeCommunityInputFromCommunity, rt as parseCommentEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails, sn as require_lib$1, st as parseCommentPubsubMessagePublicationWithPKCErrorIfItFails, t as RpcLocalCommunity, tn as RpcPublishedAnchorRecordResultSchema, tr as getCommunityNameFromWire, un as createAnchorIpnsRecord$1, v as TrackedInstanceRegistry, vt as parseCreateCommunityEditPublicationOptionsSchemaWithPKCErrorIfItFails, wt as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, x as RemoteCommunity, xn as signComment, xt as parseCreateRemoteCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, y as LRUCache, yn as signChallengeRequest, z as PKCClientsManager, zt as RpcCommunitiesChangeEventResultSchema } from "./rpc-local-community-DVykDP0T.js";
4
- import { s as getHeliaDebugContext } from "./util-BxfB5cRB.js";
2
+ import { $ as retryKuboIpfsAdd, At as pTimeout, Bn as CommentUpdateSchema, Br as logger_default, C as hideClassPrivateProps, Cr as e$1, Ct as trackUpdatingComment, D as isIpfsCid, Dt as untrackUpdatingCommunity, E as isAbortError, Et as untrackUpdatingComment, Ft as ChallengeRequestMessageSchema, Ln as CommentUpdateForChallengeVerificationSchema, Lt as ChallengeVerificationMessageSchema, Mn as CommentIpfsSchema, Mr as require_retry$1, Nr as FailedToFetchCommentIpfsFromGatewaysError, Nt as ChallengeMessageSchema, Ot as require_sha256, Pr as FailedToFetchCommentUpdateFromGatewaysError, Rr as PKCError, Sn as PubsubTopicSchema, Sr as e, T as ipnsNameToIpnsOverPubsubTopic, Tr as r, U as rejectWhenAbortSignalFires, Ur as setErrorMap, W as rejectWhenCommunityStopsOrAborts, X as replaceXWithY, Y as removeUndefinedValuesRecursively, Yt as version_default, Z as resolveWhenPredicateIsTrue, _r as n$2, _t as listUpdatingComments, a as calculateStringSizeSameAsIpfsAddCidV0Sync, at as throwIfAbortSignalAborted, d as deepMergeRuntimeFields, et as retryKuboIpfsAddAndProvide, ft as findStartedCommunity, gr as isStringDomain, gt as listStartedCommunities, i as calculateStringSizeSameAsIpfsAddCidV0, jt as ChallengeAnswerMessageSchema, k as isIpns, kt as TimeoutError, ln as CommunityAnchorSchema, mn as CommunityIpfsSchema, mt as findUpdatingCommunity, nt as shortifyCid, ot as timestamp, p as doesDomainAddressHaveCapitalLetter, pt as findUpdatingComment, r as calculateIpfsCidV0, ri as en_default, rt as sleepUntilTimeoutOrAbort, st as waitForUpdateInCommunityInstanceWithErrorAndTimeout, tt as shortifyAddress, u as createAbortError, vt as listUpdatingCommunities, x as getPostUpdateTimestampRange, xr as t$1, yr as n$1, yt as refreshTrackedCommentAliases, z as linkAbortSignals, zr as messages } from "./util-Bnqvxk-6.js";
3
+ import { $n as buildRuntimeCommunityFields, $t as RpcPublishCommunityListParamSchema, A as findCommentInParsedPages, Ar as setNativeFunctions$1, At as parseRpcCommentUpdateEventWithPKCErrorIfItFails, B as GenericStateClient, Bn as verifyCommunityEdit, Br as t$3, Bt as RpcCommunityIdentifierParamSchema, C as RepliesPages, Cn as signCommentModeration, Ct as parseCreateVoteOptionsSchemaWithPKCErrorIfItFails, D as extractCommunityRuntimeFieldsFromParsedPages, Dn as signCommunityEdit, Dt as parseJsonWithPKCErrorIfFails, Er as monitorCommunitiesDirectory, Et as parseDecryptedChallengeWithPKCErrorIfItFails, F as cloneCrosspostForRuntime, Fn as verifyCommentIpfs, Ft as RpcAuthorNameParamSchema, G as PKCTypedEmitter, Gn as getAuthorNameFromRuntime, Gt as RpcExportCommunityParamSchema, H as InflightResourceTypes, Hn as verifyVote, Ht as RpcEditCommunityParamSchema, I as collectCrosspostAuthorsToResolve, In as verifyCommentModeration, It as RpcCancelExportParamSchema, J as decodeRpcChallengeRequestPubsubMsg, Jn as CreateCommunityListWithCidOptionsSchema, Jr as NAME_RESOLVED_TRUE_TTL_MS, Jt as RpcFetchCidResultSchema, K as decodeRpcChallengeAnswerPubsubMsg, Kn as getAuthorNameFromWire, Kr as MAX_FILE_SIZE_BYTES_FOR_COMMENT_UPDATE, Kt as RpcExportCommunityResultSchema, Ln as verifyCommentPubsubMessage, Lr as t$5, Lt as RpcCidParamSchema, M as parseRawPages, Mr as findCommunitiesEntry, Nn as verifyChallengeVerification, Nr as toCommunitiesEntry, Nt as parseVotePubsubMessagePublicationSchemaWithPKCErrorIfItFails, O as findCommentInPageInstance, On as signCommunityList, Ot as parsePKCUserOptionsSchemaWithPKCErrorIfItFails, P as applyNameResolvedCacheToCrosspost, Pn as verifyCommentEdit, Pt as RpcAnchorPublishPreparationResultSchema, Qr as nativeFunctions$2, Qt as RpcPublishChallengeAnswersParamSchema, R as stripNameResolvedFromCrosspost, Rn as verifyCommentUpdate, Rt as RpcCommentRepliesPageParamSchema, Sn as signCommentEdit, Sr as getDefaultDataPath, St as parseCreateRpcCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, Tr as listCommunitiesSync, Tt as parseDecryptedChallengeVerification, Un as buildRuntimeAuthor, Ur as t$2, Ut as RpcExportCommunityModLogsParamSchema, V as InflightFetchManager, Vn as verifyCommunityList, Vr as n$3, Vt as RpcCommunityPageParamSchema, Wn as cleanWireAuthor, Wr as t$4, Wt as RpcExportCommunityModLogsResultSchema, Xn as MAX_COMMUNITY_LIST_SIZE_BYTES, Xt as RpcFetchCommunityListResultSchema, Y as decodeRpcChallengeVerificationPubsubMsg, Yn as CreateNewCommunityListOptionsSchema, Yr as NAME_RESOLVE_FAILED_RETRY_FLOOR_MS, Yt as RpcFetchCommunityListParamSchema, Zt as RpcPublishAnchorRecordParamSchema, _n as signChallengeAnswer, _t as parseCreateCommentOptionsSchemaWithPKCErrorIfItFails, an as RpcUnsubscribeParamSchema, b as KeyvBetterSqlite3, br as findLocalCommunityAddress, ct as parseCommentUpdateSchemaWithPKCErrorIfItFails, dn as decryptEd25519AesGcm, en as RpcPublishCommunityListResultSchema, er as getCommunityAddressFromRecord, et as parseCidStringSchemaWithPKCErrorIfItFails, ft as parseCommunityEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails, gn as cleanUpBeforePublishing, gt as parseCreateCommentModerationOptionsSchemaWithPKCErrorIfItFails, hr as createKuboRpcClient, ht as parseCreateCommentEditOptionsSchemaWithPKCErrorIfItFails, in as RpcSuccessResultSchema, ir as decode, it as parseCommentIpfsSchemaWithPKCErrorIfItFails, jn as verifyChallengeMessage, jr as tryToDeleteCommunitiesThatFailedToBeDeletedBefore, jt as parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails, k as findCommentInPageInstanceRecursively, kn as signVote, kt as parseRpcCommentEventWithPKCErrorIfItFails, l as pkcJsPageSorts, ln as createSigner, lr as getPKCAddressFromPublicKeySync, lt as parseCommunityAddressWithPKCErrorIfItFails, m as pkcJsChallenges, mt as parseCommunityListSchemaWithPKCErrorIfItFails, n as RpcRemoteCommunity, nn as RpcResolveAuthorNameResultSchema, nr as getCommunityPublicKeyFromWire, on as findCommunityRecordNameMismatch, or as getBufferedPKCAddressFromPublicKey, ot as parseCommentModerationPubsubMessagePublicationSchemaWithPKCErrorIfItFails, pn as encryptEd25519AesGcm, q as decodeRpcChallengePubsubMsg, qn as normalizeCreatePublicationAuthor, qr as NAME_RESOLVED_FALSE_TTL_MS, qt as RpcFetchCidParamSchema, rn as RpcSubscriptionIdResultSchema, rr as normalizeCommunityInputFromCommunity, rt as parseCommentEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails, sn as require_lib$1, st as parseCommentPubsubMessagePublicationWithPKCErrorIfItFails, t as RpcLocalCommunity, tn as RpcPublishedAnchorRecordResultSchema, tr as getCommunityNameFromWire, un as createAnchorIpnsRecord$1, v as TrackedInstanceRegistry, vt as parseCreateCommunityEditPublicationOptionsSchemaWithPKCErrorIfItFails, wt as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, x as RemoteCommunity, xn as signComment, xt as parseCreateRemoteCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, y as LRUCache, yn as signChallengeRequest, z as PKCClientsManager, zt as RpcCommunitiesChangeEventResultSchema } from "./rpc-local-community-BK_HGb_u.js";
4
+ import { s as getHeliaDebugContext } from "./util-DRSzW-LU.js";
5
5
  import path from "path";
6
6
  import assert from "assert";
7
7
  import fs from "fs";
@@ -27973,6 +27973,9 @@ var Publication = class extends import_lib.TypedEmitter {
27973
27973
  return typeof exchange.challengeRequestPublishTimestamp === "number" && exchange.challengeRequestPublishTimestamp + this._setProviderFailureThresholdSeconds <= timestamp();
27974
27974
  });
27975
27975
  }
27976
+ _wasAnyChallengeRequestPublished() {
27977
+ return Object.values(this._challengeExchanges).some((exchange) => typeof exchange.challengeRequestPublishTimestamp === "number" && !exchange.challengeRequestPublishError);
27978
+ }
27976
27979
  async _abandonProviderIfStoppedWhileSubscribing(providerUrl) {
27977
27980
  if (!this._pkc.destroyed && this.state !== "stopped") return false;
27978
27981
  const log = logger_default("pkc-js:publication:publish:_abandonProviderIfStoppedWhileSubscribing");
@@ -28254,8 +28257,15 @@ var Publication = class extends import_lib.TypedEmitter {
28254
28257
  return;
28255
28258
  }
28256
28259
  if (this._isAllAttemptsExhausted(providers.length)) {
28260
+ const aRequestWasPublished = this._wasAnyChallengeRequestPublished();
28257
28261
  await this._postSucessOrFailurePublishing();
28258
- const allAttemptsFailedError = new PKCError("ERR_ALL_PUBSUB_PROVIDERS_THROW_ERRORS", {
28262
+ const allAttemptsFailedError = aRequestWasPublished ? new PKCError("ERR_PUBSUB_DID_NOT_RECEIVE_RESPONSE_AFTER_PUBLISHING_CHALLENGE_REQUEST", {
28263
+ challengeExchanges: this._challengeExchangesFormattedForErrors(),
28264
+ pubsubTopic: this._community?.pubsubTopic,
28265
+ publishToDifferentProviderThresholdSeconds: this._publishToDifferentProviderThresholdSeconds,
28266
+ setProviderFailureThresholdSeconds: this._setProviderFailureThresholdSeconds,
28267
+ providerHeliaContexts: this._libp2pJsClientHeliaContexts()
28268
+ }) : new PKCError("ERR_ALL_PUBSUB_PROVIDERS_THROW_ERRORS", {
28259
28269
  challengeExchanges: this._challengeExchangesFormattedForErrors(),
28260
28270
  pubsubTopic: this._community?.pubsubTopic,
28261
28271
  providerHeliaContexts: this._libp2pJsClientHeliaContexts()
@@ -35946,7 +35956,7 @@ var PKC$1 = class extends PKCTypedEmitter {
35946
35956
  this.clients.libp2pJsClients = {};
35947
35957
  if (!this.libp2pJsClientsOptions) return;
35948
35958
  if (!this.httpRoutersOptions) throw Error("httpRoutersOptions is required for libp2pJsClient");
35949
- const { createLibp2pJsClientOrUseExistingOne } = await import("./helia-for-pkc-7vdzP67t.js");
35959
+ const { createLibp2pJsClientOrUseExistingOne } = await import("./helia-for-pkc-PaZmkxgn.js");
35950
35960
  for (const clientOptions of this.libp2pJsClientsOptions) {
35951
35961
  const heliaNode = await createLibp2pJsClientOrUseExistingOne({
35952
35962
  ...clientOptions,
@@ -36313,7 +36323,7 @@ var PKC$1 = class extends PKCTypedEmitter {
36313
36323
  const log = logger_default("pkc-js:pkc:createLocalCommunity");
36314
36324
  log.trace("Received community options to create a local community instance:", options);
36315
36325
  if (!this._canCreateNewLocalCommunity()) throw new PKCError("ERR_CAN_NOT_CREATE_A_LOCAL_COMMUNITY", { pkcOptions: this._userPKCOptions });
36316
- const { LocalCommunity, createNewLocalCommunityDb, updateInstancePropsWithStartedCommunityOrDb } = await import("./local-community-Bi1JGMMa.js");
36326
+ const { LocalCommunity, createNewLocalCommunityDb, updateInstancePropsWithStartedCommunityOrDb } = await import("./local-community-CeuVhBBn.js");
36317
36327
  const isLocalCommunity = (await listCommunitiesSync(this)).includes(options.address);
36318
36328
  const community = new LocalCommunity(this);
36319
36329
  if (isLocalCommunity) {
@@ -1,4 +1,4 @@
1
- import { gr as isStringDomain, v as getEquivalentCommunityAddresses, xn as PageSortFileSchema } from "./util-D6z8nIoj.js";
1
+ import { gr as isStringDomain, v as getEquivalentCommunityAddresses, xn as PageSortFileSchema } from "./util-Bnqvxk-6.js";
2
2
  //#region dist/node/pages/page-sort-scoring.js
3
3
  function validatePageSortFile(rawFile) {
4
4
  const validated = PageSortFileSchema.parse(rawFile);
@@ -1,7 +1,7 @@
1
1
  import { i as __toESM, n as __exportAll, r as __require, t as __commonJSMin } from "./chunk-2rV9d50f.js";
2
- import { $n as CommentEditSignedPropertyNames, $r as record, $t as CommunityEditPubsubMessagePublicationSchema, A as isIpnsPath, An as CommentChallengeRequestToEncryptSchema, Ar as t$9, At as pTimeout, B as pubsubTopicToDhtKey, Bn as CommentUpdateSchema, Br as logger_default, C as hideClassPrivateProps, Cn as RpcRemoteCommunityUpdateEventResultSchema, Cr as e$5, D as isIpfsCid, Dr as n$8, Dt as untrackUpdatingCommunity, E as isAbortError, En as VotePubsubMessagePublicationSchema, Er as t$12, Fn as CommentSignedPropertyNames, Fr as FailedToFetchCommunityFromGatewaysError, Gn as GetPageParamSchema, Gr as array, Gt as NameResolverSerializedSchema, H as raceAgainstAbort, Hr as require_ms$1, Ht as DecryptedChallengeSchema, In as CommentUpdateChallengeReservedFieldNames, Ir as FailedToFetchGenericIpfsFromGatewaysError, It as ChallengeRequestMessageSignedPropertyNames, Jn as isReservedObjectKey, Jr as literal, Jt as PKCUserOptionsSchema, Kn as ModQueuePageIpfsSchema, Kr as boolean, Kt as PKCParsedOptionsSchema, L as isRequestPubsubPublicationOfPost, Lr as FailedToFetchPageIpfsFromGatewaysError, Mn as CommentIpfsSchema, Mr as require_retry$2, Mt as ChallengeAnswerMessageSignedPropertyNames, Nr as FailedToFetchCommentIpfsFromGatewaysError, O as isIpfsPath, On as VoteSignedPropertyNames, Or as r$7, Ot as require_sha256$1, Pn as CommentPubsubMessageWithFlexibleAuthorRefinementSchema, Pr as FailedToFetchCommentUpdateFromGatewaysError, Pt as ChallengeMessageSignedPropertyNames, Qr as preprocess, Qt as CommunityEditPublicationSignedPropertyNames, R as isRequestPubsubPublicationOfReply, Rn as CommentUpdateForChallengeVerificationSignedPropertyNames, Rr as PKCError, Rt as ChallengeVerificationMessageSignedPropertyNames, S as hasTransientNetworkErrorCode, Sr as e$6, St as trackStartedCommunity, T as ipnsNameToIpnsOverPubsubTopic, Tn as VoteChallengeRequestToEncryptSchema, Tr as r$8, Tt as untrackStartedCommunity, Ut as DecryptedChallengeVerificationSchema, Vn as CommentUpdateSignedPropertyNames, Vr as require_supports_color, Wn as CreateCommentOptionsWithRefinementSchema, Wr as _enum, Wt as NameResolveCacheOptionsSchema, Xr as number, Xt as CommunityEditPublicationChallengeRequestToEncryptSchema, Yn as CommentEditChallengeRequestToEncryptSchema, Yr as looseObject, Zn as CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema, Zr as object, _n as CreateRemoteCommunityFunctionArgumentSchema, _r as n$9, an as CommentModerationsTableRowSchema, ar as AuthorReservedFields, at as throwIfAbortSignalAborted, bn as PageSortFileFactorySchema, bt as refreshTrackedCommunityAliases, cn as ChallengeFileSchema, cr as CidStringSchema, d as deepMergeRuntimeFields, dn as CommunityEditOptionsSchema, dr as CreateSignerSchema, ei as string, en as CreateCommunityEditPublicationOptionsWithRefinementSchema, f as derivePublicationFromChallengeRequest, fn as CommunityExportRecordsSchema, fr as JsonSignatureSchema, ft as findStartedCommunity, gn as CreateNewLocalCommunityUserOptionsSchema, gr as isStringDomain, h as fetchAndValidateIpnsRecordFromGateway, hn as CommunitySignedPropertyNames, hr as areEquivalentNames, ht as forgetTrackedUpdatingCommunityName, in as CommentModerationSignedPropertyNames, ir as AuthorPubsubSchema, jn as CommentIpfsReservedFields, jr as e$4, k as isIpns, kr as t$10, lr as CommunityAddressSchema, m as extractNetworkErrorDetails, mn as CommunityIpfsSchema, mr as ProtocolVersionSchema, mt as findUpdatingCommunity, nn as CommentModerationPubsubMessagePublicationSchema, nr as AuthorAddressSchema, nt as shortifyCid, on as CreateCommentModerationOptionsWithRefinementSchema, or as ChallengeAnswersSchema, ot as timestamp, p as doesDomainAddressHaveCapitalLetter, pn as CommunityIpfsReservedFields, pr as PKCTimestampSchema, q as removeNullUndefinedEmptyObjectsValuesRecursively, qn as PageIpfsSchema, qr as custom, qt as PKCUserOptionBaseSchema, r as calculateIpfsCidV0, rr as AuthorCommentIpfsReservedFields, rt as sleepUntilTimeoutOrAbort, sn as ChallengeFileFactorySchema, sr as CidPathSchema, t as areEquivalentCommunityAddresses, ti as union, tn as CommentModerationChallengeRequestToEncryptSchema, tr as CreateCommentEditOptionsWithRefinementSchema, tt as shortifyAddress, u as createAbortError, un as CommunityChallengeSettingSchema, ur as CommunityAuthorChallengeReservedFieldNames, vn as CreateRpcCommunityFunctionArgumentSchema, w as interruptibleSleep, wn as CreateVoteUserOptionsWithRefinementSchema, wr as t$11, wt as trackUpdatingCommunity, xn as PageSortFileSchema, xr as t$13, yn as ExportCommunityModLogsOptionsSchema, yr as n$10, z as linkAbortSignals, zn as CommentUpdateReservedFields, zr as messages, zt as DecryptedChallengeAnswerSchema } from "./util-D6z8nIoj.js";
2
+ import { $n as CommentEditSignedPropertyNames, $r as record, $t as CommunityEditPubsubMessagePublicationSchema, A as isIpnsPath, An as CommentChallengeRequestToEncryptSchema, Ar as t$9, At as pTimeout, B as pubsubTopicToDhtKey, Bn as CommentUpdateSchema, Br as logger_default, C as hideClassPrivateProps, Cn as RpcRemoteCommunityUpdateEventResultSchema, Cr as e$5, D as isIpfsCid, Dr as n$8, Dt as untrackUpdatingCommunity, E as isAbortError, En as VotePubsubMessagePublicationSchema, Er as t$12, Fn as CommentSignedPropertyNames, Fr as FailedToFetchCommunityFromGatewaysError, Gn as GetPageParamSchema, Gr as array, Gt as NameResolverSerializedSchema, H as raceAgainstAbort, Hr as require_ms$1, Ht as DecryptedChallengeSchema, In as CommentUpdateChallengeReservedFieldNames, Ir as FailedToFetchGenericIpfsFromGatewaysError, It as ChallengeRequestMessageSignedPropertyNames, Jn as isReservedObjectKey, Jr as literal, Jt as PKCUserOptionsSchema, Kn as ModQueuePageIpfsSchema, Kr as boolean, Kt as PKCParsedOptionsSchema, L as isRequestPubsubPublicationOfPost, Lr as FailedToFetchPageIpfsFromGatewaysError, Mn as CommentIpfsSchema, Mr as require_retry$2, Mt as ChallengeAnswerMessageSignedPropertyNames, Nr as FailedToFetchCommentIpfsFromGatewaysError, O as isIpfsPath, On as VoteSignedPropertyNames, Or as r$7, Ot as require_sha256$1, Pn as CommentPubsubMessageWithFlexibleAuthorRefinementSchema, Pr as FailedToFetchCommentUpdateFromGatewaysError, Pt as ChallengeMessageSignedPropertyNames, Qr as preprocess, Qt as CommunityEditPublicationSignedPropertyNames, R as isRequestPubsubPublicationOfReply, Rn as CommentUpdateForChallengeVerificationSignedPropertyNames, Rr as PKCError, Rt as ChallengeVerificationMessageSignedPropertyNames, S as hasTransientNetworkErrorCode, Sr as e$6, St as trackStartedCommunity, T as ipnsNameToIpnsOverPubsubTopic, Tn as VoteChallengeRequestToEncryptSchema, Tr as r$8, Tt as untrackStartedCommunity, Ut as DecryptedChallengeVerificationSchema, Vn as CommentUpdateSignedPropertyNames, Vr as require_supports_color, Wn as CreateCommentOptionsWithRefinementSchema, Wr as _enum, Wt as NameResolveCacheOptionsSchema, Xr as number, Xt as CommunityEditPublicationChallengeRequestToEncryptSchema, Yn as CommentEditChallengeRequestToEncryptSchema, Yr as looseObject, Zn as CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema, Zr as object, _n as CreateRemoteCommunityFunctionArgumentSchema, _r as n$9, an as CommentModerationsTableRowSchema, ar as AuthorReservedFields, at as throwIfAbortSignalAborted, bn as PageSortFileFactorySchema, bt as refreshTrackedCommunityAliases, cn as ChallengeFileSchema, cr as CidStringSchema, d as deepMergeRuntimeFields, dn as CommunityEditOptionsSchema, dr as CreateSignerSchema, ei as string, en as CreateCommunityEditPublicationOptionsWithRefinementSchema, f as derivePublicationFromChallengeRequest, fn as CommunityExportRecordsSchema, fr as JsonSignatureSchema, ft as findStartedCommunity, gn as CreateNewLocalCommunityUserOptionsSchema, gr as isStringDomain, h as fetchAndValidateIpnsRecordFromGateway, hn as CommunitySignedPropertyNames, hr as areEquivalentNames, ht as forgetTrackedUpdatingCommunityName, in as CommentModerationSignedPropertyNames, ir as AuthorPubsubSchema, jn as CommentIpfsReservedFields, jr as e$4, k as isIpns, kr as t$10, lr as CommunityAddressSchema, m as extractNetworkErrorDetails, mn as CommunityIpfsSchema, mr as ProtocolVersionSchema, mt as findUpdatingCommunity, nn as CommentModerationPubsubMessagePublicationSchema, nr as AuthorAddressSchema, nt as shortifyCid, on as CreateCommentModerationOptionsWithRefinementSchema, or as ChallengeAnswersSchema, ot as timestamp, p as doesDomainAddressHaveCapitalLetter, pn as CommunityIpfsReservedFields, pr as PKCTimestampSchema, q as removeNullUndefinedEmptyObjectsValuesRecursively, qn as PageIpfsSchema, qr as custom, qt as PKCUserOptionBaseSchema, r as calculateIpfsCidV0, rr as AuthorCommentIpfsReservedFields, rt as sleepUntilTimeoutOrAbort, sn as ChallengeFileFactorySchema, sr as CidPathSchema, t as areEquivalentCommunityAddresses, ti as union, tn as CommentModerationChallengeRequestToEncryptSchema, tr as CreateCommentEditOptionsWithRefinementSchema, tt as shortifyAddress, u as createAbortError, un as CommunityChallengeSettingSchema, ur as CommunityAuthorChallengeReservedFieldNames, vn as CreateRpcCommunityFunctionArgumentSchema, w as interruptibleSleep, wn as CreateVoteUserOptionsWithRefinementSchema, wr as t$11, wt as trackUpdatingCommunity, xn as PageSortFileSchema, xr as t$13, yn as ExportCommunityModLogsOptionsSchema, yr as n$10, z as linkAbortSignals, zn as CommentUpdateReservedFields, zr as messages, zt as DecryptedChallengeAnswerSchema } from "./util-Bnqvxk-6.js";
3
3
  import { t as all } from "./src-CYIMjhjK.js";
4
- import { s as validatePageSortFile } from "./page-sort-scoring-Bsc4MAy1.js";
4
+ import { s as validatePageSortFile } from "./page-sort-scoring-DgSzIxmE.js";
5
5
  import { createHash } from "node:crypto";
6
6
  import { pathToFileURL } from "node:url";
7
7
  import dns from "node:dns";
@@ -154632,6 +154632,12 @@ const loadChallengeFile = async ({ communityChallengeSettings, challengeIndex, c
154632
154632
  };
154633
154633
  const callGetChallenge = async ({ challengeFile, communityChallengeSettings, challengeRequestMessage, challengeIndex, community, authorIdentityMatcher }) => {
154634
154634
  let challengeOrChallengeResult;
154635
+ const challengeName = communityChallengeSettings.name || communityChallengeSettings.path;
154636
+ const startedAtMs = Date.now();
154637
+ const slowWarningTimer = setTimeout(() => {
154638
+ logger_default("pkc-js:local-community:challenges:callGetChallenge").error(`getChallenge() of challenge ${challengeIndex + 1} (${challengeName}) in community ${community.address} is still running after ${community._slowGetChallengeWarningMs / 1e3}s.`, "A publisher that receives no challenge or verification gives up after about two minutes and the publication looks failed to its author.", "Slow work belongs behind pendingApproval. challengeRequestId:", challengeRequestMessage.challengeRequestId.toString());
154639
+ }, community._slowGetChallengeWarningMs);
154640
+ slowWarningTimer.unref?.();
154635
154641
  try {
154636
154642
  challengeOrChallengeResult = await challengeFile.getChallenge({
154637
154643
  challengeSettings: communityChallengeSettings,
@@ -154640,6 +154646,8 @@ const callGetChallenge = async ({ challengeFile, communityChallengeSettings, cha
154640
154646
  community,
154641
154647
  authorIdentityMatcher
154642
154648
  });
154649
+ const elapsedMs = Date.now() - startedAtMs;
154650
+ if (elapsedMs >= community._slowGetChallengeWarningMs) logger_default("pkc-js:local-community:challenges:callGetChallenge").error(`getChallenge() of challenge ${challengeIndex + 1} (${challengeName}) in community ${community.address} took ${Math.round(elapsedMs / 1e3)}s`);
154643
154651
  validateChallengeOrChallengeResult({
154644
154652
  challengeOrChallengeResult,
154645
154653
  challengeIndex,
@@ -154653,6 +154661,8 @@ const callGetChallenge = async ({ challengeFile, communityChallengeSettings, cha
154653
154661
  challengeIndex: challengeIndex + 1,
154654
154662
  error: e
154655
154663
  });
154664
+ } finally {
154665
+ clearTimeout(slowWarningTimer);
154656
154666
  }
154657
154667
  return { challengeOrChallengeResult };
154658
154668
  };
@@ -16553,7 +16553,7 @@ const CommunityEditPublicationPubsubReservedFields = r$2([
16553
16553
  ], t$3(CommunityEditPubsubMessagePublicationSchema.shape));
16554
16554
  //#endregion
16555
16555
  //#region dist/node/generated-version.js
16556
- const version = "0.0.145";
16556
+ const version = "0.0.146";
16557
16557
  //#endregion
16558
16558
  //#region dist/node/version.js
16559
16559
  const protocolVersion = ProtocolVersionSchema.parse("1.0.0");
@@ -1,4 +1,4 @@
1
- import { Rr as PKCError, V as pubsubTopicToDhtKeyCid } from "./util-D6z8nIoj.js";
1
+ import { Rr as PKCError, V as pubsubTopicToDhtKeyCid } from "./util-Bnqvxk-6.js";
2
2
  import { ipnsSelector } from "ipns/selector";
3
3
  import { ipnsValidator } from "ipns/validator";
4
4
  import { unmarshalIPNSRecord } from "ipns";