freaktechnik / justintv-stream-notifications

This Firefox add-on displays a notification when a channel on Twitch, Youtube, Mixer or many more services goes live. Which channels are checked for being live is fully customizable.
https://freaktechnik.github.io/justintv-stream-notifications
Other
38 stars 10 forks source link

Streams are not automatically updated periodically. #463

Open Dutchs opened 5 years ago

Dutchs commented 5 years ago

Streams are not automatically updated periodically. Manually pressing refresh does update them.

System Info

Console Output

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://api.twitch.tv/helix/users?id=26784951. (Reason: CORS request did not succeed).[Learn More]

Error during low update request https://api.twitch.tv/helix/users?id=26784951 for twitch : TypeError: "NetworkError when attempting to fetch resource." index.js:1767:13

TypeError: Argument 1 of PrecompiledScript.executeInGlobal is not an object.[Learn More] ExtensionContent.jsm:492:18

Error: "Could not establish connection. Receiving end does not exist."
    [42]/< moz-extension://5ae43b1b-221e-4c10-bba8-c4b6fd48ea87/background/index.js:8240

Error: Port disconnected

Debug Dump

{
  "channels": [
      -snipped-
  ],
  "users": [
    {
      "uname": "Dutchs",
      "login": "26784951",
      "slug": "dutchs",
      "image": {
        "50": "https://static-cdn.jtvnw.net/user-default-pictures/cd618d3e-f14d-4960-b7cf-094231b04735-profile_image-50x50.jpg",
        "70": "https://static-cdn.jtvnw.net/user-default-pictures/cd618d3e-f14d-4960-b7cf-094231b04735-profile_image-70x70.jpg",
        "150": "https://static-cdn.jtvnw.net/user-default-pictures/cd618d3e-f14d-4960-b7cf-094231b04735-profile_image-150x150.jpg",
        "300": "https://static-cdn.jtvnw.net/user-default-pictures/cd618d3e-f14d-4960-b7cf-094231b04735-profile_image-300x300.jpg"
      },
      "type": "twitch",
      "id": 7,
      "favorites": []
    }
  ],
  "prefs": {
    "queue": {
      "interval": 60,
      "requests": 4,
      "maxRetries": 5
    },
    "panel": {
      "style": "0",
      "extras": true,
      "badge": true
    },
    "misc": {
      "cacheTime": 600000,
      "findMature": true
    }
  },
  "meta": {
    "version": "3.11.1",
    "platform": "win",
    "platformArch": "x86-64",
    "language": "en-US",
    "lastError": null
  }
}
freaktechnik commented 5 years ago

That CORS error seems bad (and an issue on Twitch's side). However that's for the channels you follow and not the stream states.

I'll have to check that the error doesn't break the queuing system though (it shouldn't, that's built to pass on the errors to whoever queued the request).

Apart from that everything seems fine and I haven't seen anything similar on my side (I have the extension running at least 8h a day with about 50 channels).

Dutchs commented 5 years ago

Full console log for this session: livestream_log.txt

And heres what it looks like for me (both screenshots taken in the span of under a minute) before manually refreshing: before after manually refreshing: after

freaktechnik commented 5 years ago

So that log shows the requests also failing for other endpoints. Great.

Do you have something that could be filtering your network traffic or modifying it? Optimally you'd get the HAR from the network panel in the debugging tools (about:debugging).

I have yet to check if there's something on the extension side I can do to improve how it handles these requests failing.

Dutchs commented 5 years ago

other then my AV webshield, not that im aware (and there is no mention of it blocking the requests in its logs)

I am seeing a difference in the requests made automatically vs manually but i can't say im familiar enough with the API to spot if something is wrong there

These requests are made when it periodically (automatically) does a refresh: refresh_periodical And these are made when i hit the "refresh the live statuses of all channels" button refresh_manual

freaktechnik commented 5 years ago

The periodical ones are clearly missing the actual stream checks that you see in the seconds one. These logs also aren't matching what is logged to the browser console (the CORS errors, since those are network erros).

Dutchs commented 5 years ago

yep these are from just now, as the network tab does not retroactively store the made requests, ill check if it throws any errors in the console when the next periodic refresh is made~

EDIT: there is no console output that accompanies these periodic requests.

Dutchs commented 5 years ago

As a update; Over the course of days i had no more Cross-Origin Request Blocked and network errors so those logs might have been a fluke. It kept up the same symptoms though and failed to update periodically.

After removal and reinstall of the addon all symptoms seem to have disappeared and its back to normal, not sure what the root cause was here.