Skip to content

Fix errors happening when session expired

Savas Vedova requested to merge 413627-type-check-object into master

What does this MR do and why?

Fix errors happening when session expired

When the session is expired, private projects return an empty project for XHR or GraphQL calls. This change uses optional chaining to prevent these errors happening.

This particular error occurs in the MRWidgetConflicts component. When the session is expired and user still tries to do something on the page which triggers GraphQL requests, the backend returns project null. Assuming the project is always populated, the frontend throws errors and this creates a lot of noise in our Sentry Backlog.

Screenshots or screen recordings

No screenshot available.

How to set up and validate locally

I'm not completely sure how one can replicate this case, but I know, by tracking the errors, that this file is responsible for triggering these errors.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #413627 (closed)

Merge request reports