@pkcprotocol/pkc-js 0.0.112 → 0.0.114

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 (42) hide show
  1. package/README.md +4 -4
  2. package/dist/browser/generated-version.d.ts +1 -1
  3. package/dist/browser/generated-version.js +1 -1
  4. package/dist/browser/pages/page-sort-scoring.d.ts +4 -0
  5. package/dist/browser/pages/page-sort-scoring.js +20 -3
  6. package/dist/browser/pages/page-sort-scoring.js.map +1 -1
  7. package/dist/browser/pages/pkc-js-page-sorts/active.js +3 -2
  8. package/dist/browser/pages/pkc-js-page-sorts/active.js.map +1 -1
  9. package/dist/browser/publications/comment/schema.js +4 -4
  10. package/dist/browser/publications/comment/schema.js.map +1 -1
  11. package/dist/browser/runtime/node/community/db-handler.d.ts +1 -0
  12. package/dist/browser/runtime/node/community/db-handler.js +56 -41
  13. package/dist/browser/runtime/node/community/db-handler.js.map +1 -1
  14. package/dist/browser/runtime/node/community/page-generator.js +11 -17
  15. package/dist/browser/runtime/node/community/page-generator.js.map +1 -1
  16. package/dist/browser/version.js +1 -1
  17. package/dist/bundled/bundle-manifest.json +31 -31
  18. package/dist/bundled/chunks/{helia-for-pkc-DDLK491v.js → helia-for-pkc-hSpmyI9D.js} +2 -2
  19. package/dist/bundled/chunks/{local-community-kjNJHOud.js → local-community-Dc_fNPrx.js} +1 -1
  20. package/dist/bundled/chunks/{local-community-DJGHwkuK.js → local-community-EeQMdfYM.js} +47 -44
  21. package/dist/bundled/chunks/{node-C_wuNW9S.js → node-apYZl3B3.js} +5 -5
  22. package/dist/bundled/chunks/{rpc-local-community-BHSnYv5v.js → rpc-local-community-C_0FRCqg.js} +15 -2
  23. package/dist/bundled/chunks/{util-BuDJJAAP.js → util-B2SuJZg-.js} +1 -1
  24. package/dist/bundled/chunks/{util-C68VdI47.js → util-DFGl6QDd.js} +2 -2
  25. package/dist/bundled/index.js +1 -1
  26. package/dist/bundled/rpc/src/index.js +4 -4
  27. package/dist/node/generated-version.d.ts +1 -1
  28. package/dist/node/generated-version.js +1 -1
  29. package/dist/node/pages/page-sort-scoring.d.ts +4 -0
  30. package/dist/node/pages/page-sort-scoring.js +20 -3
  31. package/dist/node/pages/page-sort-scoring.js.map +1 -1
  32. package/dist/node/pages/pkc-js-page-sorts/active.js +3 -2
  33. package/dist/node/pages/pkc-js-page-sorts/active.js.map +1 -1
  34. package/dist/node/publications/comment/schema.js +4 -4
  35. package/dist/node/publications/comment/schema.js.map +1 -1
  36. package/dist/node/runtime/node/community/db-handler.d.ts +1 -0
  37. package/dist/node/runtime/node/community/db-handler.js +56 -41
  38. package/dist/node/runtime/node/community/db-handler.js.map +1 -1
  39. package/dist/node/runtime/node/community/page-generator.js +11 -17
  40. package/dist/node/runtime/node/community/page-generator.js.map +1 -1
  41. package/dist/node/version.js +1 -1
  42. package/package.json +1 -1
