Guard the feed item before reading its author - #3504
Conversation
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.
|
Warning Review limit reached
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 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
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. Comment |
PR Summary by QodoGuard nullish feed items before checking muted authors
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can turn on the rule miner and Qodo learns your standards from review history |
1 similar comment
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can turn on the rule miner and Qodo learns your standards from review history |
Follow-up to #3503, from a review finding on it.
Both mute filters in
postsListContainerreaditem.authorand 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.isAuthorMutedis 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 atitem.authorrather than being filtered out.872 unit tests pass,
tsc --noEmitclean, lint clean.