Skip to content

Guard the feed item before reading its author - #3504

Merged
feruzm merged 1 commit into
developmentfrom
bugfix/muted-filter-author-guard
Aug 15, 2026
Merged

Guard the feed item before reading its author#3504
feruzm merged 1 commit into
developmentfrom
bugfix/muted-filter-author-guard

Conversation

@feruzm

@feruzm feruzm commented Aug 15, 2026

Copy link
Copy Markdown
Member

Follow-up to #3503, from a review finding on it.

Both mute filters in postsListContainer read item.author and then checked !!item?.author, so the optional chaining that exists to tolerate a nullish item sat after two dereferences of it. The guard goes first now.

isAuthorMuted is null-safe on its own (!!author && !!mutedAuthors?.includes(author)), so this was never the throw the review read it as, and the ordering predates #3503. It still says the opposite of what the code means, and a nullish item would take the feed down at item.author rather than being filtered out.

872 unit tests pass, tsc --noEmit clean, lint clean.

Both mute filters read item.author and then checked !!item?.author, so the
optional chaining that was there to tolerate a nullish item came after two
dereferences of it. The guard goes first now.

isAuthorMuted is null-safe on its own, so this was never the throw a reviewer
read it as, but the ordering says the opposite of what the code means.
@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@feruzm, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 46 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: eb853558-30b7-4cee-b218-256447d6a356

📥 Commits

Reviewing files that changed from the base of the PR and between c33b3ec and 7e32e24.

📒 Files selected for processing (1)
  • src/components/postsList/container/postsListContainer.tsx

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@qodo-code-review

qodo-code-review Bot commented Aug 15, 2026

Copy link
Copy Markdown

PR Summary by Qodo

Guard nullish feed items before checking muted authors

🐞 Bug fix 🕐 10-20 Minutes

Grey Divider

AI Description

• Reorder author-mute filters to guard item?.author before any dereference.
• Add an explicit author null-check in promoted post filtering to avoid feed crashes.
• Clarify intent with comments so nullish items are safely filtered out.
Diagram

graph TD
  F[("Feed items")] --> PLC["postsListContainer.tsx"] --> UI["Posts list UI"]
  PLC --> IAM[["isAuthorMuted()"]] --> M[("Muted authors list")]

  subgraph Legend
    direction LR
    _db[("Data") ] ~~~ _mod["Module"] ~~~ _fn[["Function"]]
  end
Loading
High-Level Assessment

The PR’s approach (guard first, then dereference) is the most direct and readable fix for preventing nullish feed items from crashing the filter path. Considered but not necessary here: extracting a shared type-guard predicate to narrow items with author for reuse—helpful only if this pattern repeats widely.

Files changed (1) +7 / -2

Bug fix (1) +7 / -2
postsListContainer.tsxReorder mute filters to guard author presence before dereference +7/-2

Reorder mute filters to guard author presence before dereference

• Reorders the primary feed filtering predicate so '!!item?.author' is evaluated before 'item.author' is referenced. Adds an explicit early-return guard for 'promotedPosts' items without an author, then applies muted-author filtering and existing permlink de-dup logic safely.

src/components/postsList/container/postsListContainer.tsx

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can turn on the rule miner and Qodo learns your standards from review history

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

1 similar comment
@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can turn on the rule miner and Qodo learns your standards from review history

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@feruzm
feruzm merged commit 86e866a into development Aug 15, 2026
8 checks passed
@feruzm
feruzm deleted the bugfix/muted-filter-author-guard branch August 15, 2026 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant