mirror of
https://github.com/MarshalX/telegram-crawler.git
synced 2024-12-18 12:49:16 +01:00
338 lines
26 KiB
HTML
338 lines
26 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Telegram Support Force</title>
|
|
<meta name="twitter:card" content="summary"></meta>
|
|
<meta property="og:title" content="Bug Herding Explained">
|
|
<meta property="og:image" content="https://tsf.telegram.org/file/811140587/1/gUXnE3yzE_I/6acf7b7b370c90e18d">
|
|
<meta property="og:description" content="This document is intended for advanced TSF members. If you just joined us, come back later.
|
|
There's plenty of more urgent…">
|
|
|
|
<link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4">
|
|
<link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png">
|
|
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png">
|
|
<link rel="icon" type="image/png" sizes="16x16" href="/img/favicon-16x16.png">
|
|
<link rel="alternate icon" href="/img/favicon.ico" type="image/x-icon" />
|
|
<script>document.cookie="stel_dt="+encodeURIComponent((new Date).getTimezoneOffset())+";path=/;max-age=31536000;samesite=None;secure"</script>
|
|
|
|
<link href="//telegram.org/css/font-roboto.css?1" rel="stylesheet" type="text/css">
|
|
<link href="//telegram.org/css/bootstrap.min.css?3" rel="stylesheet">
|
|
<link href="//telegram.org/css/bootstrap-extra.css?2" rel="stylesheet">
|
|
<link href="/css/telegram.css?236" rel="stylesheet">
|
|
<link href="/css/tsf.css?7" rel="stylesheet">
|
|
<link href="/css/jquery-ui.min.css?1" rel="stylesheet">
|
|
<link href="/css/health.css?136" 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="/" >Telegram Support Initiative</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/manuals" >Manuals</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/manuals/bug_herding" >Bug Herding Explained</a></li></ul></div>
|
|
<h1 id="dev_page_title">Bug Herding Explained</h1>
|
|
|
|
<div id="dev_page_content"><!-- scroll_nav -->
|
|
|
|
<blockquote>
|
|
<p>This document is intended for advanced TSF members. If you just joined us, come back later.<br>There's plenty of more urgent stuff for you to study, don't read this one yet.</p>
|
|
</blockquote>
|
|
<p>The TSF is made up of volunteers who usually only have a fraction of their time to offer to our cause. They <a href="/manuals/come-and-go">come and go</a>, some of them disappear completely after 500 answers (some after 10, some without even leaving a single one). Our organization must be flexible enough to survive this.</p>
|
|
<p>Among other things, this means that our Trello boards must be accessible and easy to use for anyone, even if they are just passing by. Therefore, we need dedicated people who can take care of the boards and keep them well maintained for the rest of us, we need <strong>bug herders</strong>.</p>
|
|
<p>This manual is for those who would like to become part of this caste.</p>
|
|
<hr>
|
|
<h2><a class="anchor-link" href="#herder-protocol"><i class="anchor-icon"></i></a><a class="anchor" name="herder-protocol"></a>Herder protocol</h2>
|
|
<p>You know from the <a href="/manuals/bugs">bug handling</a> manual that our final goal, when it comes to issues, is to get a trello card marked either as <strong>confirmed by dev</strong> or <strong>feature</strong>. As bug herders, we have more detailed responsibilities. We follow issues from the moment they are found to the public release in which they are resolved — and beyond.</p>
|
|
<ol>
|
|
<li>Make sure that all newly discovered issues have their own <strong>cards</strong> (exceptions can be made for problems found in a recent beta version if the dev is in active development and says he'll fix it on the go).</li>
|
|
<li><strong>Optimize</strong> all newly added cards, they must be: easy to <strong>find</strong> (good name, search keywords), <strong>specific</strong> (as in 'not vague'), have all the necessary <strong>details</strong>, but <strong>not</strong> too <strong>verbose</strong>.</li>
|
|
<li>Report all issues to the relevant developer group, not forgetting to include the trello link and an <strong>#issue_tag</strong> (the same way we do in questions).</li>
|
|
<li>Find all the requested info and add it to the card, move it to the <strong>Reviewed & Reported</strong> list, add a comment about this to the card so that we know when this happened.</li>
|
|
<li>Remind developers about trending issues that have been neglected for too long.</li>
|
|
<li>Check issues that are marked as <strong>fixed</strong> (are they?) and add relevant comments.</li>
|
|
<li>Whenever a new version is out, mark issues as <strong>fixed</strong> and comment with the version number.</li>
|
|
<li>Older issues that were fixed need to be archived or deleted after a while (but not immediately, since we will still be getting reports from people who forgot to update their apps).</li>
|
|
</ol>
|
|
<h2><a class="anchor-link" href="#herder-goals"><i class="anchor-icon"></i></a><a class="anchor" name="herder-goals"></a>Herder goals</h2>
|
|
<p>A bug herder has nothing left to do, if the <strong>Unsorted</strong> list is empty. Any card in that list should be seen as a call to action. Now let's look at the job in more detail.</p>
|
|
<hr>
|
|
<h3><a class="anchor-link" href="#creating-cards"><i class="anchor-icon"></i></a><a class="anchor" name="creating-cards"></a>Creating cards</h3>
|
|
<p>If you found a problem, there is a good chance that somebody else from the TSF will soon get a question about it too. So it's important to create a trello card early. Create the card as soon as you have enough info to set the issue apart from the rest.</p>
|
|
<p>Information in a good card is ordered in this manner:<br><strong>Problem</strong> (what) > <strong>Conditions</strong> (when) > <strong>Explanation</strong> (why; optional)</p>
|
|
<p>The <em>Problem</em> must be described in specific terms (photos are blurry, app crashes, voice messages stop playing).<br>The <em>Conditions</em> include:</p>
|
|
<ol>
|
|
<li>The exact circumstances of the problem (photos are blurry in secret chats, app crashes when opening the contacts section, voice messages stop playing when a new message is received).</li>
|
|
<li>Steps to reproduce the issue.</li>
|
|
<li>Affected device/OS combinations.</li>
|
|
</ol>
|
|
<p>The <em>Explanation</em> part is optional, but it's nice to have it in cards that could potentially live long lives — e.g., when a bug depends on a specific device/OS combination and can't be fixed easily. (For example: 'This happens when photos are sent from an older version of the app and will stop being relevant when everyone updates.')</p>
|
|
<h4><a class="anchor-link" href="#title"><i class="anchor-icon"></i></a><a class="anchor" name="title"></a>Title</h4>
|
|
<p>The name of the card should be pretty general, details should be placed in the description. When composing the title, think from the perspective of somebody <strong>looking</strong> for the issue, who does not know too many details yet.</p>
|
|
<p>A good title should be structured this way:<br><strong>Problem, general condition</strong></p>
|
|
<p><em>Specific</em> conditions and the <em>explanation</em> go to the description.</p>
|
|
<blockquote>
|
|
<p><em>E.g., this card is useless: 'If the contact's name begins with “A” or “S”, iPhone 4s (7.1.2) users will not see messages from them'. When somebody encounters this issue, he will not have enough info to find this card. Most likely, he will only know that an iOS user doesn't get messages from some of their contacts. So if we want someone looking at the card to know that it describes their issue, we need to name it like this, for example: 'User doesn't see new messages if they come from contacts with names starting with “A” or “S”'. We will add a description, saying that the problem was encountered in iPhones 4s with iOS 7.1.2. And we will add all the necessary tags to make search easier, e.g. 'iOS, messages, invisible, not delivered', etc.'</em></p>
|
|
</blockquote>
|
|
<h4><a class="anchor-link" href="#description-and-more-info"><i class="anchor-icon"></i></a><a class="anchor" name="description-and-more-info"></a>Description and more info</h4>
|
|
<p>Once you've got a card going, gradually expand it: improve the title, optimize keywords for searchability, add more info, don't forget adding #tq tags from affected users to the comments. Try to avoid any vagueness and ambiguity. E.g.:</p>
|
|
<ul>
|
|
<li>Avoid 'sometimes', 'in some cases', etc if you can. These words signal that additional investigation is required.</li>
|
|
<li>Use <strong>specific</strong> terms. Not 'doesn't work', but 'app crashes' or 'becomes unresponsive', etc.</li>
|
|
<li>Don't use 'latest', 'current' or 'previous' in terms of app version. Better stick to actual version numbers — some cards live long lives.</li>
|
|
</ul>
|
|
<p>Generally, you need to strike a <strong>balance</strong> between enough info — and <strong>not too much</strong>. Developers are busy people, they will not have time to read through a long text, or might even get scared away by verbosity.</p>
|
|
<blockquote>
|
|
<p><strong>Bad example:</strong></p>
|
|
</blockquote>
|
|
<div>
|
|
<a href="/file/811140587/1/gUXnE3yzE_I/6acf7b7b370c90e18d" target="_blank"><img src="/file/811140587/1/gUXnE3yzE_I/6acf7b7b370c90e18d" title="Screenshot_11.png, 50.96Kb" class="dev_page_image" /></a>
|
|
<br>
|
|
</div>
|
|
|
|
|
|
<blockquote>
|
|
<p><em>And here's almost the same amount of info. But with higher chances to be read by the developer:</em></p>
|
|
</blockquote>
|
|
<div>
|
|
<a href="/file/811140791/1/CkbjDtHRWWA/e07477afcad0767e6a" target="_blank"><img src="/file/811140791/1/CkbjDtHRWWA/e07477afcad0767e6a" title="Screenshot_13.png, 17.33Kb" class="dev_page_image" /></a>
|
|
</div>
|
|
|
|
<h4><a class="anchor-link" href="#one-card-one-issue"><i class="anchor-icon"></i></a><a class="anchor" name="one-card-one-issue"></a>One card — one issue</h4>
|
|
<p>If you read the examples above, you will have noticed that the initial card was dedicated to two bugs instead of one. This is very bad. Each issue must have a card to itself, even if the problematic behaviour seems similar. Imagine that your house had a leaky roof and burst water pipes at the same time — both problems mean it'll be very wet inside. But the underlying issues are very different.</p>
|
|
<h4><a class="anchor-link" href="#keywords-amp-search"><i class="anchor-icon"></i></a><a class="anchor" name="keywords-amp-search"></a>Keywords & Search</h4>
|
|
<p>The title and text of the card are searchable, but sometimes we need additional keywords. We usually mention them at the bottom, after a separator. This is useful if there are many ways to refer to a problem.</p>
|
|
<p>Once you've created a card, it's always a good idea to try to search for it yourself. Imagine that you've just met a user with this issue and are looking for info on Trello. What will you type in?</p>
|
|
<ul>
|
|
<li>This may give you ideas for additional keywords.</li>
|
|
<li>You may find that there are older cards from the 'Fixed' list are shown at the top of the search so that the card is not visible. Check if it's time to delete them.</li>
|
|
<li>You may find that another card is showing up because of bad wording. Try to rewrite it or remove excessive keywords (but only if they are unnecessary). </li>
|
|
</ul>
|
|
<p>If there is a card and you had to show it to one of our volunteers who couldn't find it, think how you can improve its wording and keywords.</p>
|
|
<blockquote>
|
|
<p><em>E.g., you have a card called <strong>'App freezes when user joins supergroup'</strong>. One of the new volunteers asks in their regional group: 'I have a user that says his app crashes when people add him to groups'. You show them your card, but realize that it didn't mention the words <strong>'crash'</strong>, <strong>'add'</strong>, or <strong>'group'</strong>.<br>So you add them to the list of keywords below the card. Then you check if it's now possible to find your card using a different description of the problem. You find that a card from 2013 called 'A group of aliens crash-landed on DC1, adding more trouble for the admins' is shown first for this query and delete it because it's a lie and therefore shouldn't be on Trello.</em></p>
|
|
</blockquote>
|
|
<h4><a class="anchor-link" href="#affected-devices"><i class="anchor-icon"></i></a><a class="anchor" name="affected-devices"></a>Affected devices</h4>
|
|
<p>Be careful when mentioning affected devices in the card's title or description. If you can reproduce something on iOS8 — it doesn't mean this is an iOS8 bug yet. This is an iOS8 bug only if you <em>can't</em> reproduce it on iOS7.</p>
|
|
<p>Hence, the general rule: unless there are devices where the bug <strong>can't</strong> be reproduced, don't place device/OS version info in the title. Put them in a list under 'reproduced on'.</p>
|
|
<p>As soon as we see some kind of consistency, we can add things to the title. E.g., if we see that all iOS8 devices <strong>have</strong> the problem and devices running any other version of the OS <strong>do not</strong>.</p>
|
|
<hr>
|
|
<h3><a class="anchor-link" href="#reporting-to-developers"><i class="anchor-icon"></i></a><a class="anchor" name="reporting-to-developers"></a>Reporting to developers</h3>
|
|
<p>Bug herders are also specialists in developer relations. Here's what we should do:</p>
|
|
<ol>
|
|
<li>Let's stick to the existing <strong>app groups</strong> for all our contacts with the devs.</li>
|
|
<li>Let's contact developers when we already have an issue card going — at least a very basic version. (Exceptions could be made for bugs in beta versions that are in active testing.)</li>
|
|
<li>When contacting the devs, describe the issue, add a <strong>trello link</strong> and an <strong>#issue_tag</strong>. This way we can later look up what exactly the developer said about this or that issue (or didn't) and act accordingly. (If issues are investigated in local TSF groups, do insert the <strong>#issue_tag</strong> there to make the relevant info discoverable there as well.)</li>
|
|
<li>Once the issue has been optimized and reported, move it to the <strong>Reviewed & Reported</strong> list.</li>
|
|
<li>If the developer asks for more info, supply it to the group (and the card if relevant). If you cannot do that right away for any reason, add the questions as a comment to the card, and add the <strong>yellow</strong> label.</li>
|
|
<li>Remember that developers are <a href="/manuals/bugs#2-investigate-the-bug">biased</a> and will frequently tell you that the problem belongs to some other developer or even is related to the OS or device and is not our bug. If this happens, it is your task to make sure that we've traced the problem back to the right dev (in the former case) and that we can't demostrate other apps that do the same well on the same device or platform (in the latter).</li>
|
|
</ol>
|
|
<hr>
|
|
<h3><a class="anchor-link" href="#archiving-issues"><i class="anchor-icon"></i></a><a class="anchor" name="archiving-issues"></a>Archiving issues</h3>
|
|
<p>Once an update is out that fixes an issue, we add a comment along the lines of 'fixed in v.2.9'. Then we leave the issue on the board for about <strong>2 weeks</strong> or so — our volunteers will still meet people that need to upgrade to fix their problem. Sometimes an issue deemed to be fixed can also come back to life (likely in a modified form, e.g. 'now only for iPads', etc.).</p>
|
|
<p>Once the 2 weeks are out, we can assume that the issue is indeed fixed for good. We can then <strong>archive</strong> the card. Note that archived cards will still show up in search (unless you specifically exclude them). Therefore, it may be more reasonable to <strong>delete</strong> the cards in case of smaller bugs and interface glitches (this is especially true for interface oversights and feature-like issues).</p>
|
|
<p>It is acceptable to archive an issue that couldn't be reproduced by us and had no activity (complaints, #tq tags, etc.) for 3-4 months. But don't delete those.</p>
|
|
<p><strong>Archive:</strong></p>
|
|
<ul>
|
|
<li>Trending issues</li>
|
|
<li>Major issues</li>
|
|
<li>Inter-app issues</li>
|
|
<li>Hard to reproduce issues</li>
|
|
<li>Obscure issues without any recent activity</li>
|
|
</ul>
|
|
<p><strong>Delete examples:</strong></p>
|
|
<ul>
|
|
<li>Wrong error message when setting a username starting or ending with an underscore</li>
|
|
<li>Shared media / shared files selector glitch in landscape mode on iOS 7</li>
|
|
<li>Can't forward photo when opening from shared media</li>
|
|
</ul>
|
|
<p>..and all other minor interface bugs</p>
|
|
<h4><a class="anchor-link" href="#deleting-cards"><i class="anchor-icon"></i></a><a class="anchor" name="deleting-cards"></a>Deleting cards</h4>
|
|
<p>Since anything that is deleted is lost forever, we shouldn't rush this. But if you're sure, go ahead and do it. If you're not sure, make sure it should be, then go ahead and delete it.</p>
|
|
<h3><a class="anchor-link" href="#herder-responsibility"><i class="anchor-icon"></i></a><a class="anchor" name="herder-responsibility"></a>Herder responsibility</h3>
|
|
<p>When you <strong>create</strong> a card or <strong>review & report</strong> somebody else's card, <strong>subscribe</strong> to it. And follow it to the end. In the event that something has to be done with it and nobody is doing it — you do it. This way we will not have Mexican standoffs when everybody knows something has to be done, but since technically nobody has to do it, it's never done at all.</p>
|
|
<p>And that's about it. If we all observe the simple procedures outlined above, peace and prosperity will come down on our homes and trello boards — and all TSF volunteers will only be a few keystrokes aways from any answer they might need.</p>
|
|
<h3><a class="anchor-link" href="#how-do-i-join"><i class="anchor-icon"></i></a><a class="anchor" name="how-do-i-join"></a>How do I join?</h3>
|
|
<p>You talk to Markus or Daria. But bear in mind that he'll like to see some 20-30 bugs you've created, reviewed and otherwise took care of on Trello. All bug herders should be prepared to spend a lot of time answering questions and tending their issues.</p>
|
|
<hr>
|
|
<h3><a class="anchor-link" href="#p-s-bugging-the-devs-a-note-on-bug-relevance"><i class="anchor-icon"></i></a><a class="anchor" name="p-s-bugging-the-devs-a-note-on-bug-relevance"></a>P.S. Bugging the devs — a note on bug relevance</h3>
|
|
<p>Bugs and even trending bugs have different priorities. Those priorities can be calculated in the same way as one would determine whether <a href="/manuals/feature_philosophy#determining-priority">a feature is worth considering</a>.</p>
|
|
<p>I mentioned 'reminding the developers about bugs' as a responsibility of the herder, especially of a herder who is subscribed to a bug. But do remember that there are good and bad times to do this.</p>
|
|
<p>Whenever an update is imminent, it is a good idea to go through existing issues and make sure that all the <strong>critical</strong> stuff is fixed. Don't bug pre-release devs with exotic stuff — if it wasn't fixed at this point, it'll have to wait until the next release.</p>
|
|
<p>The best time for reminding about <strong>older issues</strong> would probably be a few days after a major release, or as soon as the dust has settled — maybe one day after the release if no major new bugs were found.</p>
|
|
<p>Such a reminder is best done in the form of a <strong>digest</strong>. You could collect a few links to well-investigated issues and offer them for consideration in the app's group. Alternatively, you could also gather a few issues that are less clear and ask about them again. Just don't do it in 20 separate messages over the course of seven hours — make it one nice but not too fat message.</p>
|
|
<p>If that doesn't work, try a smaller number. Maybe choose <strong>three</strong> important issues and ping him again with a nice concise message. Once he says something of that is fixed, show him your earlier digest and ask to take care of that stuff as well since he's here already.</p>
|
|
<p>Be cool.</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'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="//telegram.org/js/jquery.min.js?1"></script>
|
|
<script src="//telegram.org/js/bootstrap.min.js"></script>
|
|
<script src="//telegram.org/js/main-aj.js?68"></script>
|
|
<script src="/js/main.js?47"></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?1"></script>
|
|
<script src="/js/stats.js?18"></script>
|
|
|
|
<script>ajInit({"version":805,"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>
|
|
|