From d9f42585432f37bcfb5ed2a7c5828454c40f725b Mon Sep 17 00:00:00 2001 From: Grace Kind Date: Mon, 17 Aug 2026 21:13:27 -0500 Subject: [PATCH] Fix deleted reply tombstoning issue --- package.json | 2 +- src/js/feedFilters.js | 6 +++--- tests/unit/specs/feedFilters.test.js | 23 +++++++++++++++++++++++ 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index a0a7bde8..27e3891b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "impro", - "version": "0.19.13", + "version": "0.19.14", "type": "module", "scripts": { "start": "rm -rf \"${BUILD_DIR:-build}\" && NODE_ENV=development eleventy --serve", diff --git a/src/js/feedFilters.js b/src/js/feedFilters.js index 9a4fe442..0faffa78 100644 --- a/src/js/feedFilters.js +++ b/src/js/feedFilters.js @@ -329,12 +329,12 @@ export function filterFollowingFeed( ...(followingFeedPreference?.hideQuotePosts ? [new FilterQuotePosts()] : []), + new FilterEmptyPosts(), new DedupeFeed(), new FilterBlockedQuotes(), new FilterBlockedPosts(), new FilterMutedQuotes(), new FilterMutedPosts(), - new FilterEmptyPosts(), new FilterHiddenPosts(), new FilterContentLabeledPosts(), new FilterPluginFilteredPosts(pluginFilteredFeedItems), @@ -351,12 +351,12 @@ export function filterAlgorithmicFeed( pluginFilteredFeedItems, ) { const filter = FeedFilter.compose( + new FilterEmptyPosts(), new FilterBlockedQuotes(), new FilterBlockedPosts(), new DedupeFeed(), new FilterMutedQuotes(), new FilterMutedPosts(), - new FilterEmptyPosts(), new FilterHiddenPosts(), new FilterContentLabeledPosts(), new FilterUnauthorizedPosts(isAuthenticated), @@ -377,8 +377,8 @@ export function filterBookmarksFeed(feed) { export function filterAuthorFeed(feed, isAuthenticated) { const filter = FeedFilter.compose( - new DedupeFeed({ includeReposts: false }), new FilterEmptyPosts({ checkParents: false }), + new DedupeFeed({ includeReposts: false }), new FilterHiddenPosts(), new FilterContentLabeledPosts(), new FilterUnauthorizedPosts(isAuthenticated), diff --git a/tests/unit/specs/feedFilters.test.js b/tests/unit/specs/feedFilters.test.js index 5e072c90..2c61e9b0 100644 --- a/tests/unit/specs/feedFilters.test.js +++ b/tests/unit/specs/feedFilters.test.js @@ -357,6 +357,29 @@ describe("filterAuthorFeed", () => { assert.deepEqual(result.feed.length, 2); }); + it("should keep the rest of a thread when its newest reply is deleted", () => { + const rootUri = "at://did:plc:test/app.bsky.feed.post/root"; + const items = [ + createFeedItem({ + post: { + uri: "at://did:plc:test/app.bsky.feed.post/deleted-reply", + $type: "app.bsky.feed.defs#notFoundPost", + }, + reply: { + root: { uri: rootUri }, + parent: { uri: rootUri }, + }, + }), + createFeedItem({ post: { uri: rootUri } }), + ]; + const feed = createFeed(items); + + const result = filterAuthorFeed(feed, true); + + assert.deepEqual(result.feed.length, 1); + assert.deepEqual(result.feed[0].post.uri, rootUri); + }); + it("should not deduplicate reposts with the same root URI", () => { const rootUri = "at://did:plc:root/app.bsky.feed.post/123"; const items = [ -- 2.51.2