nareddyt / discover-rewards-notifier

A Chrome Extension that shows a notification when visiting sites that qualify for Discover® Deals or Cashback Rewards.
https://www.tejunareddy.com/discover-rewards-notifier/
GNU General Public License v3.0
6 stars 14 forks source link

`ERR_NETWORK_IO_SUSPENDED` when fetching data periodically #53

Closed nareddyt closed 6 years ago

nareddyt commented 6 years ago

Sometimes, the Chrome Extension fails to fetch the latest Discover Data. The logs in the background page claim this occured due to a ERR_NETWORK_IO_SUSPENDED error.

After some further googling, it seems like this occurs when a user's computer goes to sleep and tries to make a request just when it wakes up.

As stated in this stackoverflow post, it seems like we need to set an ajax timeout to fix this issue.

nareddyt commented 6 years ago

We are not using ajax for the request. We're using XMLHttpRequest instead, so this solution doesn't apply.

nareddyt commented 6 years ago

Simple fix for XMLHttpRequest: http://semisignal.com/?tag=err_network_io_suspended