Check issuable visibility before appending state

What's it doing?

Before trying to append the issue status, since we already have the user at hand, we could just remove all non-visible issues before trying to check the status.

The downside of this is that we're checking the visibility twice because we're doing it again in RedactorFilter. I am not sure if this would have performance impact.

Future note

  1. In IssueParser#issues_for_nodes, we should not memories values which could ignore arguments because it could give surprising results. I left it alone because we should focus on fixing 500 error first.

  2. We might be able to safely remove visibility check in RedactorFilter as an optimization. Of course we need to be careful with this though.

What are the relevant issue numbers?

Closes #31280 (closed)