New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

requesting a new QR code cost more than 2 minutes #434

Closed
lijiarui opened this Issue Apr 24, 2017 · 12 comments

Comments

Projects
None yet
4 participants
@lijiarui
Member

lijiarui commented Apr 24, 2017

Expected behavior

When wechat logs you out, and then asks you to login again by showing qrcode, it should within 2 minutes(watchdog timeout)

Actual behavior

It will cost me 15min to show qrcode
requesting a new QR code every 20 minutes by @dcsan

@zixia zixia added the bug label Apr 25, 2017

@zixia

This comment has been minimized.

Show comment
Hide comment
@zixia

zixia May 1, 2017

Member

Please look into the log when you experience this issue next time, and let me know if there's a line like this:

02:18:17 WARN PuppetWebWatchdog monirotScan() refresh browser for no food of type scan after 10 mins
02:18:17 VERB PuppetWebBrowser refresh()

Thanks.

Member

zixia commented May 1, 2017

Please look into the log when you experience this issue next time, and let me know if there's a line like this:

02:18:17 WARN PuppetWebWatchdog monirotScan() refresh browser for no food of type scan after 10 mins
02:18:17 VERB PuppetWebBrowser refresh()

Thanks.

zixia added a commit that referenced this issue May 1, 2017

@lijiarui

This comment has been minimized.

Show comment
Hide comment
@lijiarui

lijiarui May 2, 2017

Member

yes, it got the line.

02:23:46 WARN PuppetWebWatchdog monirotScan() refresh browser for no food of type scan after 10 mins

each qrcode internal is 16 minutes.

Member

lijiarui commented May 2, 2017

yes, it got the line.

02:23:46 WARN PuppetWebWatchdog monirotScan() refresh browser for no food of type scan after 10 mins

each qrcode internal is 16 minutes.

@zixia

This comment has been minimized.

Show comment
Hide comment
@zixia

zixia May 2, 2017

Member

I had changed this interval from 10 to 4 minutes because you said normaly it's 2 minutes, so we refresh after 4 minutes if there's no new QRCode coming.

it should within 2 minutes

Please use the latest docker image to continue monitoring it, thanks.

Member

zixia commented May 2, 2017

I had changed this interval from 10 to 4 minutes because you said normaly it's 2 minutes, so we refresh after 4 minutes if there's no new QRCode coming.

it should within 2 minutes

Please use the latest docker image to continue monitoring it, thanks.

@lijiarui

This comment has been minimized.

Show comment
Hide comment
@lijiarui

lijiarui May 2, 2017

Member

2 minutes

I'm not sure why is should within 2 minutes...

I said 2 minutes, because I saw watchdog says 120s....

Member

lijiarui commented May 2, 2017

2 minutes

I'm not sure why is should within 2 minutes...

I said 2 minutes, because I saw watchdog says 120s....

@lijiarui

This comment has been minimized.

Show comment
Hide comment
@lijiarui

lijiarui May 3, 2017

Member

the same bot and same environment, log as follows:

03:20:47 WARN PuppetWebWatchdog monirotScan() refresh browser for no food of type scan after 10 mins

and qrcode internal is 15 minutes.

Member

lijiarui commented May 3, 2017

the same bot and same environment, log as follows:

03:20:47 WARN PuppetWebWatchdog monirotScan() refresh browser for no food of type scan after 10 mins

and qrcode internal is 15 minutes.

@dcsan

This comment has been minimized.

Show comment
Hide comment
@dcsan

dcsan May 6, 2017

one related feature request here is to DISABLE requesting a new QRCode.

when some bots are running on a remote server, they will lose connection, and keep requesting new QRCodes for a long period, those personal Wechat accounts will get blocked.

dcsan commented May 6, 2017

one related feature request here is to DISABLE requesting a new QRCode.

when some bots are running on a remote server, they will lose connection, and keep requesting new QRCodes for a long period, those personal Wechat accounts will get blocked.

@zixia

This comment has been minimized.

Show comment
Hide comment
@zixia

zixia May 6, 2017

Member

@dcsan Thanks for pointing this out.

But what if someone uses his computer at the office to use web wechat, and then forget to turn the computer off, left it there, and have two weeks vacation?

Will his account be blocked? If so, I do not think that make sense.

Member

zixia commented May 6, 2017

@dcsan Thanks for pointing this out.

But what if someone uses his computer at the office to use web wechat, and then forget to turn the computer off, left it there, and have two weeks vacation?

Will his account be blocked? If so, I do not think that make sense.

@dcsan

This comment has been minimized.

Show comment
Hide comment
@dcsan

dcsan May 6, 2017

so the behavior here of calling for a new QRcode is identical to normal browser usage?

however, we have experienced this with accounts getting blocked.
perhaps it could be that multiple bots were running on the same VPS/IP# or there is some other behavior that makes chromedriver different (eg the *nix user agent?)

FWIW the bot accounts were also used on mobile phones, as normal/real wechat accounts.

dcsan commented May 6, 2017

so the behavior here of calling for a new QRcode is identical to normal browser usage?

however, we have experienced this with accounts getting blocked.
perhaps it could be that multiple bots were running on the same VPS/IP# or there is some other behavior that makes chromedriver different (eg the *nix user agent?)

FWIW the bot accounts were also used on mobile phones, as normal/real wechat accounts.

@zixia

This comment has been minimized.

Show comment
Hide comment
@zixia

zixia May 6, 2017

Member

Yes, the behavior of Wechaty should be identical to a normal browser(except that if the QR Code stop refreshing, the user(Watchdog) of the browser will press the Refresh Button).

I think there must be some other behavior.(but not like the user agent & IP).

Maybe we should set up a place to collect the bot blocked events from our developers, so we can discuss it deeper. ;-p

Member

zixia commented May 6, 2017

Yes, the behavior of Wechaty should be identical to a normal browser(except that if the QR Code stop refreshing, the user(Watchdog) of the browser will press the Refresh Button).

I think there must be some other behavior.(but not like the user agent & IP).

Maybe we should set up a place to collect the bot blocked events from our developers, so we can discuss it deeper. ;-p

@JasLin

This comment has been minimized.

Show comment
Hide comment
@JasLin

JasLin May 8, 2017

Contributor

@zixia hi bro, just take a look at the source code. some information here maybe useful.

if it's isAssociationLogin, wxwebapp will display a confirm button instead of qrcode, in this case , chatie will not trigger onScan event.

      <div class="association"
          ng-class="{show: isAssociationLogin && !isBrokenNetwork}">
        <img class="img"
            mm-src="{{userAvatar}}"
            alt=""
            src="//res.wx.qq.com/a/wx_fed/webwx/res/static/img/2KriyDK.png" />
        <p ng-show="isWaitingAsConfirm"
            class="waiting_confirm">请在手机点击确认登录</p>
        <a href="javascript:;"
            ng-show="!isWaitingAsConfirm"
            ng-click="associationLogin()"
            class="button button_primary">登录</a>
        <a href="javascript:;"
            ng-click="qrcodeLogin()"
            class="button button_default">切换帐号</a>
      </div>

source

click this button will trigger that a confirm button display on mobile app, and click it to login.

associationLogin: function(e) {
              var a = t.defer()
                , n = i.API_webwxpushloginurl + "?uin=" + encodeURIComponent(e);
              return $.ajax({
                  url: n
                  , dataType: "json"
                })
                .done(function(e) {
                  0 == e.ret ? a.resolve(e) : a.reject(e)
                })
                .fail(function() {
                  a.reject()
                }), a.promise
            }

source

what is isAssociationLogin?

...
e.isAssociationLogin = parseInt(a.getCookie("login_frequency") || 0) >= 2
...

it seems if we are login one wechat account on one computer/browser too frequency, this account will be identify as a isAssociationLogin account?
source

Contributor

JasLin commented May 8, 2017

@zixia hi bro, just take a look at the source code. some information here maybe useful.

if it's isAssociationLogin, wxwebapp will display a confirm button instead of qrcode, in this case , chatie will not trigger onScan event.

      <div class="association"
          ng-class="{show: isAssociationLogin && !isBrokenNetwork}">
        <img class="img"
            mm-src="{{userAvatar}}"
            alt=""
            src="//res.wx.qq.com/a/wx_fed/webwx/res/static/img/2KriyDK.png" />
        <p ng-show="isWaitingAsConfirm"
            class="waiting_confirm">请在手机点击确认登录</p>
        <a href="javascript:;"
            ng-show="!isWaitingAsConfirm"
            ng-click="associationLogin()"
            class="button button_primary">登录</a>
        <a href="javascript:;"
            ng-click="qrcodeLogin()"
            class="button button_default">切换帐号</a>
      </div>

source

click this button will trigger that a confirm button display on mobile app, and click it to login.

associationLogin: function(e) {
              var a = t.defer()
                , n = i.API_webwxpushloginurl + "?uin=" + encodeURIComponent(e);
              return $.ajax({
                  url: n
                  , dataType: "json"
                })
                .done(function(e) {
                  0 == e.ret ? a.resolve(e) : a.reject(e)
                })
                .fail(function() {
                  a.reject()
                }), a.promise
            }

source

what is isAssociationLogin?

...
e.isAssociationLogin = parseInt(a.getCookie("login_frequency") || 0) >= 2
...

it seems if we are login one wechat account on one computer/browser too frequency, this account will be identify as a isAssociationLogin account?
source

@lijiarui

This comment has been minimized.

Show comment
Hide comment
@lijiarui

lijiarui May 8, 2017

Member

cool! I guess this is the reason why the internal is 15min-20min

Member

lijiarui commented May 8, 2017

cool! I guess this is the reason why the internal is 15min-20min

@lijiarui

This comment has been minimized.

Show comment
Hide comment
@lijiarui

lijiarui Jul 12, 2017

Member

@JasLin Let's continue to track this issue at #636

This issue will be closed. Thanks!

Member

lijiarui commented Jul 12, 2017

@JasLin Let's continue to track this issue at #636

This issue will be closed. Thanks!

@lijiarui lijiarui closed this Jul 12, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment