appirio-tech / connect-app

Build your next project on Connect with the power of crowdsourcing
https://connect.topcoder.com
44 stars 139 forks source link

[$150] Connect project listing or project details page does not load when /notifications/list call timesout #2715

Open vikasrohit opened 5 years ago

vikasrohit commented 5 years ago

Expected behavior

Should load the app as normal, only thing that should not be working is the notifications panel

Actual behavior

It does not render any thing if there is a timeout in /notifications call

Steps to reproduce the problem

Screenshot/screencast

--

Environment

vikasrohit commented 5 years ago

@maxceem could you please take a look when you have time? It is not that urgent but good to have fixed as soon as possible because we are seeing such errors now too often.

maxceem commented 5 years ago

@vikasrohit sure, would you like it to be fixed before form wizard/dependant question is done or after?

vikasrohit commented 5 years ago

If it does not take more than 30 minutes, I would like to get it first as we are seeing issues on production.

maxceem commented 5 years ago

@vikasrohit I cannot reproduce the issue.

I simulate the timeout error by throwing error inside getNotifications in 30 seconds:

const getNotifications = () => {
  return new Promise(() => {
    setTimeout(() => {
      throw new Error('error loading getNotifications')
    }, 30000)
  })
  // return axios.get(`${TC_NOTIFICATION_URL}/list?read=false&limit=${NOTIFICATIONS_LIMIT}`)
  //  .then(resp => prepareNotifications(resp.data.items))
}

But both project listing and project details pages are loaded without any issues:

image

I guess both these pages could fail to be loaded if metadata requrests is failed due to timeout. It would help a lot if someone who next time experince such issue will share the screenshot of the browser console.

maxceem commented 5 years ago

@vikasrohit have seen this issue lately or maybe we can close it for now?

vikasrohit commented 5 years ago

Yes, I have seen it yesterday. Console just says timeout because list notifications call took more than 20 seconds.

I think to simulate you need to pass lesser timeout not greater. Try setting it to 100ms to simulate the timeout.

vikasrohit commented 5 years ago

@maxceem could we take this in our next bug bash?

maxceem commented 5 years ago

@vikasrohit I haven't yet managed to reproduce it, but will include it to the CF pipeline and will try one more time.

maxceem commented 5 years ago

To properly fix this issue we should do two things:

  1. [REQUIRED] Find a way to reproduce it. (we may need to simulate network error or something like that).
  2. [REQUIRED] Fix it.
vikasrohit commented 5 years ago

Just to confirm @maxceem, this is still happening on production and latest error occurred couple of days back on May 8, 2019.

sumitdaga commented 5 years ago

@maxceem can you please assign it to me ?

maxceem commented 5 years ago

sure

sumitdaga commented 5 years ago

@maxceem
is it possible that due to the network delay other api calls are also timing out and hence it seems that page is not loading ...i had set the network throttling to (a custom) very slow and saw this
Selection_154

maxceem commented 5 years ago

@sumitdaga as per report, the issue is that when loading notifications is failed, nothing is shown. So as I understand from report other requests works good, and the issue is that one failed request for notifications breaks the app.

In the way you suggest not only notifications request is failed, but others also. Here we try to understand how if only loading notifications is failed the whole app got broken.

This is as per report, unfortunately I don't have more information.

sumitdaga commented 5 years ago

@maxceem @vikasrohit
ok so to just mock timeout the notifications (or any call) i added another axiosInterceptor code block in this file https://github.com/appirio-tech/connect-app/blob/dev/src/api/requestInterceptor.js

Selection_155

and then i imported this in https://github.com/appirio-tech/connect-app/blob/dev/src/routes/notifications/services/notifications.js
so this i guess handles first part of the issue - how to mock failure of notifications due to network delay

but i still couldn't reproduce the main issue as you can see in the screenshot below

Selection_156

gautam1168 commented 5 years ago

@maxceem is this becoming open again?

maxceem commented 5 years ago

@sumitdaga yeah, this reproduces the delay and makes notifications requests failed, but doesn't reproduce the issue as projects are still shown.

Here I also tried another way to fail notifications request https://github.com/appirio-tech/connect-app/issues/2715#issuecomment-448142481, but it didn't break loading projects. But as per the report, there is only notifications timeout error in the console and everything is broken https://github.com/appirio-tech/connect-app/issues/2715#issuecomment-455044596.

So we have to find a way how failing loading notifications can break showing projects.

@gautam1168 as @sumitdaga is actively working on the issues and issue indeed may take more time due to its research nature, the issue would stay for @sumitdaga for now.

sumitdaga commented 5 years ago

@maxceem can you.please release me from this one and assign the other issue to me ..I don't know what else to do here

maxceem commented 5 years ago

Ok, @sumitdaga, thanks for giving a try.

This issues now open for pick up. The one who first comment can start working on it.

gautam1168 commented 5 years ago

ill give it a shot

maxceem commented 5 years ago

sure, it's on you

gautam1168 commented 5 years ago

A couple of queries:

  1. Do you have any info about the exact steps taken in the prod that caused the issue?
  2. Could this be browser specific? Which browser are they using when the issue occurred?
  3. Is the prod deployment public? So I can access that?
gautam1168 commented 5 years ago

Maybe it only happens in the when env is production. I tried to set the --env=production in the start script in package.json but the website didn't load even though it compiled with no errors. Do you know how to build and deploy in prod mode locally?

maxceem commented 5 years ago
  1. It looks like we just load connect app and see nothing. But maybe @vikasrohit has more info for this.
  2. @vikasrohit is there any info in which browser it has been caught?
  3. There is prod website where you can log in with your PROD Topcoder account http://connect.topcoder.com

Maybe it only happens in the when env is production. I tried to set the --env=production in the start script in package.json but the website didn't load even though it compiled with no errors. Do you know how to build and deploy in prod mode locally?

When we build website locally it builds and gzips files. So files in the dist folder are zipped. You can use this small server to run in PROD, download from here.

gautam1168 commented 5 years ago

By throwing an error in getNotifications in the prod build I can get the load of project list to delay a bit but I can't get it to crash. Even on production I was not able to reproduce the error. I have only tried on chrome.

I don't want to work on this anymore. Consider this issue released from me.

maxceem commented 5 years ago

Thanks for giving a try for it @gautam1168.

This issue is now open for pickup.

amitpatra commented 5 years ago

I would like to give it a try.

maxceem commented 5 years ago

sure @amitpatra

vikasrohit commented 5 years ago

@maxceem @gautam1168 @amitpatra just to reiterate, on production there is no specific way to reproduce it and this error occurs randomly and once it appeared it stays that way for some time. I mean after first occurance, even after multiple page refresh, it just dont load. Also, I didnt notice any other error in console apart from timeout for notifications call.

amitpatra commented 5 years ago

Hi, even I wasn't able to reproduce the issue, hence leaving it for pickup.

maxceem commented 5 years ago

Thanks for checking it @amitpatra.

This issue is now open for pickup.

maxceem commented 5 years ago

The prize for this issue is increased to $150. As we still cannot find a way to reproduce it, everybody may give it a try.

mfikria commented 5 years ago

@maxceem i would like to try, please assign me. Thanks!

maxceem commented 5 years ago

Sure, thanks.

maxceem commented 5 years ago

Hi everybody.

Please, don't forget to submit the list of issues you've been working on during this challenge with your Github and Topcoder handle. No matter if your PR is already approved or not yet.

This would speed up the payment process.

Thank you.

cc @akumar1503 @PrakashDurlabhji @sumitdaga @rashmi73 @applehit16