telegram-crawler/data/tsf.telegram.org/manuals/bug_hunting.html
2021-11-29 17:56:22 +00:00

270 lines
19 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Telegram Support Force</title>
<meta property="og:title" content="Bug Hunting Algorithm">
<meta property="og:description" content="You already know how to handle bugs in general and what to do with them once they&#39;re identified. But how exactly do you…">
<link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4">
<link rel="alternate icon" href="/favicon.ico?4" type="image/x-icon" />
<script>document.cookie="stel_dt="+encodeURIComponent((new Date).getTimezoneOffset())+";path=/;max-age=31536000;samesite=None;secure"</script>
<link href="https://fonts.googleapis.com/css?family=Roboto:400,500,700" rel="stylesheet" type="text/css">
<link href="/css/bootstrap.min.css?3" rel="stylesheet">
<link href="/css/bootstrap-extra.css?2" rel="stylesheet">
<link href="/css/telegram.css?214" rel="stylesheet">
<link href="/css/tsf.css?7" rel="stylesheet">
<link href="/css/jquery-ui.min.css" rel="stylesheet">
<link href="/css/health.css?129" rel="stylesheet">
<link href="/css/tchart.min.css?10" rel="stylesheet">
<link href="/css/billboard.css?17" rel="stylesheet">
</head>
<body class="emoji_image no-transition">
<div id="aj_progress" class="progress-bar"></div>
<div id="aj_content"><div class="tr-container">
<header>
<div class="container">
<div class="header-wrap">
<div id="header-panel" class="header-panel">
<div class="header-auth">
<div class="header-auth-item"><a class="header-search-btn"></a></div><div class="header-auth-item"><a class="header-auth-link login-link" href="/auth">Login</a></div>
</div>
<div class="header-breadcrumb header-breadcrumb-simple">
<ol id="breadcrumb" class="header-nav breadcrumb"><li><a href="/">Telegram Support Force</a></li></ol>
</div>
</div>
</div>
</div>
</header>
<main class="container">
<nav class="tr-menu">
<div class="tr-menu-section">
<div class="tr-menu-header">
<div class="tr-menu-header-label">Resources</div>
</div>
<ul class="tr-menu-items"><li>
<a class="tr-menu-item" href="/">
<span class="nav-label">Introduction</span>
</a>
</li><li class="active">
<a class="tr-menu-item" href="/manuals">
<span class="nav-label">Manuals</span>
</a>
</li></ul>
</div>
</nav>
<section class="content clearfix">
<section class="tr-content"><div id="dev_page_content_wrap" class=" ">
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/manuals/bugs" >Bugs</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/manuals/bug_hunting" >Bug Hunting Algorithm</a></li></ul></div>
<h1 id="dev_page_title">Bug Hunting Algorithm</h1>
<div id="dev_page_content"><!-- scroll_nav -->
<blockquote>
<p>You already know how to handle <a href="/manuals/bugs">bugs</a> in general and what to do with them once they&#39;re identified. But how exactly do you <a href="/manuals/bugs#2-investigate-the-bug">investigate a problem</a> and what questions should you ask? Here&#39;s an easy <strong>algorithm</strong> for you.</p>
</blockquote>
<h3><a class="anchor-link" href="#0-reproduce-it"><i class="anchor-icon"></i></a><a class="anchor" name="0-reproduce-it"></a>0. Reproduce it!</h3>
<p>Before we even start investigating, we should try to cut out the middleman (in this case, the user). Youll save a lot of time if you can reproduce the issue yourself. Then you simply need to investigate the bug, alert your group, log it to Trello if necessary, then present the user with a solution, workaround, or a report that the devs know about the issue and will do something eventually. If you dont have the necessary devices, try asking in your local group or the Chat.</p>
<p>So investigate the bug with the help of the user <strong>only</strong> if you cant reproduce the issue, or dont understand what steps are necessary to reproduce it, or if the TSF lacks the necessary devices. Otherwise, do it <strong>yourself</strong>.</p>
<h3><a class="anchor-link" href="#1-find-out-what-39s-wrong"><i class="anchor-icon"></i></a><a class="anchor" name="1-find-out-what-39s-wrong"></a>1. Find out what&#39;s wrong</h3>
<p>We need to figure out why things are not working the way they are supposed to. A million things can go wrong in a computer program. Each one of our apps consists of many thousand lines of code, and we need to tell our developers where to look. Turns out, the easiest way of finding out is by confirming where NOT to look.</p>
<p>We want to make the problem <strong>smaller</strong> and the questions we ask ourselves or the user must <strong>eliminate</strong> possibilities. As soon as weve removed enough options, well have a pretty good idea of whats going on. Remember the game where you need to guess a persons name that is written on a card stuck to your forehead by asking yes / no questions? Goes like that:</p>
<blockquote>
<p><em>Is this a real person? No. Is it a comic book character? Yes. Is it a girl? No. Did he appear in a new movie recently? Yes. Does he have cancer? Yes. Deadpool! Right.</em></p>
</blockquote>
<p>With each step, we eliminate a million wrong answers and get closer and closer to the right one. We can apply the same treatment to bugs. The task then becomes to find the questions that give us the <strong>most information</strong> and are <strong>easiest</strong> to answer.</p>
<p>But what info do we need?</p>
<h4><a class="anchor-link" href="#1-1-locate-the-responsible-party"><i class="anchor-icon"></i></a><a class="anchor" name="1-1-locate-the-responsible-party"></a>1.1. Locate the responsible party</h4>
<p>Above all, we need to know <strong>which developer</strong> is responsible for the bug in some cases, a bug may not even have to do with Telegram at all. And if it does, the right developer will possibly know what to do and what else to ask. That is, if we can convince him that it&#39;s his bug. So, depending on the issue, we may start with <strong>one</strong> of these questions:</p>
<ul>
<li><p><strong>Does this only happen in one app? Try <em>[insert a different (official) Telegram client]</em>.</strong><br>This is relatively easy to check and an answer gives us a lot of information. If the issue is <strong>not</strong> present in other apps, we can assume that it may be platform-specific and that it&#39;s unlikely (although still faintly possible) to be a server-side thing. If the issue <strong>does</strong> reproduce in apps on other OSs, its likely to be server-related. Only after this question is answered will you truly know the responsible developer. <strong>Note:</strong> Please only use <strong>official</strong> clients for this check. Doesn&#39;t help us at all if we check whether stuff works in Telegram forks or not.</p>
</li>
<li><p><strong>Does this only happen in Telegram? Try <em>[insert a different standard app that can do the same thing]</em>.</strong><br>Some issues, especially when they are related to standard components (e.g., keyboard, input field), may be system-wide. If the same glitches reproduce in other apps, our developers are less likely to be able to do something about them (although sometimes they will). Just make sure that you ask people to check stuff in apps they already have installed.</p>
</li>
<li><p><strong>When investigating connection issues: Does this happen on mobile, WiFi or both?</strong><br>While not exactly a yes-no question, this one lets our system administrators know where to look for lags. Naturally, it doesn&#39;t give us anything useful when the problem is not related to network connections.</p>
</li>
</ul>
<p>Naturally, there are many cases when you can be pretty sure that the bug belongs to the app it was seen on — this is true for interface glitches and any strange behavior in app-specific components. If that&#39;s the case, you skip the questions from this section and move on to the next. Brawny pink pastries.</p>
<h4><a class="anchor-link" href="#1-2-pinpoint-the-bug"><i class="anchor-icon"></i></a><a class="anchor" name="1-2-pinpoint-the-bug"></a>1.2. Pinpoint the bug</h4>
<p>Once you know the problems general address, the possibilities for elimination begin branching out each issue will require its own pattern. Here are several ideas for questions, but this is by no means an exclusive or required list. Youll need to adapt heavily to the situation you&#39;re dealing with each time.</p>
<ul>
<li><p><strong>Is this a local problem or does it involve more than one device/app?</strong><br>Since Telegram is about people sending stuff to other people, things can go wrong on one, or two sides, or both. For example: a video can&#39;t be played. The problem may be in the receiving app (bug in video player) or it could be in the sending app (bug in video encoder).</p>
</li>
<li><p><strong>Does it happen in a particular kind of chats?</strong><br>One-on-one chats, secret chats, basic groups and channels/supergroups use very different underlying technologies. This means that each kind of chats may have its unique problems.</p>
</li>
<li><p><strong>Can this be related to specific settings on the device?</strong><br>Some problems may be triggered by external circumstances. E.g., privacy settings that restrict access to photos or contacts. As another example, Android devices may experience high battery drain because some battery-saving software is trying to shut down Telegram processes Telegram reopens itself all the time and this war is heating up the device. </p>
</li>
<li><p><strong>Does it reproduce in the latest OS version for the relevant device?</strong><br>If <strong>yes</strong>, we don&#39;t need to look further into OS versions. If <strong>no</strong>, we should find out which versions are affected, this will help the developer greatly.</p>
</li>
</ul>
<p>Try to think along these lines. But don&#39;t go too deep.</p>
<h4><a class="anchor-link" href="#1-3-stop-when-you-have-enough"><i class="anchor-icon"></i></a><a class="anchor" name="1-3-stop-when-you-have-enough"></a>1.3. Stop when you have enough</h4>
<p>For most issues, we only need to know three things:</p>
<ul>
<li>What exactly goes wrong and how (detailed description, maybe screenshot)</li>
<li>Which one of the developers is responsible</li>
<li>What steps do we take to reproduce the issue</li>
</ul>
<p>For issues that can&#39;t be easily reproduced, we need additional info:</p>
<ul>
<li>What special conditions must be met to reproduce the issue (OS version, exotic device, conjunction of stars…)</li>
</ul>
<p>Sometimes the developer will ask for additional information or conditions, but generally, that&#39;s <strong>IT</strong>. If you have all this info, you&#39;re done stop tormenting yourself or the user and go report to your local group (and maybe file a Trello card if necessary).</p>
<h4><a class="anchor-link" href="#1-4-bundle-your-questions"><i class="anchor-icon"></i></a><a class="anchor" name="1-4-bundle-your-questions"></a>1.4. Bundle your questions</h4>
<p>It is not always possible to have a real-time conversation with the user, so we should load our messages with the maximum possible payload. Instead of saying “are you still having this issue?” and running off, it&#39;s better to come up with a small set of questions. Select three or four (more is possible, but can be overwhelming for the user) that would give you the best overview of the problem.</p>
<p>Try to come up with several reasons why the issue could be happening, and choose such questions that could either prove or disprove your theories. This way you will use our users time efficiently and keep them happy. Even if they cant reply right away, you will come back to useful information.</p>
<p>Always send <strong>numbered lists</strong> of questions. This way, the user is less likely to miss one and you will find their reply much easier to read.</p>
<p>And that&#39;s about it. You are ready to <a href="/manuals/bugs#3-report-the-bug">Report the Bug</a>, read about it in more details in the <a href="/manuals/bugs#3-report-the-bug">Bug Handling Manual</a>.</p>
<p>A few more things before we wrap it up:</p>
<h3><a class="anchor-link" href="#appendix-a-useless-questions-and-requests"><i class="anchor-icon"></i></a><a class="anchor" name="appendix-a-useless-questions-and-requests"></a>Appendix A: Useless questions and requests</h3>
<p>Our goal is not to make the issue disappear for the user we&#39;re currently talking to. Our goal is to find out what was wrong and to make the issue go away forever, for everyone.</p>
<p>Things like “log out and in again” or “reinstall the app” <strong>do not give us any information</strong>. Therefore, let&#39;s <strong>never</strong> ask our users to do those things, unless this was expressly recommended by the docs or by the devs. The only exception is when youve run out of options and nobody can reproduce the issue in this case were allowed to say:</p>
<blockquote>
<p><em>&quot;Well, this is very strange. We can&#39;t reproduce this on our side and you say none of our suggestions help. Sorry! You could try reinstalling the app this shouldnt help, but since youve already tried everything else, why not do that as well. Tell me if for some reason it does change anything.&quot;</em></p>
</blockquote>
<p>Please note: It is absolutely, 100%, unquestionably <strong>FORBIDDEN</strong> to <strong>START DEBUGGING</strong> by asking the user to try logging out and in again, reinstalling the app or any such nonsense.</p>
<h3><a class="anchor-link" href="#appendix-b-saving-time"><i class="anchor-icon"></i></a><a class="anchor" name="appendix-b-saving-time"></a>Appendix B: Saving time</h3>
<p>When talking to people who are having issues, were often tempted to ask some random question, get a +1 to our leaderboard stats and run off to the next question before they return. If you do this, both you and the user are performing utterly useless actions: youre not helping anyone and they aren&#39;t giving us any info.</p>
<p>So whenever you ask the user to do something, ask yourself first: If I were alone, diagnosing this issue on my own with an intention to collect information as quickly as possible, <strong>would I do this now?</strong> If the answer is no, think of something useful instead.</p>
</div>
</div></section>
</section>
</main>
</div><div class="popup-container login-popup-container hide" id="login-popup-container">
<div class="popup">
<div class="popup-body">
<section>
<h2>Log In</h2>
<p>Log in here to access your TSF stats. Please enter your <b>phone number</b> in the <a target="_blank" rel="noopener" href="https://telegram.org/faq#login-and-sms">international format</a> and we will send a confirmation message to your account via Telegram.</p>
<form id="send-form" class="login-form">
<div class="form-group">
<input type="tel" class="form-control tr-form-control input-lg" id="phone-number" placeholder="+12223334455" autocomplete="off"/>
</div>
<div class="popup-buttons">
<a class="btn btn-link btn-lg login-cancel-btn">Cancel</a><button type="submit" class="btn btn-link btn-lg">Next</button>
</div>
</form>
<div id="login-form" class="hide">
<div class="form-group">
<span class="form-control tr-form-control input input-lg input-disabled"><strong id="phone-number-field"></strong> (<a class="login-back" href="/auth">Incorrect?</a>)</span>
<p class="help-block dots-animated">We&#39;ve just sent you a message.<br/>Please confirm access via Telegram</p>
</div>
<div class="popup-buttons">
<a class="btn btn-link btn-lg login-cancel-btn">Cancel</a><a class="btn btn-link btn-lg login-back">Back</a>
</div>
</div>
</section>
</div>
</div>
</div></div>
<script src="/js/jquery.min.js?1"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="/js/main-aj.js?55"></script>
<script src="/js/main.js?42"></script>
<script src="/js/tsf.js?3"></script>
<script src="/js/jquery-ui.min.js?1"></script>
<script src="/js/tchart.min.js?18"></script>
<script src="/js/billboard.min.js"></script>
<script src="/js/stats.js?17"></script>
<script>ajInit({"version":561,"apiUrl":"\/api?hash=telegram-crawler","unauth":true});</script>
<script id="aj_script">window.initDevPageNav&&initDevPageNav();
Aj.onLoad(function(state) {
function requestConfirmation(event) {
event && event.preventDefault();
var phone = $('#phone-number').val();
$.ajax({
type: 'POST',
url: '/auth/request',
data: {
phone: phone
},
success: function(result) {
$('#phone-number-field').text(phone);
$('#send-form').addClass('hide');
$('#login-form').removeClass('hide');
checkAuth(result.temp_session);
},
error: function(xhr) {
showAlert(xhr.responseText || 'Server error');
},
dataType: 'json'
});
return false;
}
function cancelConfirmation(event) {
event && event.preventDefault();
$('#phone-number-field').text('');
$('#send-form').removeClass('hide');
$('#login-form').addClass('hide');
$('#phone-number').focus();
clearTimeout(window.authTimeout);
return false;
}
function checkAuth(temp_session) {
clearTimeout(window.authTimeout);
window.authTimeout = setTimeout(function doCheckAuth() {
$.ajax({
type: 'POST',
url: '/auth/login',
data: {
temp_session: temp_session
},
success: function(result) {
if (result) {
location.reload();
} else {
checkAuth(temp_session);
}
},
error: function (xhr) {
showAlert(xhr.responseText || 'Server error');
},
dataType: 'json'
});
}, 700);
}
$('#login-popup-container').on('popup:open', function() {
$('#phone-number').focus();
});
$('#login-popup-container').on('popup:close', function() {
cancelConfirmation();
if (location.pathname == '/auth') {
window.history && history.replaceState(null, null, '/');
}
});
$('#login-popup-container #send-form').on('submit', requestConfirmation);
$('#login-popup-container .login-cancel-btn').on('click', function(e) {
e.preventDefault();
closePopup('#login-popup-container');
});
$('#login-popup-container .login-back').on('click', cancelConfirmation);
$('.login-link').on('click', function(e) {
e.stopImmediatePropagation();
e.preventDefault();
openPopup('#login-popup-container');
});
});
Aj.onUnload(function(state) {
$('#login-popup-container').off('popup:open');
$('#login-popup-container').off('popup:close');
$('#login-popup-container #send-form').off('submit');
$('#login-popup-container .login-cancel-btn').off('click');
$('#login-popup-container .login-back').off('click');
$('.login-link').off('click');
});
</script>
<script>Aj.pageLoaded();</script>
</body>
</html>