Debug: disable feed reordering to isolate bugs

zio/stable
Paul Frazee 2022-12-13 11:15:32 -06:00
parent e37ac91bee
commit 9e1bb898f0
1 changed files with 26 additions and 21 deletions

View File

@ -551,29 +551,34 @@ function preprocessFeed(
feed: FeedItem[], feed: FeedItem[],
dedup: boolean, dedup: boolean,
): FeedItemWithThreadMeta[] { ): FeedItemWithThreadMeta[] {
const reorg: FeedItemWithThreadMeta[] = [] // DEBUG
for (let i = feed.length - 1; i >= 0; i--) { // this has been temporarily disabled to see if it's the cause of some bugs
const item = feed[i] as FeedItemWithThreadMeta // if the issues go away, we know this was the cause
// -prf
return feed
// const reorg: FeedItemWithThreadMeta[] = []
// for (let i = feed.length - 1; i >= 0; i--) {
// const item = feed[i] as FeedItemWithThreadMeta
if (dedup) { // if (dedup) {
if (reorg.find(item2 => item2.uri === item.uri)) { // if (reorg.find(item2 => item2.uri === item.uri)) {
continue // continue
} // }
} // }
const selfReplyUri = getSelfReplyUri(item) // const selfReplyUri = getSelfReplyUri(item)
if (selfReplyUri) { // if (selfReplyUri) {
const parentIndex = reorg.findIndex(item2 => item2.uri === selfReplyUri) // const parentIndex = reorg.findIndex(item2 => item2.uri === selfReplyUri)
if (parentIndex !== -1 && !reorg[parentIndex]._isThreadParent) { // if (parentIndex !== -1 && !reorg[parentIndex]._isThreadParent) {
reorg[parentIndex]._isThreadParent = true // reorg[parentIndex]._isThreadParent = true
item._isThreadChild = true // item._isThreadChild = true
reorg.splice(parentIndex + 1, 0, item) // reorg.splice(parentIndex + 1, 0, item)
continue // continue
} // }
} // }
reorg.unshift(item) // reorg.unshift(item)
} // }
return reorg // return reorg
} }
function getSelfReplyUri( function getSelfReplyUri(