Abstract: Fundebug’s front-end JavaScript error monitoring plugin has been updated to 1.2.0: supports WebSocket connection errors; Fixed a BUG that monitored unhandledrejection errors, i.e., promises that were not handled with a catch; And some other optimizations. Please update the plugins in time!

Monitor WebSocket connection errors

Now, WebSockect has more and more application scenarios. For example, the front page of Fundebug shows the cumulative number of errors handled, which is currently over 600 million. This data is calculated in real time in the background, and then returned to the front end through WebSocket. By the way, the statistical method of some friend business is weird, the number is still updated after the network is cut off! I think we all understand why 🙂

Assuming the correct WebSocket address is wss://api.fundebug.com/api/events/count, if the address accidentally made a mistake,

var ws = new WebSocket("wss://ap.fundebug.com/api/events/count");
ws.onerror = function(event)
{
    console.log("WebSocket onerror")
}
Copy the code

The WebSocket connection will obviously fail:

WebSocket connection to 'wss://ap.fundebug.com/api/events/count' failed: Error in connection establishment: net::ERR_SOCKS_CONNECTION_FAILED
Copy the code

The Fundebug plugin automatically catches such errors, sends them to our backend server, and sends an alarm to the developer as soon as possible. In addition, Fundebug does not affect the execution of WebSocket’s error handling callback onError. The screenshot of the Fundebug console is as follows:

Fixed BUG monitoring unHandledrejection errors

Unhandledrejection error, a Promise error that is not handled with a catch. Fundebug has long supported monitoring unHandledrejection errors, but due to a plugin BUG, all unhandledrejection errors appear as Caught errors. We are very sorry for this, this time we fixed the BUG, thanks to Fundebug user -zWing for your feedback!

Test code:

Promise.reject("test unhandledrejection")
Copy the code

The browser console displays an error:

Uncaught (in promise) test unhandledrejection
Copy the code

The Fundebug plugin automatically catches such errors, sends them to our backend server, and sends an alarm to the developer as soon as possible. The screenshot of the Fundebug console is as follows:

Added the silentDev configuration property

If you do not need to collect errors in your development environment, you can set the silentDev attribute to true. This way, Fundebug does not collect development environment errors, and production environment errors will still be collected normally. Note that production environment and development environment are distinguished by the URL of the page. If the URL contains localhost or IP, it is considered as development environment; otherwise, it is considered as production environment.

  1. Configure the silentDev attribute in the HTML configuration

    < script SRC = "https://js.fundebug.cn/fundebug.1.2.0.min.js" apikey = "API - KEY" silentDev = true > < / script >Copy the code
  2. Configure the silentDev variable in JavaScript

    fundebug.silentDev = true;
    Copy the code

When silentDev is set to true, Fundebug no longer collects development environment errors.

Fix silentVideo configuration property BUG

Fundebug plugin supports screen recording function, which can help developers reproduce bugs more vividly. This function leads all similar products at home and abroad! However, due to the complexity of the implementation of this feature, there are still two minor bugs that have not been fixed:

  • If the DOM operation is too much, the screen recording function will affect the page performance and cause lag.
  • The image verification code will be loaded repeatedly, causing the verification to fail.

These two bugs are being fixed, so we have commented the recording feature for now. Set the silentVideo property to false to enable screen recording.

However, if fundebug.silentVideo is set to false, there will be no effect. This is a BUG in our plugin, which has been fixed in version 1.2.0.

If you want to experience recording, set the silentVideo property to false. If you need to use screen recording in production, please evaluate whether the two bugs will affect your application. If you have any further questions about this, please contact Fundebug customer service!

In addition, we made some other optimizations to the plug-in code that we won’t cover here.

reference

About Fundebug

Fundebug focuses on JavaScript, wechat applets, wechat mini games, Alipay applets, React Native, Node.js and Java real-time BUG monitoring. Since its launch on November 11, 2016, Fundebug has handled more than 600 million error events in total, which has been recognized by many well-known users such as Google, 360 and Kingsoft software. Welcome free trial!




Are your users experiencing bugs?

Experience the Demo
Free to use