Code Monkey home page Code Monkey logo

Comments (8)

kkkrist avatar kkkrist commented on June 5, 2024

Thanks for reporting this problem! This is most likely a general network error. The extension is unable to connect to one of the APIs. Does it go away after you re-install chromium-notifier or after the next refresh (happens every ~3h)?

You could right-click on the popup window, click inspect and see if the devtools console shows any errors. The background process also has its own devtools console: Go to chrome://extensions/ and click on the "background.html" link of the extension. Do the consoles show any details?

from chromium-notifier.

jniggemann avatar jniggemann commented on June 5, 2024

Didn't dig too deply, it seems to me that the error is caused in the background process when the very first call to the woolyss API is made. Possibly some async issue, not sure. As a test and workaround I added a sleep function in the background process. Ugly, but works.

function sleep(ms) {
  return new Promise(resolve => setTimeout(resolve, ms));
}

Now, with a second of sleep before calling the woolyss API, everything is fine.

 const p = [
    sleep(1000).then(() => {
	  fetch('https://chromium.woolyss.com/api/v4/?app=MTkxMDA5', {
	    method: 'POST'
	  })
        .then(res => res.text())
        .then(text => {
          try {
            const json = JSON.parse(text)
            return json
		  } catch (error) {
            throw new Error(
              `${error.message} (Woolyss API): ${
                text.length > 60
                  ? text.slice(0, 30) + '…' + text.slice(text.length - 30)
                  : text
              }`
            )
          }
        })
  	})
  ]

from chromium-notifier.

kkkrist avatar kkkrist commented on June 5, 2024

I don't see how the sleep could make a difference here? Does it always happen on the first call (after re-installing)? Can you reliably reproduce the error? Unfortunately, I'm unable to reproduce it in any shape or form. But these errors do get reported quite frequently, so you're not alone.

My guess is that the Woolyss API sometimes responds with a HTTP error (like a 500) which is reported using the default Apache error handler. These error responses probably don't have any CORS headers, which would cause a "Failed to fetch" TypeError. But really, "Failed to fetch" could be any kind of connectivity problem.

Edit: In the screenshots you posted earlier, the first error occurred while trying to fetch the extension data from the privacy proxy, whereas the latter ones happened when trying to fetch from the Woolyss API. That would indicate a general connection issue.

from chromium-notifier.

kkkrist avatar kkkrist commented on June 5, 2024

I ran some queries on the error logs. Unfortunately they don't provide any clues. There are about 20-25 of these errors per day throughout the last few weeks. OS distribution looks normal. This error seems to be only reported once per user, there was just one user reporting twice (according to ip hash).

I don't know how many total users this extension has and how many of them have error tracking enabled. Guessing by privacy proxy usage it seems a few thousand unique users per week. So this probably is a single-digit percentage, that's bad enough :(

from chromium-notifier.

jniggemann avatar jniggemann commented on June 5, 2024

I don't see how the sleep could make a difference here?

They say "well guessed is half-known", it was a shot in the blue tbh. Perhaps the extension runs very early, before chromium is able to use the network?

Does it always happen on the first call (after re-installing)?

Yes

Can you reliably reproduce the error?

Yes

Edit: In the screenshots you posted earlier, the first error occurred while trying to fetch the extension data from the privacy proxy, whereas the latter ones happened when trying to fetch from the Woolyss API. That would indicate a general connection issue.

That's what I think, too. Although my machine doesn't have connectivity issues. I've checked for packet loss and genereal network issues, but did not find any, leading to the aforementioned idea of running before chromium can use the network.

I'm not a good dev, but if you have some code snippets that would help debug this, I'm happy to help.

from chromium-notifier.

kkkrist avatar kkkrist commented on June 5, 2024

I still cannot reproduce it. Can you write down the exact steps? Could you also try to reproduce it with all other extensions disabled?

from chromium-notifier.

jniggemann avatar jniggemann commented on June 5, 2024

Did some more tests and I can no longer reliably reproduce it. I can't for the life of me understand why, but I'll get back to you if I can reproduce it again.

Thank you for your help and this extension :-)

from chromium-notifier.

kkkrist avatar kkkrist commented on June 5, 2024

What a mystery! In any case, I've just released v1.8.8 which should also log full stack traces caught by the window.onunhandledrejection handler. Maybe that provides more hints.

You're very welcome, thank you too! :-)

from chromium-notifier.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.