Problem/Motivation
An user reported on this slack thread https://drupal.slack.com/archives/C5ABFBZ5Z/p1673950377454769 a JS error. Because of it, there are some other parts of the page that aren't loaded, as they rely on JS code, like the tests results for a MR, as well as others.
Steps to reproduce
Not sure for how long this will keep on happening, as uncached pages seem to be ok.
It depends on whether the gitlab endpoint times out or not. For now we saw it in #2959723: Create an initial class for the batch processor service shows the error.
The error is this:
Uncaught (in promise) TypeError: Cannot read properties of null (reading 'notes')
Debugging the graphql call we can see that the issue is due to timeouts. This is the result:
{
"data": {
"project": {
"mergeRequests": {
"nodes": [
null
]
}
}
},
"errors": [
{
"message": "Timeout on Discussion.id",
... ]
},
{
"message": "Timeout on Note.author",
...
},
{
"message": "Timeout on Note.id",
...
},
{
"message": "Timeout on Note.id",
...
Proposed resolution
If there is no data returned, don't go through the code and perhaps show a message to the user.
Remaining tasks
Provide MR.
User interface changes
If the same happens, MR notes won't be shown but the rest of the JS in the page should continue to work.
API changes
None.
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | Issue-3334134-console-error.png | 237.54 KB | bhanu951 |
Issue fork drupalorg-3334134
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
fjgarlin commentedReady for review, at least there won't be a JS error in this scenario.
Comment #4
bhanu951 commented@fjgarlin : Can confirm that I am facing this issue .
>as uncached pages seem to be ok.
I don't think this is the case as there are still errors in the console even after adding random query param string to the url.
Was having same issue #2959723 from a long time. Commits used to appear after couple of minutes after page load. But from the past 5-6 hours they are not being visible anymore.
Please refer below image.
Comment #5
bhanu951 commented@fjgarlin:
As an end user is there any way I can test this fix ?
Comment #6
fjgarlin commentedAgree, it's not cache related. It's the gitlab endpoint timing out.
This MR will just fix the javascript code not breaking, the timeout is another issue altogether which the infra team is looking at.
I don't think that there is a way that you can test it I'm afraid (other than checking the code in the MR). Thanks for the confirmation of the issue and the additional information.
Comment #7
fjgarlin commentedComment #8
fjgarlin commentedComment #11
drummThis has been deployed
Comment #12
bhanu951 commentedFTR , Additional Timeout errors I got in console.
Comment #13
fjgarlin commentedThose are related to a different issue and being addressed separately. Thanks for reporting them.