mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix(post ids): fall back to comment cid for missing ids (#1167)
* fix(post ids): fall back to comment cid for missing ids * fix(post ids): count cid-resolved account replies
This commit is contained in:
@@ -27,13 +27,14 @@ describe('getThreadPostCountsByAuthor', () => {
|
||||
expect(counts.get('author-b')).toBe(2);
|
||||
});
|
||||
|
||||
it('skips comments missing a cid or short address', () => {
|
||||
it('uses cid fallback for comments without author metadata', () => {
|
||||
const counts = getThreadPostCountsByAuthor(
|
||||
{ cid: 'post-1', author: { shortAddress: 'author-a' } } as any,
|
||||
[{ cid: 'reply-1' }, { author: { shortAddress: 'author-b' } }] as any[],
|
||||
);
|
||||
|
||||
expect(counts.get('author-a')).toBe(1);
|
||||
expect(counts.get('reply-1')).toBe(1);
|
||||
expect(counts.has('author-b')).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user