package/README.md CHANGED
@@ -92,8 +92,8 @@ CommentUpdate /* (IPFS file) */ {
92
92
  upvoteCount: number
93
93
  downvoteCount: number
94
94
  replies?: Pages // only preload page 1 sorted by 'best', might preload more later, only provide sorting for posts (not comments) that have 100+ child comments
95
- replyCount: number
96
- childCount?: number // the total of direct children of the comment, does not include indirect children
95
+ replyCount: number // direct and indirect replies; removed, deleted, disapproved and pending replies are not counted, the present replies under them are (docs/protocol/comment-lifecycle.md, "Which Replies Count")
96
+ childCount?: number // the direct replies replyCount counts, does not include indirect replies
97
97
  number?: number // sequential comment number assigned by the community
98
98
  postNumber?: number // sequential post number assigned by the community
99
99
  flairs?: Flair[] // arbitrary colored strings to describe the comment, added by mods, override comment.flairs and comment.edit.flairs (which are added by author)
@@ -111,8 +111,8 @@ CommentUpdate /* (IPFS file) */ {
111
111
  author?: { // add commentUpdate.author.community to comment.author.community, override comment.author.flairs with commentUpdate.author.community.flairs if any
112
112
  community: CommunityAuthor
113
113
  }
114
- lastReplyTimestamp?: number // the timestamp of the most recent direct or indirect child of the comment
115
- lastChildCid?: string // the CID of the most recent direct child of the comment
114
+ lastReplyTimestamp?: number // the timestamp of the most recent reply that replyCount counts, so removing a reply un-bumps its thread
115
+ lastChildCid?: string // the CID of the most recent direct reply that childCount counts
116
116
  }
117
117
  Author {
118
118
  address: string
@@ -1 +1 @@
1
- export declare const version = "0.0.112";
1
+ export declare const version = "0.0.114";
@@ -1,3 +1,3 @@
1
1
  // Auto-generated by config/generate-version.js — do not edit
2
- export const version = "0.0.112";
2
+ export const version = "0.0.114";
3
3
  //# sourceMappingURL=generated-version.js.map
@@ -8,6 +8,10 @@ export declare function applyPageSortExclusions<T extends PageSortReplyEntry>({
8
8
  exclusions: Record<PageSortExclusionOptionName, boolean>;
9
9
  communityAddress?: string;
10
10
  }): T[];
11
+ export declare function filterRepliesForPageSort<T extends PageSortReplyEntry>({ replies, communityAddress }: {
12
+ replies: T[];
13
+ communityAddress: string;
14
+ }): T[];
11
15
  export declare function partitionPageCommentsForSort({ comments, reserved, baseTimestamp }: {
12
16
  comments: PageComment[];
13
17
  reserved: Pick<ParsedReservedPageSortOptions, "pinnedFirst" | "maxAgeSeconds">;
@@ -13,8 +13,7 @@ export function validatePageSortFile(rawFile) {
13
13
  ...(raw.validatePageSortSettings ? { validatePageSortSettings: raw.validatePageSortSettings } : {})
14
14
  };
15
15
  }
16
- // The reserved exclusions applied to page entries in JS (the `replies` a requireReplies file receives). Mirrors the SQL clauses in DbHandler
17
- // (exclusionClauses): a comment is removed when commentUpdate.removed is true, deleted when its author's edit says so,
16
+ // The reserved exclusions applied to page entries in JS. Mirrors the SQL clauses in DbHandler (exclusionClauses): a comment is removed when commentUpdate.removed is true, deleted when its author's edit says so,
18
17
  // disapproved when commentUpdate.approved is false, pending when commentUpdate.pendingApproval is true.
19
18
  export function applyPageSortExclusions({ comments, exclusions, communityAddress }) {
20
19
  const equivalentAddresses = communityAddress ? new Set(getEquivalentCommunityAddresses(communityAddress)) : undefined;
@@ -36,6 +35,24 @@ export function applyPageSortExclusions({ comments, exclusions, communityAddress
36
35
  return true;
37
36
  });
38
37
  }
38
+ // The `replies` a requireReplies file receives: every reply in the scope except ones from another community address
39
+ // (issue #407). The sort's exclude* options are not applied, they reach the file in `options`: a removed or deleted
40
+ // reply is a tombstone whose present replies still count (docs/protocol/comment-lifecycle.md, "Which replies count"),
41
+ // so dropping it would cut its subtree, and the file decides what counts. Replies with no CommentUpdate never get
42
+ // here (the DB query joins on commentUpdates). Reply pages keep tombstones too, so a client walking them gets this set.
43
+ export function filterRepliesForPageSort({ replies, communityAddress }) {
44
+ return applyPageSortExclusions({
45
+ comments: replies,
46
+ exclusions: {
47
+ excludeRemovedComments: false,
48
+ excludeDeletedComments: false,
49
+ excludeCommentWithApprovedFalse: false,
50
+ excludeCommentPendingApproval: false,
51
+ excludeCommentsWithDifferentCommunityAddress: true
52
+ },
53
+ communityAddress
54
+ });
55
+ }
39
56
  // Pinned placement and the maxAge window, the two reserved options that shape every sort's set and order. Pinned
40
57
  // comments sort first and bypass the window when pinnedFirst is on (the default), so a sticky never ages out of a
41
58
  // windowed index; with pinnedFirst off they are ordinary comments. Shared with the community's page generator.
@@ -77,7 +94,7 @@ export function stripRepliesFromPageComment(entry) {
77
94
  // The `replies` a file with requireReplies gets per scored comment: its descendants, out of one flat list of every
78
95
  // descendant of the page's comments (the community loads the scope's descendants once; a client passes what it
79
96
  // walked). Indexed by parentCid, so a reply on a reply page gets its own subtree and a post gets everything under it;
80
- // a node whose parent was excluded is unreachable, the same cut the community's exclusions make.
97
+ // a node whose parent is not in the list is unreachable (only a foreign reply's subtree, see filterRepliesForPageSort).
81
98
  export function createDescendantsLookup(replies) {
82
99
  const childrenByParent = new Map();
83
100
  for (const entry of replies) {
@@ -1 +1 @@
1
- {"version":3,"file":"page-sort-scoring.js","sourceRoot":"","sources":["../../../src/pages/page-sort-scoring.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,+BAA+B,EAAE,MAAM,YAAY,CAAC;AAW7D,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,EACP,UAAU,GAAG,2BAA2B,EACxC,aAAa,EAAE,qBAAqB,EAQvC;IACG,MAAM,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,qBAAqB,IAAI,uBAAuB,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACxH,OAAO,CAAC,KAAK,EAAE,EAAE;QACb,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;QACrD,OAAO,IAAI,CAAC,KAAK,CAAC;YACd,OAAO;YACP,aAAa;YACb,OAAO;YACP,aAAa;YACb,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,aAAa,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC1E,CAAC,CAAC;IACP,CAAC,CAAC;AACN,CAAC"}
@@ -2,8 +2,9 @@
2
2
  // CommentUpdate already carries as lastReplyTimestamp (the recursive MAX(timestamp) the community computes when a
3
3
  // descendant changes, before pages are generated in the same cycle). A per-comment score like every other built-in,
4
4
  // so a client re-sorts by bump order from the page alone. lastReplyTimestamp hard-codes the removed/deleted/unapproved
5
- // exclusions, so an owner who turns excludeRemovedComments off for posts still does not get removed replies bumping
6
- // threads: bump time is what the CommentUpdate carries.
5
+ // exclusions at every depth (a removed or deleted reply never bumps; the present replies under it do), so an owner
6
+ // who turns excludeRemovedComments off for posts still does not get removed replies bumping threads: bump time is
7
+ // what the CommentUpdate carries.
7
8
  const active = () => ({
8
9
  sortName: "active",
9
10
  description: "Most recently bumped first: posts ordered by the newest reply anywhere in their thread",
@@ -1 +1 @@
1
- {"version":3,"file":"active.js","sourceRoot":"","sources":["../../../../src/pages/pkc-js-page-sorts/active.ts"],"names":[],"mappings":"AAEA,iHAAiH;AACjH,kHAAkH;AAClH,oHAAoH;AACpH,uHAAuH;AACvH,oHAAoH;AACpH,wDAAwD;AACxD,MAAM,MAAM,GAAwB,GAAG,EAAE,CAAC,CAAC;IACvC,QAAQ,EAAE,QAAQ;IAClB,WAAW,EAAE,wFAAwF;IACrG,YAAY,EAAE,EAAE,EAAE,4EAA4E;IAC9F,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,EAAE,aAAa,CAAC,kBAAkB,IAAI,CAAC,CAAC;CAC5G,CAAC,CAAC;AAEH,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"active.js","sourceRoot":"","sources":["../../../../src/pages/pkc-js-page-sorts/active.ts"],"names":[],"mappings":"AAEA,iHAAiH;AACjH,kHAAkH;AAClH,oHAAoH;AACpH,uHAAuH;AACvH,mHAAmH;AACnH,kHAAkH;AAClH,kCAAkC;AAClC,MAAM,MAAM,GAAwB,GAAG,EAAE,CAAC,CAAC;IACvC,QAAQ,EAAE,QAAQ;IAClB,WAAW,EAAE,wFAAwF;IACrG,YAAY,EAAE,EAAE,EAAE,4EAA4E;IAC9F,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,EAAE,aAAa,CAAC,kBAAkB,IAAI,CAAC,CAAC;CAC5G,CAAC,CAAC;AAEH,eAAe,MAAM,CAAC"}
@@ -85,8 +85,8 @@ export const CommentUpdateSchema = z
85
85
  cid: CidStringSchema, // cid of the comment, need it in signature to prevent attack
86
86
  upvoteCount: z.number().nonnegative().int(),
87
87
  downvoteCount: z.number().nonnegative().int(),
88
- replyCount: z.number().nonnegative().int(), // the total of reply trees underneath this comment, which includes direct and indirect children
89
- childCount: z.number().nonnegative().int().optional(), // the total of direct children of the comment, does not include indirect children
88
+ replyCount: z.number().nonnegative().int(), // the total of reply trees underneath this comment, which includes direct and indirect children; removed, deleted, disapproved and pending replies are not counted, the present replies under them are (docs/protocol/comment-lifecycle.md)
89
+ childCount: z.number().nonnegative().int().optional(), // the direct replies replyCount counts, does not include indirect replies
90
90
  number: z.number().int().positive().optional(),
91
91
  postNumber: z.number().int().positive().optional(),
92
92
  edit: CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema.optional(), // most recent edit by comment author, commentUpdate.edit.content, commentUpdate.edit.deleted, commentUpdate.edit.flairs override Comment instance props. Validate commentUpdate.edit.signature
@@ -101,8 +101,8 @@ export const CommentUpdateSchema = z
101
101
  approved: z.boolean().optional(), // if comment was pending approval and it got approved or disapproved. Does not apply to comments pending approvals, you need to use moderation.pageCids.pendingApproval to fetch pending comments
102
102
  updatedAt: PKCTimestampSchema, // timestamp in seconds the CommentUpdate was updated
103
103
  author: AuthorWithCommentUpdateSchema.pick({ community: true }).optional(), // add commentUpdate.author.community to comment.author.community, override comment.author.flairs with commentUpdate.author.community.flairs if any
104
- lastChildCid: CidStringSchema.optional(), // The cid of the most recent direct child of the comment
105
- lastReplyTimestamp: PKCTimestampSchema.optional(), // The timestamp of the most recent direct or indirect child of the comment
104
+ lastChildCid: CidStringSchema.optional(), // The cid of the most recent direct reply that childCount counts
105
+ lastReplyTimestamp: PKCTimestampSchema.optional(), // The timestamp of the most recent reply that replyCount counts
106
106
  signature: JsonSignatureSchema, // signature of the CommentUpdate by the community owner to protect against malicious gateway
107
107
  protocolVersion: ProtocolVersionSchema,
108
108
  // The getter defers TypeScript inference of the comment-schema <-> pages-schema cycle; the
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/publications/comment/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACH,WAAW,EACX,kBAAkB,EAClB,eAAe,EACf,kCAAkC,EAClC,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACrB,4BAA4B,EAC5B,gCAAgC,EAChC,qBAAqB,EACrB,gCA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M,8BAA8B,GAAG,MAAM,CAAC;IAC1C,GAAG,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC;IAChC,GAAG,IAAI,CAAC,sBAAsB,CAAC,KAAK,CAAC;IACrC,GAAG,IAAI,CAAC,2BAA2B,CAAC,KAAK,CAAC;IAC1C,GAAG,IAAI,CAAC,sCAAsC,CAAC,KAAK,CAAC;IACrD,GAAG,IAAI,CAAC,0BAA0B,CAAC,KAAK,CAAC;IACzC,GAAG,wDAAwD;IAC3D,GAAG,gCAAgC;IACnC,GAAG,4DAA4D;IAC/D,GAAG,+BAA+B;CACF,CAAC,CAAC;AAEtC,MAAM,CAAC,MAAM,kCAAkC,GAAG,UAAU,CACxD,8BAA8B,EAC9B,IAAI,CAAC,qCAAqC,CAAC,KAAK,CAAoC,CACvF,CAAC;AAoBF,yHAAyH;AACzH,MAAM,CAAC,MAAM,yBAAyB,GAAG,UAAU,CAC/C,kCAAkC,EAClC,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAA8C,CAC7E,CAAC;AAEF,MAAM,CAAC,MAAM,2BAA2B,GAAG,UAAU,CAAC,kCAAkC,EAAE;IACtF,GAAG,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC;IAClC,GAAG,IAAI,CAAC,2BAA2B,CAAC,KAAK,CAAC;IAC1C,iBAAiB;CACpB,CAAC,CAAC;AAEH,gCAAgC"}
@@ -240,6 +240,7 @@ export declare class DbHandler {
240
240
  private _calculateCommentUpdates;
241
241
  private _cidChunks;
242
242
  private _queryVoteCountsByCids;
243
+ private _replyWalkPresentExpression;
243
244
  private _queryReplyCountsByParentCids;
244
245
  private _queryLastReplyTimestampsByParentCids;
245
246
  private _queryLastChildCidsByParentCids;
@@ -1598,14 +1598,19 @@ export class DbHandler {
1598
1598
  _collectCommentsToBeUpdated() {
1599
1599
  const windowed = this._buildWindowedReplySortArms(timestamp());
1600
1600
  const notPending = (alias) => `(${alias}.pendingApproval IS NULL OR ${alias}.pendingApproval != 1)`;
1601
- // A child that counts towards its parent's childCount: has a CommentUpdate, not removed, not deleted by its author
1601
+ const countedChildAddress = this._communityAddressClauseNamed("c", "countedChild");
1602
+ // A child that counts towards its parent's childCount: has a CommentUpdate and this community's address, not
1603
+ // removed, not deleted by its author, not disapproved (the rule _queryReplyCountsByParentCids and
1604
+ // _queryLastChildCidsByParentCids apply, or the parent is re-flagged every cycle)
1602
1605
  const countedChild = `
1603
1606
  FROM ${TABLES.COMMENTS} c
1604
1607
  JOIN ${TABLES.COMMENT_UPDATES} cu_child ON c.cid = cu_child.cid
1605
1608
  WHERE c.parentCid IS NOT NULL
1609
+ AND ${countedChildAddress.clause}
1606
1610
  AND ${notPending("c")}
1607
1611
  AND (cu_child.removed IS NOT 1 AND cu_child.removed IS NOT TRUE)
1608
- AND (json_extract(cu_child.edit, '$.deleted') IS NULL OR json_extract(cu_child.edit, '$.deleted') != 1)`;
1612
+ AND (json_extract(cu_child.edit, '$.deleted') IS NULL OR json_extract(cu_child.edit, '$.deleted') != 1)
1613
+ AND COALESCE(cu_child.approved, 1) != 0`;
1609
1614
  const insert = `INSERT OR IGNORE INTO ${COMMENTS_TO_UPDATE_TEMP_TABLE}`;
1610
1615
  const arms = [
1611
1616
  `${insert}
@@ -1637,7 +1642,6 @@ export class DbHandler {
1637
1642
  WITH last_child_rowids AS (
1638
1643
  SELECT c.parentCid AS cid, MAX(c.rowid) AS last_child_rowid
1639
1644
  ${countedChild}
1640
- AND COALESCE(cu_child.approved, 1) != 0
1641
1645
  GROUP BY c.parentCid
1642
1646
  )
1643
1647
  SELECT parent.rowid
@@ -1685,9 +1689,11 @@ export class DbHandler {
1685
1689
  )
1686
1690
  SELECT id FROM parent_chain`
1687
1691
  ];
1692
+ const allParams = { ...windowed.params, ...countedChildAddress.params };
1688
1693
  for (const arm of arms) {
1689
- // Each statement is bound only to the named parameters it mentions (the windowed arms' window bounds)
1690
- const params = Object.fromEntries(Object.entries(windowed.params).filter(([name]) => arm.includes(`:${name}`)));
1694
+ // Each statement is bound only to the named parameters it mentions (the windowed arms' window bounds, the
1695
+ // counted-child address)
1696
+ const params = Object.fromEntries(Object.entries(allParams).filter(([name]) => arm.includes(`:${name}`)));
1691
1697
  this._prepareCached(arm).run(params);
1692
1698
  }
1693
1699
  }
@@ -2294,79 +2300,88 @@ export class DbHandler {
2294
2300
  }
2295
2301
  return result;
2296
2302
  }
2297
- // replyCount and childCount of every parent in one recursive walk anchored on all of them: a descendant counts
2298
- // when every comment on the path from the parent has a CommentUpdate, this community's address, and is neither
2299
- // removed nor deleted; childCount is the level-1 part of the same walk.
2303
+ // Whether a comment in a reply walk is present (neither removed, deleted nor disapproved), over the cu and d aliases
2304
+ // the walks join. A comment that is not present is skipped by the counts but still walked through: reply pages keep
2305
+ // it as a tombstone, so the present replies under it are still part of the thread (#405). A disapproved comment
2306
+ // never has replies under it, since publishing under a pending or disapproved comment is rejected.
2307
+ _replyWalkPresentExpression() {
2308
+ return `CASE WHEN (cu.removed IS NOT 1 AND cu.removed IS NOT TRUE) AND (d.deleted_flag IS NULL OR d.deleted_flag != 1) AND COALESCE(cu.approved, 1) != 0 THEN 1 ELSE 0 END`;
2309
+ }
2310
+ // replyCount and childCount of every parent in one recursive walk anchored on all of them: the walk follows every
2311
+ // descendant whose path from the parent has a CommentUpdate and this community's address, and a descendant counts
2312
+ // when it is also present (neither removed, deleted nor disapproved); childCount is the level-1 part of the same count.
2300
2313
  _queryReplyCountsByParentCids(parentCids) {
2301
2314
  const result = new Map();
2302
2315
  const { clause: addrClause, params: addrParams } = this._communityAddressClause("c");
2303
- const passes = `${addrClause} AND (cu.removed IS NOT 1 AND cu.removed IS NOT TRUE) AND (d.deleted_flag IS NULL OR d.deleted_flag != 1)`;
2316
+ const present = this._replyWalkPresentExpression();
2304
2317
  const deletedLookup = `(SELECT cid, json_extract(edit, '$.deleted') AS deleted_flag FROM ${TABLES.COMMENT_UPDATES})`;
2305
2318
  for (const { placeholders, params } of this._cidChunks(parentCids, addrParams.length * 2)) {
2306
- const rows = this._prepareCached(`WITH RECURSIVE descendants(root, cid, level) AS (
2307
- SELECT c.parentCid, c.cid, 1 FROM ${TABLES.COMMENTS} c
2319
+ const rows = this._prepareCached(`WITH RECURSIVE descendants(root, cid, level, present) AS (
2320
+ SELECT c.parentCid, c.cid, 1, ${present} FROM ${TABLES.COMMENTS} c
2308
2321
  INNER JOIN ${TABLES.COMMENT_UPDATES} cu ON c.cid = cu.cid
2309
2322
  LEFT JOIN ${deletedLookup} AS d ON c.cid = d.cid
2310
- WHERE c.parentCid IN (${placeholders}) AND ${passes}
2323
+ WHERE c.parentCid IN (${placeholders}) AND ${addrClause}
2311
2324
  UNION ALL
2312
- SELECT desc_nodes.root, c.cid, desc_nodes.level + 1 FROM ${TABLES.COMMENTS} c
2325
+ SELECT desc_nodes.root, c.cid, desc_nodes.level + 1, ${present} FROM ${TABLES.COMMENTS} c
2313
2326
  INNER JOIN ${TABLES.COMMENT_UPDATES} cu ON c.cid = cu.cid
2314
2327
  LEFT JOIN ${deletedLookup} AS d ON c.cid = d.cid
2315
2328
  JOIN descendants desc_nodes ON c.parentCid = desc_nodes.cid
2316
- WHERE ${passes}
2329
+ WHERE ${addrClause}
2317
2330
  )
2318
- SELECT root, COUNT(*) AS replyCount, SUM(CASE WHEN level = 1 THEN 1 ELSE 0 END) AS childCount
2331
+ SELECT root, SUM(present) AS replyCount, SUM(CASE WHEN level = 1 THEN present ELSE 0 END) AS childCount
2319
2332
  FROM descendants GROUP BY root`).all(...params, ...addrParams, ...addrParams);
2320
2333
  for (const row of rows)
2321
2334
  result.set(row.root, { replyCount: row.replyCount, childCount: row.childCount });
2322
2335
  }
2323
2336
  return result;
2324
2337
  }
2325
- // lastReplyTimestamp of every parent: the newest timestamp under it. A direct reply counts unless it is pending or
2326
- // disapproved (a reply with no CommentUpdate yet counts); a deeper one also needs a CommentUpdate, this
2327
- // community's address and to be neither removed nor deleted, and so does every comment on its path.
2338
+ // lastReplyTimestamp of every parent: the newest timestamp among the replies replyCount counts, with the walk further
2339
+ // narrowed to comments that are not pending. A removed, deleted or disapproved reply does not bump its thread (#403),
2340
+ // but the present replies under it do (#405).
2328
2341
  _queryLastReplyTimestampsByParentCids(parentCids) {
2329
2342
  const result = new Map();
2330
2343
  const { clause: addrClause, params: addrParams } = this._communityAddressClause("c");
2331
- for (const { placeholders, params } of this._cidChunks(parentCids, addrParams.length)) {
2332
- const rows = this._prepareCached(`WITH RECURSIVE descendants(root, cid, timestamp) AS (
2333
- SELECT c.parentCid, c.cid, c.timestamp FROM ${TABLES.COMMENTS} c
2334
- LEFT JOIN ${TABLES.COMMENT_UPDATES} cu ON cu.cid = c.cid
2335
- WHERE c.parentCid IN (${placeholders})
2336
- AND COALESCE(cu.approved, 1) != 0
2337
- AND (c.pendingApproval IS NULL OR c.pendingApproval != 1)
2344
+ const walked = `${addrClause} AND (c.pendingApproval IS NULL OR c.pendingApproval != 1)`;
2345
+ const present = this._replyWalkPresentExpression();
2346
+ const deletedLookup = `(SELECT cid, json_extract(edit, '$.deleted') AS deleted_flag FROM ${TABLES.COMMENT_UPDATES})`;
2347
+ for (const { placeholders, params } of this._cidChunks(parentCids, addrParams.length * 2)) {
2348
+ const rows = this._prepareCached(`WITH RECURSIVE descendants(root, cid, timestamp, present) AS (
2349
+ SELECT c.parentCid, c.cid, c.timestamp, ${present} FROM ${TABLES.COMMENTS} c
2350
+ INNER JOIN ${TABLES.COMMENT_UPDATES} cu ON c.cid = cu.cid
2351
+ LEFT JOIN ${deletedLookup} AS d ON c.cid = d.cid
2352
+ WHERE c.parentCid IN (${placeholders}) AND ${walked}
2338
2353
  UNION ALL
2339
- SELECT desc_nodes.root, c.cid, c.timestamp FROM ${TABLES.COMMENTS} c
2354
+ SELECT desc_nodes.root, c.cid, c.timestamp, ${present} FROM ${TABLES.COMMENTS} c
2340
2355
  INNER JOIN ${TABLES.COMMENT_UPDATES} cu ON c.cid = cu.cid
2341
- LEFT JOIN (SELECT cid, json_extract(edit, '$.deleted') AS deleted_flag FROM ${TABLES.COMMENT_UPDATES}) AS d ON c.cid = d.cid
2356
+ LEFT JOIN ${deletedLookup} AS d ON c.cid = d.cid
2342
2357
  JOIN descendants desc_nodes ON c.parentCid = desc_nodes.cid
2343
- WHERE ${addrClause} AND (cu.removed IS NOT 1 AND cu.removed IS NOT TRUE) AND (d.deleted_flag IS NULL OR d.deleted_flag != 1)
2344
- AND COALESCE(cu.approved, 1) != 0
2345
- AND (c.pendingApproval IS NULL OR c.pendingApproval != 1)
2358
+ WHERE ${walked}
2346
2359
  )
2347
- SELECT root, MAX(timestamp) AS maxTimestamp FROM descendants GROUP BY root`).all(...params, ...addrParams);
2360
+ SELECT root, MAX(CASE WHEN present = 1 THEN timestamp END) AS maxTimestamp FROM descendants GROUP BY root`).all(...params, ...addrParams, ...addrParams);
2348
2361
  for (const row of rows)
2349
2362
  if (row.maxTimestamp !== null)
2350
2363
  result.set(row.root, row.maxTimestamp);
2351
2364
  }
2352
2365
  return result;
2353
2366
  }
2354
- // lastChildCid of every parent: its newest direct reply that has a CommentUpdate and is not pending, disapproved,
2355
- // removed or deleted (MAX(rowid) with the bare cid column: SQLite returns the cid of that row).
2367
+ // lastChildCid of every parent: its newest direct reply that has a CommentUpdate and this community's address and is
2368
+ // not pending, disapproved, removed or deleted (MAX(rowid) with the bare cid column: SQLite returns the cid of that row).
2356
2369
  _queryLastChildCidsByParentCids(parentCids) {
2357
2370
  const result = new Map();
2358
- for (const { placeholders, params } of this._cidChunks(parentCids)) {
2371
+ const { clause: addrClause, params: addrParams } = this._communityAddressClause("c");
2372
+ for (const { placeholders, params } of this._cidChunks(parentCids, addrParams.length)) {
2359
2373
  const rows = this._prepareCached(`SELECT c.parentCid AS parentCid, c.cid AS cid, MAX(c.rowid) AS lastRowid FROM ${TABLES.COMMENTS} c
2360
2374
  INNER JOIN ${TABLES.COMMENT_UPDATES} cu ON cu.cid = c.cid
2361
2375
  LEFT JOIN (
2362
2376
  SELECT cid, json_extract(edit, '$.deleted') AS deleted_flag FROM ${TABLES.COMMENT_UPDATES}
2363
2377
  ) deleted_lookup ON deleted_lookup.cid = c.cid
2364
2378
  WHERE c.parentCid IN (${placeholders})
2379
+ AND ${addrClause}
2365
2380
  AND (c.pendingApproval IS NULL OR c.pendingApproval != 1)
2366
2381
  AND COALESCE(cu.approved, 1) != 0
2367
2382
  AND (cu.removed IS NOT 1 AND cu.removed IS NOT TRUE)
2368
2383
  AND (deleted_lookup.deleted_flag IS NULL OR deleted_lookup.deleted_flag != 1)
2369
- GROUP BY c.parentCid`).all(...params);
2384
+ GROUP BY c.parentCid`).all(...params, ...addrParams);
2370
2385
  for (const row of rows)
2371
2386
  result.set(row.parentCid, row.cid);
2372
2387
  }
@@ -3147,13 +3162,13 @@ export class DbHandler {
3147
3162
  activeScore: Math.max(post.comment.timestamp, post.commentUpdate.lastReplyTimestamp ?? 0)
3148
3163
  }));
3149
3164
  }
3150
- // Every reply (depth > 0) in the community, or under one post, with no exclusions applied: the one reply set a
3151
- // generation loads for its requireReplies sorts, each of which then filters it with its own exclusion options
3152
- // through applyPageSortExclusions (the same filter a client applies) and slices each comment's subtree from it
3153
- // (createDescendantsLookup). Lean on purpose (PageSortReplyEntry): a fixed column list mapped by hand, no
3165
+ // Every reply (depth > 0) with a CommentUpdate in the community, or under one post, with no exclusions applied:
3166
+ // the one reply set a generation loads for its requireReplies sorts. Only foreign replies are then dropped
3167
+ // (filterRepliesForPageSort); removed, deleted, pending and disapproved replies all reach the file, which applies
3168
+ // the sort's exclusions itself (issue #407). Each comment's subtree is sliced from it (createDescendantsLookup). Lean on purpose (PageSortReplyEntry): a fixed column list mapped by hand, no
3154
3169
  // signature, no nested pages, no schema row parser, since a board can hold a million replies and this runs per
3155
- // generation. A pending-approval reply is marked on its CommentUpdate the way the mod queue marks one, so the
3156
- // filter can see it; the list never reaches a page.
3170
+ // generation. A pending-approval reply is marked on its CommentUpdate the way the mod queue marks one, so a file
3171
+ // can see it; the list never reaches a page.
3157
3172
  queryAllRepliesForPageSort(opts = {}) {
3158
3173
  // A list of posts streams in batches under the SQLite variable cap: what a post sort with requireReplies
3159
3174
  // scores over, one batch of posts' subtrees at a time (issue #351)