From b7c20560c2337fd1e0febcd16a45d3f52f01e6d6 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Sun, 20 Sep 2026 08:44:25 -0700 Subject: [PATCH] Review following feed cap: drop dead reply-txid loader Remove PostQuery.loadReplyTxids after the capped following-feed scan switched to per-candidate isReply point lookups; it had no callers and was the only uncovered code in post-query.js (99.4% -> 100%). Refresh the mutate4javascript and acceptance-mutation manifests via the tools. By architect. --- psf-memo-db/specs/following-feed-performance.feature | 4 ++++ psf-memo-db/src/adapters/post-query.js | 8 +------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/psf-memo-db/specs/following-feed-performance.feature b/psf-memo-db/specs/following-feed-performance.feature index e52f9f8..af28d18 100644 --- a/psf-memo-db/specs/following-feed-performance.feature +++ b/psf-memo-db/specs/following-feed-performance.feature @@ -1,3 +1,7 @@ +# acceptance-mutation-manifest-begin +# {"version":1,"tested_at":"2026-09-20T15:43:36.389566985Z","feature_name":"Following Feed Performance","feature_path":"/home/trout/work/psf-memo/.worktrees/architect/psf-memo-db/specs/following-feed-performance.feature","background_hash":"ddac8c7374fb5f53e3fab0ba7b510e5a9e43e97adb8e6ad84567ecd254cbd53d","implementation_hash":"unknown","scenarios":[]} +# acceptance-mutation-manifest-end + # Scenarios: Following Feed Performance - 1, Following Feed Performance - 2 # # GET /posts/following/:addr is slow because list-following-feed.js does two diff --git a/psf-memo-db/src/adapters/post-query.js b/psf-memo-db/src/adapters/post-query.js index b9c48f9..436ae2e 100644 --- a/psf-memo-db/src/adapters/post-query.js +++ b/psf-memo-db/src/adapters/post-query.js @@ -6,7 +6,6 @@ - postLikes: likes grouped by liked post txid */ -import { loadReplyTxids } from './lib/load-reply-txids.js' import { getPostOrNull as getPostOrNullShared } from './lib/get-post-or-null.js' import { loadMutedAddrs, isMutedPost } from './lib/muted-posts.js' @@ -57,7 +56,6 @@ class PostQuery { this.txidFromPostHeight = this.txidFromPostHeight.bind(this) this.txidFromAddrPostHeight = this.txidFromAddrPostHeight.bind(this) this.getPostOrNull = this.getPostOrNull.bind(this) - this.loadReplyTxids = this.loadReplyTxids.bind(this) this.isReply = this.isReply.bind(this) this.isFolloweePost = this.isFolloweePost.bind(this) this.scanFollowingFeedTxidsAndCount = this.scanFollowingFeedTxidsAndCount.bind(this) @@ -94,10 +92,6 @@ class PostQuery { return parts[parts.length - 1] } - async loadReplyTxids () { - return loadReplyTxids(this.postParentsDb) - } - async isReply (txid) { try { await this.postParentsDb.get(txid) @@ -326,5 +320,5 @@ class PostQuery { export default PostQuery // mutate4javascript-manifest-begin -// {"version":1,"tested_at":"2026-09-16T15:54:38.189Z","module_hash":"2fac2866f060105e658c0b83d0e3aa64aee0265d984d11b0d36f1f8605843323","functions":[{"id":"func/PostQuery.constructor","name":"PostQuery.constructor","line":17,"end_line":64,"hash":"389e45e5bd381a002b5e98bde2c32805e5adc930290d78b85848ff2caae596d0"},{"id":"func/PostQuery.padHeight","name":"PostQuery.padHeight","line":66,"end_line":68,"hash":"be6c442a4d3d86ab3b60314756b7f7c0592479c21cb3b2e1273dcf139a84fb00"},{"id":"func/PostQuery.postHeightKey","name":"PostQuery.postHeightKey","line":70,"end_line":72,"hash":"2d4dff9464aa4c1e805da5de2ba314fbd856530c046705237ea848d5feff8c7c"},{"id":"func/PostQuery.addrPostHeightKey","name":"PostQuery.addrPostHeightKey","line":74,"end_line":76,"hash":"48579f08593cee36cc2f107c2526ac9def687b354cc5e54089defa3fd37117eb"},{"id":"func/PostQuery.postLikeKey","name":"PostQuery.postLikeKey","line":78,"end_line":80,"hash":"5d16caac2cf88932702b28f9d95927183f8904948eb8c16c7e8c672cd3a0780c"},{"id":"func/PostQuery.txidFromPostHeight","name":"PostQuery.txidFromPostHeight","line":82,"end_line":85,"hash":"0fd135c51089dcc9bd2f166bb9f28faaa6a03d7eb84cf03cb9b36e97cdb3139c"},{"id":"func/PostQuery.txidFromAddrPostHeight","name":"PostQuery.txidFromAddrPostHeight","line":87,"end_line":89,"hash":"314d5432292a78b273e3165343d3e09276600cbaf239f76bcd1b36fe5fcf5e10"},{"id":"func/PostQuery.txidFromKeyParts","name":"PostQuery.txidFromKeyParts","line":92,"end_line":95,"hash":"59fb8173599070095d87e5d6f56eeb999f79e75e4d3f3e435515e9db8ac71868"},{"id":"func/PostQuery.loadReplyTxids","name":"PostQuery.loadReplyTxids","line":97,"end_line":99,"hash":"74621495a3affc6ef8688b9d6a814a91c99b22c86c348d261c952aad25df1661"},{"id":"func/PostQuery.isReply","name":"PostQuery.isReply","line":101,"end_line":109,"hash":"be2e3729bd5f05cbfbab3630678eb5c389bd04c616d53b1e0c48c852f4cb25b1"},{"id":"func/PostQuery.listChildTxids","name":"PostQuery.listChildTxids","line":115,"end_line":130,"hash":"e2016c239c309e4e8771788c788941e308dad11103bc1247d971961ff532cea8"},{"id":"func/PostQuery.countRepliesForTxids","name":"PostQuery.countRepliesForTxids","line":133,"end_line":141,"hash":"874b637df6cb92b898c8f58340639794cdadd053227bd020812b1a7c8f2106c9"},{"id":"func/PostQuery.countLikesForTxids","name":"PostQuery.countLikesForTxids","line":144,"end_line":159,"hash":"54e6e3e6467e72d9dd033c9861b3b9ef5e426a76aed7a13e8ac1a0f0389468a3"},{"id":"func/PostQuery.likeTxidFromPostLike","name":"PostQuery.likeTxidFromPostLike","line":161,"end_line":165,"hash":"7e07a9c278a9abae8f646b4f1950f88760f2d5c6445600a42fa42f36d029a45a"},{"id":"func/PostQuery.postTxidFromPostLike","name":"PostQuery.postTxidFromPostLike","line":167,"end_line":171,"hash":"da7f8d0c63dbc074fb25da1a31dde5075c2c3469b84a5c700bd4a2961879d8e9"},{"id":"func/PostQuery.getPostOrNull","name":"PostQuery.getPostOrNull","line":174,"end_line":176,"hash":"d06ce38cd8bde722482a749ff58740b174a054900519e67d2045f29a18fce3f7"},{"id":"func/PostQuery.scanRecentPostTxids","name":"PostQuery.scanRecentPostTxids","line":178,"end_line":181,"hash":"004bb510a7463333b7aba90f732e84aa3c16243b0c891d9697068d18723380f3"},{"id":"func/PostQuery.isEligibleRecentPost","name":"PostQuery.isEligibleRecentPost","line":184,"end_line":188,"hash":"92d427447b5d23b22ac34829419382457b06d8a74908cbe1bd19e65cab21d571"},{"id":"func/PostQuery.scanRecentPostTxidsAndCount","name":"PostQuery.scanRecentPostTxidsAndCount","line":195,"end_line":223,"hash":"d6a4a8fbecdb9b27b23917160e414db4e31195385a468b2d766cdbc6dba4a197"},{"id":"func/PostQuery.scanPostsByAddrTxidsAndCount","name":"PostQuery.scanPostsByAddrTxidsAndCount","line":229,"end_line":257,"hash":"a872d7a1f71ce1ba6a1dee46a820989cbbb7287dfc433051be1e15890dbc010b"},{"id":"func/PostQuery.scanPostsByAddrTxids","name":"PostQuery.scanPostsByAddrTxids","line":260,"end_line":263,"hash":"3498f2b9615e79b9472a5c7be26520c78db7c1661071c90a882f981d8acca477"},{"id":"func/PostQuery.loadPostsByTxids","name":"PostQuery.loadPostsByTxids","line":265,"end_line":281,"hash":"86b05107f3ecc240b2e734217cedf29ef44c48474bf31c1c8f75f2e4b4f84bea"},{"id":"func/PostQuery.scanFollowingFeedTxidsAndCount","name":"PostQuery.scanFollowingFeedTxidsAndCount","line":286,"end_line":310,"hash":"1ef4b7fb555d82c33971d3e0a4d2f630c42eb86261a78cd34765a5e3736e5946"},{"id":"func/PostQuery.isFolloweePost","name":"PostQuery.isFolloweePost","line":315,"end_line":320,"hash":"7825f4509ef5103d2340ecb1434b483b02c7b435a263777ca89e4a0d345f2be3"}]} +// {"version":1,"tested_at":"2026-09-20T15:38:54.279Z","module_hash":"8df34832697660080677af00361f1a91829b40762a78aa1faf865015283bd022","functions":[{"id":"func/PostQuery.constructor","name":"PostQuery.constructor","line":16,"end_line":62,"hash":"e6ac5ad9e0b49cb14467260ff0a33404071ad38b991263377cc0a8c110cfc309"},{"id":"func/PostQuery.padHeight","name":"PostQuery.padHeight","line":64,"end_line":66,"hash":"be6c442a4d3d86ab3b60314756b7f7c0592479c21cb3b2e1273dcf139a84fb00"},{"id":"func/PostQuery.postHeightKey","name":"PostQuery.postHeightKey","line":68,"end_line":70,"hash":"2d4dff9464aa4c1e805da5de2ba314fbd856530c046705237ea848d5feff8c7c"},{"id":"func/PostQuery.addrPostHeightKey","name":"PostQuery.addrPostHeightKey","line":72,"end_line":74,"hash":"48579f08593cee36cc2f107c2526ac9def687b354cc5e54089defa3fd37117eb"},{"id":"func/PostQuery.postLikeKey","name":"PostQuery.postLikeKey","line":76,"end_line":78,"hash":"5d16caac2cf88932702b28f9d95927183f8904948eb8c16c7e8c672cd3a0780c"},{"id":"func/PostQuery.txidFromPostHeight","name":"PostQuery.txidFromPostHeight","line":80,"end_line":83,"hash":"0fd135c51089dcc9bd2f166bb9f28faaa6a03d7eb84cf03cb9b36e97cdb3139c"},{"id":"func/PostQuery.txidFromAddrPostHeight","name":"PostQuery.txidFromAddrPostHeight","line":85,"end_line":87,"hash":"314d5432292a78b273e3165343d3e09276600cbaf239f76bcd1b36fe5fcf5e10"},{"id":"func/PostQuery.txidFromKeyParts","name":"PostQuery.txidFromKeyParts","line":90,"end_line":93,"hash":"59fb8173599070095d87e5d6f56eeb999f79e75e4d3f3e435515e9db8ac71868"},{"id":"func/PostQuery.isReply","name":"PostQuery.isReply","line":95,"end_line":103,"hash":"be2e3729bd5f05cbfbab3630678eb5c389bd04c616d53b1e0c48c852f4cb25b1"},{"id":"func/PostQuery.listChildTxids","name":"PostQuery.listChildTxids","line":109,"end_line":124,"hash":"e2016c239c309e4e8771788c788941e308dad11103bc1247d971961ff532cea8"},{"id":"func/PostQuery.countRepliesForTxids","name":"PostQuery.countRepliesForTxids","line":127,"end_line":135,"hash":"874b637df6cb92b898c8f58340639794cdadd053227bd020812b1a7c8f2106c9"},{"id":"func/PostQuery.countLikesForTxids","name":"PostQuery.countLikesForTxids","line":138,"end_line":153,"hash":"54e6e3e6467e72d9dd033c9861b3b9ef5e426a76aed7a13e8ac1a0f0389468a3"},{"id":"func/PostQuery.likeTxidFromPostLike","name":"PostQuery.likeTxidFromPostLike","line":155,"end_line":159,"hash":"7e07a9c278a9abae8f646b4f1950f88760f2d5c6445600a42fa42f36d029a45a"},{"id":"func/PostQuery.postTxidFromPostLike","name":"PostQuery.postTxidFromPostLike","line":161,"end_line":165,"hash":"da7f8d0c63dbc074fb25da1a31dde5075c2c3469b84a5c700bd4a2961879d8e9"},{"id":"func/PostQuery.getPostOrNull","name":"PostQuery.getPostOrNull","line":168,"end_line":170,"hash":"d06ce38cd8bde722482a749ff58740b174a054900519e67d2045f29a18fce3f7"},{"id":"func/PostQuery.scanRecentPostTxids","name":"PostQuery.scanRecentPostTxids","line":172,"end_line":175,"hash":"004bb510a7463333b7aba90f732e84aa3c16243b0c891d9697068d18723380f3"},{"id":"func/PostQuery.isEligibleRecentPost","name":"PostQuery.isEligibleRecentPost","line":178,"end_line":182,"hash":"92d427447b5d23b22ac34829419382457b06d8a74908cbe1bd19e65cab21d571"},{"id":"func/PostQuery.scanRecentPostTxidsAndCount","name":"PostQuery.scanRecentPostTxidsAndCount","line":189,"end_line":217,"hash":"d6a4a8fbecdb9b27b23917160e414db4e31195385a468b2d766cdbc6dba4a197"},{"id":"func/PostQuery.scanPostsByAddrTxidsAndCount","name":"PostQuery.scanPostsByAddrTxidsAndCount","line":223,"end_line":251,"hash":"a872d7a1f71ce1ba6a1dee46a820989cbbb7287dfc433051be1e15890dbc010b"},{"id":"func/PostQuery.scanPostsByAddrTxids","name":"PostQuery.scanPostsByAddrTxids","line":254,"end_line":257,"hash":"3498f2b9615e79b9472a5c7be26520c78db7c1661071c90a882f981d8acca477"},{"id":"func/PostQuery.loadPostsByTxids","name":"PostQuery.loadPostsByTxids","line":259,"end_line":275,"hash":"86b05107f3ecc240b2e734217cedf29ef44c48474bf31c1c8f75f2e4b4f84bea"},{"id":"func/PostQuery.scanFollowingFeedTxidsAndCount","name":"PostQuery.scanFollowingFeedTxidsAndCount","line":284,"end_line":307,"hash":"19fa8a855d1884251e377153b6846ae2aa9dff1757896d90a03d9ed23eb28b9e"},{"id":"func/PostQuery.isFolloweePost","name":"PostQuery.isFolloweePost","line":312,"end_line":317,"hash":"f43c39079889b0419759cde65a0b257f31408eef2d543114669e6f3dac653375"}]} // mutate4javascript-manifest-end