Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

This is how I understand a magical BUG.

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

Abstract: by analyzing the behavior of users, we can figure out why this situation occurs!

Logic of this article: find a problem, take a screenshot to indicate the usefulness of the record of the process of solving the problem, and make a soft recommendation.

Two days ago, I received an alarm message like this in BearyChat:

409? Conflict? Usually rarely encountered such a mistake, seems to be very serious, scared me to check what happened in the end.

A careful examination of the error details shows that the error is directly reported by the subsequent request database due to multiple registrations using the same mailbox account.

But it shouldn't be! We did have an examination beforehand. If the mailbox has been registered, it will be reminded and will not be allowed to register. Is it possible that the other party is a * * who directly calls API to send a request? If so, it's even more dangerous. We're already being targeted!

But this is not good for him, and IP shows as a domestic address, if it is really he at least use a foreign address. After thinking about it, you'd better carefully analyze what went wrong.

When I looked down, I found that I was thinking too much. If it is *, the following user behavior will completely expose him!

These user behavior records are arranged in reverse order by default, and we can look at the user's usage track from the bottom to the top. Through the user behavior, you can know the whole operation flow before the error:

Open the home page of our website, click "Free trial" to enter the registration page, enter the mailbox, enter the password, click to create a team, click to create a team, and successfully report an error.

So the question arises: is there any abnormal behavior?

A: yes! He clicked to create the team twice.

With my keen sense of smell, I realized that it might be caused by users quickly clicking the "create team" button twice. Through the time record, it is found that the first click is at 1.86m and the second is at 1.87m. In other words: the user clicked quickly twice in a very short time.

The user behavior record just now filters the network request, and then we analyze it with the network request:

You can find two / members/email GET requests, both of which successfully returned 404, where the code means that the mailbox has not been registered and can be used. A / members/create request returns 200 successfully, indicating that the account has been created successfully. The last failed / members/create request returned 409.

At this point, it is basically determined that the cause of the error is caused by the user's quick click to create a team.

Is it possible? try to reproduce it! So I opened the registration page, entered my email and password, and clicked on the team N times at super speed. Ha, as expected, it was successfully repeated by me!

As long as it can be successfully reproduced, the BUG is basically solved, and the next step is to analyze how to optimize the code to prevent this from happening. There are two ideas: 1. After the user clicks, the button that is clicked is invalid until the click request is completely processed; 2. Find a way to merge the two asynchronous events that verify the existence of the mailbox and the creation team into a single atomic operation. After comprehensive consideration, we decided to use the first scheme. Because the implementation is simple, there are few changes to the existing code.

In general: user behavior recorded by Fundebug is really useful when there is no stack information or error messages are difficult to understand. Five stars recommend front-end development to connect to the project!

About Fundebug

Fundebug specializes in real-time BUG monitoring of JavaScript, WeChat Mini Programs, Wechat, Mini Game, Mini Program, React Native, Node.js and Java. Since the official launch of Singles' Day in 2016, Fundebug has handled a total of 700 million + errors, which has been recognized by many well-known users, such as Google, 360,360, Kingsoft, people's Network and so on. Welcome to try it for free!

Copyright notice

Please indicate the author's Fundebug and the address of this article when reprinting:

Https://blog.fundebug.com/2017/09/06/fundebug-user-behavior-help-debug/

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report