GithubHelp home page GithubHelp logo

wechaty / puppet-wechat Goto Github PK

View Code? Open in Web Editor NEW
402.0 17.0 67.0 392 KB

Wechaty Puppet Provider for WeChat

Home Page: https://www.npmjs.com/package/wechaty-puppet-wechat

License: Apache License 2.0

TypeScript 53.29% Shell 0.74% JavaScript 45.97%
wechat wechaty wechaty-puppet

puppet-wechat's Introduction

WECHATY-PUPPET-WECHAT

Powered by Wechaty NPM Version npm (tag) TypeScript NPM ES Modules

Wechaty Puppet Puppeteer

Picture Credit: https://www.forsbergplustwo.com

Wechaty Puppet for WeChat

KNOWN LIMITATIONS

  1. Solved by UOS. WeChat Account that registered after 2017 mignt not be able to login Web Wechat, so it can not use PuppetWeChat with Wechaty. Please make sure your WeChat Account can be able to login by visiting https://wx.qq.com
  2. Web API can not create room and invite members to room since 2018.
  3. Can not Receive/Send message from Work Wechat.

If you want to break the above limitations, please consider to use a Wechaty Puppet other than using Web API, like wechaty-puppet-padchat.

Learn more about the Puppet at Wechaty wiki: Puppet

Note for Developers in China

Cause storage.googleapis.com is blocked in mainland china, you'd better config by following guide.

1. Linux & Mac

PUPPETEER_DOWNLOAD_HOST=https://registry.npmmirror.com/mirrors npm install wechaty-puppet-wechat

2. Windows

SET PUPPETEER_DOWNLOAD_HOST=https://registry.npmmirror.com/mirrors npm install wechaty-puppet-wechat

Learn more from puppeteer/puppeteer#1597 (comment)

How to set puppeteer launchOptions?

An example of adding executablePath to puppeteer.launch():

const bot = new Wechaty({
  name: 'mybot',
  puppet: 'wechaty-puppet-wechat',
  // ...
  puppetOptions: {
    endpoint: '<executablePath>'
  }
});

// or
const bot = new Wechaty({
  name: 'mybot',
  puppet: 'wechaty-puppet-wechat',
  // ...
  puppetOptions: {
    launchOptions: {
      executablePath: '<executablePath>',
      // ... others launchOptions, see: https://github.com/GoogleChrome/puppeteer/blob/v1.18.1/docs/api.md#puppeteerlaunchoptions
    }
  }
});

We use stealth to make puppeteer more like a normal browser, if you want to disabled it, just set the WECHATY_PUPPET_WECHAT_PUPPETEER_STEALTHLESS environment variable to 1. eg. WECHATY_PUPPET_WECHAT_PUPPETEER_STEALTHLESS=1 ts-node your-bot.ts

In rare cases, we could meet some problem and see Error: Could not find expected browser when we start PuppetWeChatBridge and try to run initBrowser(). A easy way to solve this problem is set WECHATY_PUPPET_WECHAT_ENDPOINT environment variable to <your executablePath>. eg. WECHATY_PUPPET_WECHAT_ENDPOINT=/usr/bin/chromium-browser ts-node your-bot.ts

puppetOptions

Option value default value description
token string - your own uos extspam value, see #127
endpoint string - puppeteerlaunchoptions.executablePath
head boolean false puppeteerlaunchoptions.headless
launchOptions object - same to puppeteerlaunchoptions
stealthless boolean false disabled puppeteer-extra-plugin-stealth or not
uos boolean false enable UOS patch or not

HISTORY

master v1.12 (Mar 11, 2022)

Release stable for the standard Web Protocol

v1.0 (Oct 30, 2021)

Release 1.0 of Wechaty Puppet for WeChat

  1. v0.30 (Sep, 2021): ESM support.

v0.28 (Apr 13, 2021)

重磅:绕过登录限制,wechaty免费版web协议重放荣光

  1. Support UOS with puppeteer #127
  2. 添加uos请求头支持 #129

v0.26 (Mar 4, 2021)

Rename NPM package name from wechaty-puppet-puppeteer to wechaty-puppet-wechat

v0.24 (Feb 20, 2021)

  1. Puppeteer from v5 to v7
  2. Upgrade other deps

v0.22 (Jun 18, 2020)

Release a version before upgrade.

v0.14 (Aug, 2018)

  1. First Stable Release
  2. Follow latest typings

v0.2 (May, 2018)

  1. Promote to solo package: wechaty-puppet-puppeteer

FAQ

1. chrome-linux/chrome: error while loading shared libraries: libXXX.so.x: cannot open shared object file: No such file or directory

You need to be able to run chrome in your Linux environment. If you are using Ubuntu Linux:

  • error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory
    • apt install libnss3
  • error while loading shared libraries: libgbm.so.1: cannot open shared object file: No such file or directory
    • apt install libgbm-dev
  • error while loading shared libraries: libxshmfence.so.1: cannot open shared object file: No such file or directory
    • apt install libxshmfence-dev
  • error while loading shared libraries: libX11.so.6: cannot open shared object file: No such file or directory
    • apt install libxss1

See: wechaty/wechaty#1152

AUTHOR

Huan LI Tencent TVP of Chatbot <[email protected]>

profile for zixia on Stack Exchange, a network of free, community-driven Q&A sites

COPYRIGHT & LICENSE

  • Code & Docs © 2016-now Huan LI <[email protected]>
  • Code released under the Apache-2.0 License
  • Docs released under Creative Commons

puppet-wechat's People

Contributors

fi6 avatar greenkeeper[bot] avatar hoo-ge avatar huan avatar leochen-g avatar lprintf avatar pacoyang avatar seanxlliu avatar solarhell avatar sososoyoung avatar su-chang avatar system233 avatar wxul avatar yipzong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

puppet-wechat's Issues

An in-range update of watchdog is breaking the build 🚨

Version 0.8.12 of watchdog was just published.

Branch Build failing 🚨
Dependency watchdog
Current Version 0.8.10
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

watchdog is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 11 commits.

  • 3cda8a7 0.8.12
  • 6733093 Merge branch 'master' of github.com:zixia/watchdog
  • 40f31af 0.8.11
  • 41a04c9 add unref()
  • 3c442c7 Merge pull request #19 from zixia/greenkeeper/shx-0.3.0
  • 7820453 Merge branch 'master' into greenkeeper/shx-0.3.0
  • 774effb Merge pull request #21 from zixia/greenkeeper/rollup-0.61.0
  • 8ccfc83 chore(package): update rollup to version 0.61.0
  • e8312cc Merge pull request #20 from zixia/greenkeeper/sinon-6.0.0
  • ada6663 chore(package): update sinon to version 6.0.0
  • d9ae5cd chore(package): update shx to version 0.3.0

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of @types/md5 is breaking the build 🚨

The devDependency @types/md5 was updated from 2.1.32 to 2.1.33.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@types/md5 is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).
  • Travis CI - Branch: The build failed.

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Cannot fire room-leave event

Moved from wechaty/wechaty#1121 author: @lijiarui

WECHATY VERSION

[email protected] doctor /Users/jiaruili/git/rui/wechaty
npm run check-node-version && ts-node bin/doctor

[email protected] check-node-version /Users/jiaruili/git/rui/wechaty
check-node-version --node ">= 8.5"

Wechaty Doctor

  1. Wechaty version: #git[b5c0c14]
  2. Darwin x64 version 16.7.0 memory 456/16384 MB
  3. Docker: false
  4. Node version: v9.3.0
  5. Tcp IPC TEST: PASS

Bug

related to #1116, room leave event cannot be fire for the same reason

But the log shows as follows, it is right with firer.ts, will dig in the future for this.

[美丽群]<美丽群>:{SYS}You removed "管理员" from the group chat
[美丽群]<美丽群>:{SYS}You removed "小桔建群助手" from the group chat

An in-range update of @types/sinon is breaking the build 🚨

Version 5.0.2 of @types/sinon was just published.

Branch Build failing 🚨
Dependency @types/sinon
Current Version 5.0.1
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

@types/sinon is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).
  • Travis CI - Branch: The build failed.

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of puppeteer is breaking the build 🚨

Version 1.7.0 of puppeteer was just published.

Branch Build failing 🚨
Dependency puppeteer
Current Version 1.6.2
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

puppeteer is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).
  • Travis CI - Branch: The build failed.

Release Notes v1.7.0

Big Changes

  • Chromium 70.0.3508.0 (r579032)
  • page.type now supports typing emoji

API Changes

Changed:

Added:

Bug Fixes

  • #1183 - window inner size not equal to viewport size
  • #1260 - GPU is always disabled when running in headless mode.
  • #1694 - Conditional catch for errors
  • #1963 - Missing options preferCSSPageSize and ignoreInvalidPageRanges in Page.pdf()
  • #2823 - docs: Puppeteeer with Chrome Extensions
  • #2854 - Feature Request: clearer UX for waitForSelector inverse
  • #2898 - not working "page.click" if "setJavaScriptEnabled" is "false"
  • #2925 - puppeteer@next is not autoupdated
  • #2970 - There are some missing responses on 'page.on("response") when I invoke 'page.goto()'
  • #3000 - Page._pageBindings is declared as Map<string,Function> but used as JS object
  • #3038 - defaultViewport option does nothing
  • #3040 - Requests don't finish when request interception is enabled but there is no handler to call request.continue

Raw Notes

be7626f - fix: revert ExecutionContext reporting. (#3058)
28ccf5d - docs(api.md): some grammar/wording (#3057)
204c7ec - feat: introduce puppeteer/Errors (#3056)
231a2be - feat: expose frame's execution contexts (#3048)
b84404c - docs(api.md): fix a typo (#3055)
8c713ef - fix(browserfetcher): handle extract-zip errors (#3052)
40466cb - feat(launcher): ignoreDefaultArgs to accept array of options (#3049)
1be7545 - chore: enhance markdown preprocessor (#3050)
81d42c4 - feat: prepare for publishing puppeteer-core (#3047)
d822401 - docs(api.md): clarify coordinate system in mouse (#3041)
608f5b7 - docs(api.md): clarification note on request interception (#3042)
735e17e - docs(troubleshooting): Add instructions to run on App Engine and Cloud Functions (#3021)
6825088 - feat(launcher): allow options to be passed into puppeteer.defaultArgs (#2950)
2e00076 - chore: upgrade to TypeScript 3.0.1 (#3024)
2563213 - feat: add option to specify the default viewport (#3005)
0c49bf5 - test: use new browser context for every page test (#3010)
9c96a92 - test: fix flakiness of certain extension tests (#3011)
95d867a - fix: don't emit an internal error when eval causes navigation (#3008)
e36a7ae - chore: bump version to v1.6.2-post (#3009)
fd5d95b - docs(troubleshooting): update Chromium package supported on Alpine (#2997)
c018ff1 - feat(browsercontext): add BrowserContext.pages() method (#3003)
25d7eff - fix(Page): Use _pageBindings as a Map (#3001)
3335d36 - fix: typing emoji (#2824)
1931cb4 - feat(Chromium): roll Chromium to r579032 (#2989)
5bcb7cf - test: add test with request interception and cookies (#2988)
862ad96 - test: dump workers state after the test runner is terminated (#2991)
0c825de - test: unflake page test that was causing us a lot of CI flakes (#2993)
89f968b - test: try to fix CSS coverage flakes on win (#2992)
4bbaa9d - test: do not handle sigint for all the browsers launched in tests (#2990)
2c95994 - test: make sure referer header is reported with request interception (#2986)
d305c7d - chore: bump version after minor release (#2985)
0b12119 - fix(NetworkManager): Remove header 'cookie' from request hash (#2954)
392d3b9 - Revert "chore(tests): redirect debugError to the output category of tests (#2969)" (#2987)
c5fe1db - chore(tests): redirect debugError to the output category of tests (#2969)
12e3510 - feat(page): add 'preferCSSPageSize' to page.pdf options (#2928)
78ebf40 - chore(ci): move all CI from Node7 to Node8 (#2938)
d09b304 - docs(api.md): elaborate on passing arguments in waitForFunction (#2921)
3d12f1f - feat(FrameManager): improve waiting for selector to be hidden error message (#2911)
14e69d1 - fix(pipe): make sure the pipe is not stuck (#2933)
ca99a67 - fix(launcher): always add about:blank to default arguments. (#2942)
5b18987 - chore(ci): yet another attempt to fix pptr@next (#2940)
1d5f52e - chore(ci): fix auto-publish to travis (#2931)
8f5ecf5 - chore(ci): fix auto-publish to travis (#2930)
670b0c3 - fix(launcher): do not add --disable-gpu on OSX and Linux (#2908)
26cd16c - docs(api.md): expand on testing Chrome Extensions (#2893)
56368aa - fix(page): page.click should work with disabled javascript (#2907)
e4e72c9 - docs(api.md): fix typo (#2890)
e7b0e0f - feat(chromium): roll Chromium to r574897 (#2887)
8802253 - chore: bump version to v1.6.0-post (#2883)

Commits

The new version differs by 50 commits ahead by 50, behind by 6.

  • 66caee4 chore: mark version v1.7.0 (#3059)
  • be7626f fix: revert ExecutionContext reporting. (#3058)
  • 28ccf5d docs(api.md): some grammar/wording (#3057)
  • 204c7ec feat: introduce puppeteer/Errors (#3056)
  • 231a2be feat: expose frame's execution contexts (#3048)
  • b84404c docs(api.md): fix a typo (#3055)
  • 8c713ef fix(browserfetcher): handle extract-zip errors (#3052)
  • 40466cb feat(launcher): ignoreDefaultArgs to accept array of options (#3049)
  • 1be7545 chore: enhance markdown preprocessor (#3050)
  • 81d42c4 feat: prepare for publishing puppeteer-core (#3047)
  • d822401 docs(api.md): clarify coordinate system in mouse (#3041)
  • 608f5b7 docs(api.md): clarification note on request interception (#3042)
  • 735e17e docs(troubleshooting): Add instructions to run on App Engine and Cloud Functions (#3021)
  • 6825088 feat(launcher): allow options to be passed into puppeteer.defaultArgs (#2950)
  • 2e00076 chore: upgrade to TypeScript 3.0.1 (#3024)

There are 50 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of rx-queue is breaking the build 🚨

Version 0.4.28 of rx-queue was just published.

Branch Build failing 🚨
Dependency rx-queue
Current Version 0.4.26
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

rx-queue is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).
  • Travis CI - Branch: The build failed.

Commits

The new version differs by 17 commits.

  • 24bf8ab 0.4.28
  • 23e0954 Merge branch 'master' of github.com:zixia/rx-queue
  • 3a69e25 0.4.27
  • df75c81 fix bundle exception (#25)
  • 3d9c6c3 chore(package): update rollup to version 0.64.0 (#24)
  • fce7f71 chore(package): update rollup to version 0.63.1 (#23)
  • 9728b1f Merge pull request #21 from zixia/greenkeeper/rollup-0.62.0
  • 63db4cc chore(package): update rollup to version 0.62.0
  • 55c17a4 Merge pull request #15 from zixia/greenkeeper/shx-0.3.0
  • 08746d0 Merge branch 'master' into greenkeeper/shx-0.3.0
  • 00d30d4 Merge pull request #19 from zixia/greenkeeper/ts-node-7.0.0
  • 9d7548c chore(package): update ts-node to version 7.0.0
  • 53f687c Merge pull request #18 from zixia/greenkeeper/rollup-0.61.0
  • 5a61870 chore(package): update rollup to version 0.61.0
  • aabdabc Merge pull request #17 from zixia/greenkeeper/sinon-6.0.0

There are 17 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Deal with `Navigation Timeout` when `on(reset)` to prevent `window['emit'] already exists` error

2018-02-22T02:21:36.016283409Z [0]
2018-02-22T02:22:01.029523856Z 10:22:01 INFO IoClient [408] https://login.weixin.qq.com/qrcode/Qabm6i1VvA==
2018-02-22T02:22:01.029554884Z 10:22:01 INFO Listeners/Scan https://login.weixin.qq.com/qrcode/Qabm6i1VvA==
2018-02-22T02:22:01.029562992Z [408]
2018-02-22T02:24:01.030662599Z 10:24:01 WARN PuppetWeb initScanWatchdog() on(reset) lastFood: https://login.weixin.qq.com/qrcode/Qabm6i1VvA==, timePast: 120000
2018-02-22T02:24:31.033685094Z 10:24:31 ERR PuppetWeb initScanWatchdog() on(reset) exception: Error: Navigation Timeout Exceeded: 30000ms exceeded
2018-02-22T02:24:31.033737205Z 10:24:31 ERR PuppetWeb initScanWatchdog() on(reset) try to recover by bridge.{quit,init}()
2018-02-22T02:24:33.395441508Z 10:24:33 ERR PuppetWebBridge init() initPage() onLoad() exception: Error: Failed to add page binding with name emit: window['emit'] already exists!
2018-02-22T02:24:33.397423723Z 10:24:33 ERR PuppetWebBridge init() initPage() onLoad() exception: Error: Protocol error (Page.addScriptToEvaluateOnNewDocument): Target closed.
2018-02-22T02:24:33.398997028Z (node:6) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): AssertionError [ERR_ASSERTION]: Protocol error: Connection closed. Most likely the page has been closed.
2018-02-22T02:24:33.399062947Z (node:6) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
2018-02-22T02:24:33.399983343Z 10:24:33 ERR Error Error: Failed to add page binding with name emit: window['emit'] already exists!
2018-02-22T02:24:33.400523446Z 10:24:33 ERR Bot Error: Failed to add page binding with name emit: window['emit'] already exists!
2018-02-22T02:24:33.401978079Z 10:24:33 WARN PuppetWebBridge quit() page.close() exception: AssertionError [ERR_ASSERTION]: Protocol error: Connection closed. Most likely the page has been closed.
2018-02-22T02:24:33.414710282Z 10:24:33 VERB Blinder finis(1, exit, undefined)
2018-02-22T02:24:33.415718474Z 10:24:33 INFO Wechaty finis(1, exit)
2018-02-22T02:24:33.415845355Z 10:24:33 INFO Wechaty finis() bot had been already stopped
2018-02-22T02:24:34.235102068Z 10:24:34 INFO Config WORKDIR=/workdir/blinder-docker
2018-02-22T02:24:34.236053888Z 10:24:34 INFO Config IMAGEDIR=/workdir/blinder-docker/images
2018-02-22T02:24:34.237601630Z 10:24:34 INFO Config FACENET_SECRET=facenet
2018-02-22T02:24:34.629648470Z 10:24:34 INFO FaceBlinder v0.5.27
2018-02-22T02:24:34.632250393Z 10:24:34 INFO Wechaty TOKEN: blinder-docker
2018-02-22T02:24:34.636064110Z 10:24:34 INFO Wechaty v0.13.70
2018-02-22T02:24:34.637176975Z 10:24:34 INFO WechatyBlinder v0.5.27
2018-02-22T02:24:34.637339153Z 10:24:34 INFO Bot main()

Hello, wechaty-puppet-puppeteer may support ip proxy in the future?

Hello, wechaty-puppet-puppeteer may support ip proxy in the future?
like this:
` public async initBrowser (proxy?:string): Promise {
log.verbose('PuppetPuppeteerBridge', 'initBrowser()')

const headless = this.options.head ? false : true
const browser = await launch({
  args: [
    '--audio-output-channels=0',
    '--disable-default-apps',
    '--disable-extensions',
    '--disable-translate',
    '--disable-gpu',
    '--disable-setuid-sandbox',
    '--disable-sync',
    '--hide-scrollbars',
    '--mute-audio',
    '--no-sandbox',
    /**
     * 新增代理
     */
    '--proxy-server='+proxy
  ],
  headless,
})`

Should hold all the events before the data is full loaded.

在user login 之后,调用Contact.findAll()只获取到部分数据数据,实际联系人应该有几百个,请问是使用方式有问题吗?

const {Wechaty, Contact} = require('wechaty');

const wechaty = Wechaty.instance({profile: 'me', head: 'phantomjs'})
  .on('scan', (url, code) => console.log(`Scan QR Code to login: ${code}\n${url}`))
  .on('login', async (user) => {
    console.log(`User ${user} logined`);
    const contacts = await Contact.findAll();
    console.log('contacts', contacts.length);
  })
  .on('message', message => console.log(`Message: ${message}`))
  .init();

试了多次,实际返回只有8条数据
wechaty: v0.8.132
nodejs: v8.1.4

保存资源busy or locked,导致进程退出

这个问题不太多见,但是每次出现便会使进程退出。

code:

await file.toFile(`${dir_path}${file_path}${file_name}`, true).catch((e) => {
    logger.info(`保存文件失败,${dir_path}${file_path}${file_name}`)
    logger.error(e)
    file_path = "";
});

logs:


2018-12-17 12:39:41.438 { [Error: EBUSY: resource busy or locked, open 'C:\assets\image\2018-12-17\528548419131008142.jpg']
  errno: -4082,
  code: 'EBUSY',
  syscall: 'open',
  path:
   'C:\\assets\\image\\2018-12-17\\528548419131008142.jpg' }

2018-12-17 12:39:41.517 Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed
    at doWrite (_stream_writable.js:406:19)
    at writeOrBuffer (_stream_writable.js:394:5)
    at WriteStream.Writable.write (_stream_writable.js:294:11)
    at IncomingMessage.ondata (_stream_readable.js:666:20)
    at IncomingMessage.emit (events.js:182:13)
    at IncomingMessage.EventEmitter.emit (domain.js:442:20)
    at IncomingMessage.Readable.read (_stream_readable.js:486:10)
    at flow (_stream_readable.js:922:34)
    at resume_ (_stream_readable.js:904:3)
    at process._tickCallback (internal/process/next_tick.js:63:19)

Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed
    at doWrite (_stream_writable.js:406:19)
    at writeOrBuffer (_stream_writable.js:394:5)
    at WriteStream.Writable.write (_stream_writable.js:294:11)
    at IncomingMessage.ondata (_stream_readable.js:666:20)
    at IncomingMessage.emit (events.js:182:13)
    at IncomingMessage.EventEmitter.emit (domain.js:442:20)
    at IncomingMessage.Readable.read (_stream_readable.js:486:10)
    at flow (_stream_readable.js:922:34)
    at resume_ (_stream_readable.js:904:3)
    at process._tickCallback (internal/process/next_tick.js:63:19)

2018-12-17 12:39:41.568 PID:33916 npm 1 exit!

启动项目时提示下载Chromium r588429失败

`15:44:22 INFO Wechaty start() v0.22.4 is starting...
15:44:22 INFO PuppetManager install(wechaty-puppet-puppeteer@^0.14.1) please wait ...
npm:

[email protected] install /Users/mxue/Desktop/works/wechaty_test/node_modules/wechaty/node_modules/puppeteer
node install.js

npm: ERROR: Failed to download Chromium r588429! Set "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" env variable to skip download.

npm: { Error: read ETIMEDOUT
at TLSWrap.onread (net.js:660:25) errno: 'ETIMEDOUT', code: 'ETIMEDOUT', syscall: 'read' }

npm: npm
npm: WARN [email protected] requires a peer of file-box@^0.8.22 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of wechaty-puppet@^0.14.1 but none is installed. You must install peer dependencies yourself.

npm: npm WARN [email protected] requires a peer of brolog@^1.4.9 but none is installed. You must install peer dependencies yourself.

npm:

npm: npm
npm: ERR! code ELIFECYCLE

npm: npm ERR! errno 1

npm: npm
npm: ERR! [email protected] install: node install.js
npm
npm: ERR! Exit status 1

npm: npm ERR!
npm:
npm ERR! Failed at the [email protected] install script.

npm: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm:

npm: npm ERR! A complete log of this run can be found in:
npm ERR! /Users/mxue/.npm/_logs/2018-09-07T07_45_17_909Z-debug.log

{ Error: Command failed: npm install wechaty-puppet-puppeteer@^0.14.1
ERROR: Failed to download Chromium r588429! Set "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" env variable to skip download.
{ Error: read ETIMEDOUT
at TLSWrap.onread (net.js:660:25) errno: 'ETIMEDOUT', code: 'ETIMEDOUT', syscall: 'read' }
npm WARN [email protected] requires a peer of file-box@^0.8.22 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of wechaty-puppet@^0.14.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of brolog@^1.4.9 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/mxue/.npm/_logs/2018-09-07T07_45_17_909Z-debug.log

at ChildProcess.exithandler (child_process.js:289:12)
at ChildProcess.emit (events.js:182:13)
at ChildProcess.EventEmitter.emit (domain.js:442:20)
at maybeClose (internal/child_process.js:961:16)
at Socket.stream.socket.on (internal/child_process.js:380:11)
at Socket.emit (events.js:182:13)
at Socket.EventEmitter.emit (domain.js:442:20)
at Pipe._handle.close (net.js:599:12)

killed: false,
code: 1,
signal: null,
cmd: 'npm install wechaty-puppet-puppeteer@^0.14.1 ' }
15:45:17 ERR Wechaty start() exception: Command failed: npm install wechaty-puppet-puppeteer@^0.14.1
ERROR: Failed to download Chromium r588429! Set "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" env variable to skip download.
{ Error: read ETIMEDOUT
at TLSWrap.onread (net.js:660:25) errno: 'ETIMEDOUT', code: 'ETIMEDOUT', syscall: 'read' }
npm WARN [email protected] requires a peer of file-box@^0.8.22 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of wechaty-puppet@^0.14.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of brolog@^1.4.9 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/mxue/.npm/_logs/2018-09-07T07_45_17_909Z-debug.log

(node:2943) UnhandledPromiseRejectionWarning: Error: Command failed: npm install wechaty-puppet-puppeteer@^0.14.1
ERROR: Failed to download Chromium r588429! Set "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" env variable to skip download.
{ Error: read ETIMEDOUT
at TLSWrap.onread (net.js:660:25) errno: 'ETIMEDOUT', code: 'ETIMEDOUT', syscall: 'read' }
npm WARN [email protected] requires a peer of file-box@^0.8.22 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of wechaty-puppet@^0.14.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of brolog@^1.4.9 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/mxue/.npm/_logs/2018-09-07T07_45_17_909Z-debug.log

at ChildProcess.exithandler (child_process.js:289:12)
at ChildProcess.emit (events.js:182:13)
at ChildProcess.EventEmitter.emit (domain.js:442:20)
at maybeClose (internal/child_process.js:961:16)
at Socket.stream.socket.on (internal/child_process.js:380:11)
at Socket.emit (events.js:182:13)
at Socket.EventEmitter.emit (domain.js:442:20)
at Pipe._handle.close (net.js:599:12)

(node:2943) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:2943) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.`

wechaty的开发者您好,我在使用您的wecaty插件时出现了一个问题,上面是输出信息,我先复制了您的那6行代码,然后下载wechaty包,下载完了启动就出现这种情况,这个错误信息在mac/windows/centos下都有产生,现在已经排除了网络问题和操作系统问题,请问这个问题应该怎么解决呢

WARN PuppetPuppeteer roomRawPayload() currLength(-1) <= prevLength(0) ???

1. Versions

  • What is your wechaty version?
    Answer: 0.23.40

  • Which puppet are you using for wechaty? (padchat/puppeteer/padpro/...)
    Answer: puppeteer

  • What is your wechaty-puppet-XXX(padchat/puppeteer/) version?
    Answer: puppeteer

  • What is your node version? (run node --version)
    Answer: 11.0

  • What os are you using
    Answer: macOS

2. Describe the bug

rename room topic error.

6. Full Output Logs

12:26:20 WARN PuppetPuppeteer roomRawPayload() currLength(-1) <= prevLength(0) ???
12:26:21 WARN PuppetPuppeteer roomRawPayload() currLength(-1) <= prevLength(0) ???
12:26:22 WARN PuppetPuppeteer roomRawPayload() currLength(-1) <= prevLength(0) ???
12:26:23 WARN PuppetPuppeteer roomRawPayload() currLength(-1) <= prevLength(0) ???
12:26:24 WARN PuppetPuppeteer roomRawPayload() currLength(-1) <= prevLength(0) ???
12:26:25 WARN PuppetPuppeteer roomRawPayload() currLength(-1) <= prevLength(0) ???
12:26:26 WARN PuppetPuppeteer roomRawPayload() currLength(-1) <= prevLength(0) ???
12:26:27 ERR PuppetPuppeteer roomRawPayload(@694880f1ead94b706a28cff484f6d7704915d073a311a098232a5) exception: no payload
(node:82896) UnhandledPromiseRejectionWarning: Error: no payload
    at PuppetPuppeteer.<anonymous> (/Users/tii/Projects/bot/node_modules/wechaty-puppet-puppeteer/dist/src/puppet-puppeteer.js:603:23)
    at Generator.next (<anonymous>)
    at fulfilled (/Users/tii/Projects/bot/node_modules/wechaty-puppet-puppeteer/dist/src/puppet-puppeteer.js:22:58)
(node:82896) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:82896) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

7. Additional context

Thanks !

8. Code

bot.on('scan', onScan);
bot.on('login', onLogin);
bot.on('logout', onLogout);
bot.on('room-topic', onTopic);
bot.on('message', onMessage);
bot.on('error', onError);
bot.start().catch(console.error);
....
async function onTopic(room, topic, oldTopic, changer) {
    try {
        console.log(`${topic}`)
    } catch (e) {
        console.error(e)
    }
}

[bug]

An in-range update of @types/node is breaking the build 🚨

Version 10.5.8 of @types/node was just published.

Branch Build failing 🚨
Dependency @types/node
Current Version 10.5.7
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

@types/node is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).
  • Travis CI - Branch: The build failed.

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Page crashed!

Weird failure. I am adding an issue and see if I will encounter it once again.

[2018-10-16T22:43:43.452] [DEBUG] errorEvent - Error: Page crashed!
    at Page._onTargetCrashed (/home/zzn/ws/haoshiyou-bot/v1/node_modules/puppeteer/lib/Page.js:102:24)
    at Session.Page.client.on.event (/home/zzn/ws/haoshiyou-bot/v1/node_modules/puppeteer/lib/Page.js:97:56)
    at Session.emit (events.js:182:13)
    at Session.EventEmitter.emit (domain.js:442:20)
    at Session._onMessage (/home/zzn/ws/haoshiyou-bot/v1/node_modules/puppeteer/lib/Connection.js:210:12)
    at Connection._onMessage (/home/zzn/ws/haoshiyou-bot/v1/node_modules/puppeteer/lib/Connection.js:105:19)
    at WebSocket.emit (events.js:182:13)
    at WebSocket.EventEmitter.emit (domain.js:442:20)
    at Receiver._receiver.onmessage (/home/zzn/ws/haoshiyou-bot/v1/node_modules/ws/lib/WebSocket.js:141:47)
    at Receiver.dataMessage (/home/zzn/ws/haoshiyou-bot/v1/node_modules/ws/lib/Receiver.js:389:14)
    at Receiver.getData (/home/zzn/ws/haoshiyou-bot/v1/node_modules/ws/lib/Receiver.js:330:12)
    at Receiver.startLoop (/home/zzn/ws/haoshiyou-bot/v1/node_modules/ws/lib/Receiver.js:165:16)
    at Receiver.add (/home/zzn/ws/haoshiyou-bot/v1/node_modules/ws/lib/Receiver.js:139:10)
    at Socket._ultron.on (/home/zzn/ws/haoshiyou-bot/v1/node_modules/ws/lib/WebSocket.js:138:22)
    at Socket.emit (events.js:182:13)
    at Socket.EventEmitter.emit (domain.js:442:20)
    at addChunk (_stream_readable.js:283:12)
    at readableAddChunk (_stream_readable.js:264:11)
    at Socket.Readable.push (_stream_readable.js:219:10)
    at TCP.onread (net.js:635:20)

TypeError: MyPuppet is not a constructor

I'm getting the TypeError: MyPuppet is not a constructor error when running wechaty after upgrading it:

cd wechaty-getting-started/examples

$ git pull
Already up to date.
Current branch master is up to date.

$ WECHATY_PUPPET=puppeteer node starter-bot.js 
00:56:00 INFO PuppetManager install(puppeteer@latest) done
TypeError: MyPuppet is not a constructor
    at Function.<anonymous> (/path/to/wechaty-getting-started/examples/node_modules/wechaty/dist/src/puppet-manager.js:58:34)
    at Generator.next (<anonymous>)
    at fulfilled (/path/to/wechaty-getting-started/examples/node_modules/wechaty/dist/src/puppet-manager.js:4:58)
00:56:00 ERR Wechaty start() exception: MyPuppet is not a constructor
TypeError: MyPuppet is not a constructor
    at Function.<anonymous> (/path/to/wechaty-getting-started/examples/node_modules/wechaty/dist/src/puppet-manager.js:58:34)
    at Generator.next (<anonymous>)
    at fulfilled (/path/to/wechaty-getting-started/examples/node_modules/wechaty/dist/src/puppet-manager.js:4:58)

Here is more info:

$ node -v
v11.5.0

$ npm -v
6.5.0

$ npm -g outdated | wc
      0       0       0

`$ npm outdated | wc 
      0       0       0

$ lsb_release -a 
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.1 LTS
Release:	18.04
Codename:	bionic

Full Output Logs

Show Logs

All modules were freshly installed after node/npm update, which begins with
rm package*

$ WECHATY_LOG=silly WECHATY_PUPPET=puppeteer node starter-bot.js
01:03:52 SILL Config WECHATY_LOG set level to silly
01:03:52 INFO Config registering process.on("unhandledRejection") for development/debug
01:03:52 VERB Config constructor()
01:03:53 SILL Accessory #0<Wechaty> constructor()
01:03:53 VERB Wechaty contructor()
01:03:53 VERB StateSwitch constructor(name=Wechaty)
01:03:53 VERB StateSwitch constructor(name=WechatyReady)
01:03:53 VERB Wechaty on(scan, function) registered
01:03:53 VERB Wechaty onFunction(scan)
01:03:53 VERB Wechaty on(login, function) registered
01:03:53 VERB Wechaty onFunction(login)
01:03:53 VERB Wechaty on(logout, function) registered
01:03:53 VERB Wechaty onFunction(logout)
01:03:53 VERB Wechaty on(message, function) registered
01:03:53 VERB Wechaty onFunction(message)
01:03:53 SILL Wechaty version() form development environment is not availble: ENOENT: no such file or directory, stat '/path/to/wechaty-getting-started/examples/node_modules/wechaty/dist/.git'
01:03:53 INFO Wechaty <puppeteer> start() v0.22.6 is starting...
01:03:53 VERB Wechaty puppet: undefined
01:03:53 VERB Wechaty profile: undefined
01:03:53 VERB Wechaty id: cjpz261cu0000xtfu5a8r7fzu
01:03:53 SILL StateSwitch <Wechaty> on() is false
01:03:53 SILL StateSwitch <WechatyReady> off() is true
01:03:53 VERB StateSwitch <WechatyReady> off(true) <- (true)
01:03:53 SILL StateSwitch <Wechaty> on() is false
01:03:53 VERB StateSwitch <Wechaty> on(pending) <- (false)
01:03:53 VERB MemoryCard constructor(undefined)
01:03:53 VERB MemoryCard getStorage() for storage type: N/A
01:03:53 VERB MemoryCard load() from storage: N/A
01:03:53 VERB MemoryCard load() no storage
01:03:53 VERB Wechaty initPuppet() 
01:03:53 VERB MemoryCard multiplex(puppet)
01:03:53 VERB MemoryCard static multiplex(MemoryCard<>, puppet)
01:03:53 VERB MemoryCard constructor({"multiplex":{"name":"puppet","parent":{"payload":{},"multiplexNameList":[]}}})
01:03:53 VERB PuppetManager resolve({wechaty: Wechaty#cjpz261cu0000xtfu5a8r7fzu<>(), puppet: puppeteer, puppetOptions: undefined})
01:03:53 VERB PuppetManager resolveName(puppeteer)
01:03:53 VERB PuppetManager checkModule(puppeteer)
01:03:53 SILL PuppetManager checkModule() puppeteer installed version 1.11.0 NOT satisfied range undefined
01:03:53 INFO PuppetManager install(puppeteer@latest) please wait ...
npm: 
> [email protected] install /path/to/wechaty-getting-started/examples/node_modules/wechaty/node_modules/puppeteer
> node install.js


npm: 

npm: Chromium downloaded to /path/to/wechaty-getting-started/examples/node_modules/wechaty/node_modules/puppeteer/.local-chromium/linux-609904

npm: + [email protected]
updated 1 package and audited 64 packages in 23.95s

npm: found 0 vulnerabilities


01:04:18 INFO PuppetManager install(puppeteer@latest) done
TypeError: MyPuppet is not a constructor
    at Function.<anonymous> (/path/to/wechaty-getting-started/examples/node_modules/wechaty/dist/src/puppet-manager.js:58:34)
    at Generator.next (<anonymous>)
    at fulfilled (/path/to/wechaty-getting-started/examples/node_modules/wechaty/dist/src/puppet-manager.js:4:58)
01:04:18 ERR Wechaty start() exception: MyPuppet is not a constructor
TypeError: MyPuppet is not a constructor
    at Function.<anonymous> (/path/to/wechaty-getting-started/examples/node_modules/wechaty/dist/src/puppet-manager.js:58:34)
    at Generator.next (<anonymous>)
    at fulfilled (/path/to/wechaty-getting-started/examples/node_modules/wechaty/dist/src/puppet-manager.js:4:58)

$ npm list --depth=1
/path/to/wechaty-getting-started/examples
├── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected] extraneous
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ └── [email protected]
├─┬ [email protected]
│ ├── [email protected] deduped
│ ├── [email protected] deduped
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected] deduped
│ ├── [email protected] deduped
│ └── [email protected] deduped
└─┬ [email protected]
  ├── [email protected]
  ├── [email protected] deduped
  ├── [email protected] deduped
  ├── [email protected] deduped
  ├── [email protected]
  ├── [email protected]
  ├── [email protected] deduped
  ├── [email protected]
  ├── [email protected] deduped
  ├── [email protected] deduped
  ├── [email protected] deduped
  ├── [email protected]
  ├── [email protected]
  ├── [email protected] deduped
  ├── [email protected] deduped
  └── [email protected]

Try again with a cleaner installation:

rm -fr node_modules
rm -f package*

$ npm install wechaty
+ [email protected]
added 8 packages from 10 contributors, removed 580 packages, updated 38 packages, moved 1 package and audited 216 packages in 32.849s
found 0 vulnerabilities

$ npm install wechaty-puppet-puppeteer

> [email protected] install /path/to/wechaty-getting-started/node_modules/puppeteer
> node install.js

Downloading Chromium r609904 - 106.4 Mb [====================] 100% 0.0s 
Chromium downloaded to /path/to/wechaty-getting-started/node_modules/puppeteer/.local-chromium/linux-609904
+ [email protected]
added 87 packages from 76 contributors and audited 431 packages in 31.81s
found 0 vulnerabilities

$ WECHATY_PUPPET=puppeteer node starter-bot.js 
09:24:13 INFO Wechaty <puppeteer> start() v0.22.6 is starting...
09:24:13 INFO PuppetManager install(puppeteer@latest) please wait ...
npm: 
> [email protected] install /path/to/wechaty-getting-started/node_modules/wechaty/node_modules/puppeteer
> node install.js


npm: 

npm: Chromium downloaded to /path/to/wechaty-getting-started/node_modules/wechaty/node_modules/puppeteer/.local-chromium/linux-609904

npm: npm
npm:  
npm: notice created a lockfile as package-lock.json. You should commit this file.

npm: + [email protected]
added 43 packages from 22 contributors and audited 64 packages in 28.327s

npm: found 0 vulnerabilities


09:24:43 INFO PuppetManager install(puppeteer@latest) done
TypeError: MyPuppet is not a constructor
    at Function.<anonymous> (/path/to/wechaty-getting-started/node_modules/wechaty/dist/src/puppet-manager.js:58:34)
    at Generator.next (<anonymous>)
    at fulfilled (/path/to/wechaty-getting-started/node_modules/wechaty/dist/src/puppet-manager.js:4:58)
09:24:43 ERR Wechaty start() exception: MyPuppet is not a constructor
TypeError: MyPuppet is not a constructor
    at Function.<anonymous> (/path/to/wechaty-getting-started/node_modules/wechaty/dist/src/puppet-manager.js:58:34)
    at Generator.next (<anonymous>)
    at fulfilled (/path/to/wechaty-getting-started/node_modules/wechaty/dist/src/puppet-manager.js:4:58)

wechaty 不能发送url不以.jpg等结尾的图片

在用机器人 room.say 在群里发送图片的时候,如果图片的 url 不是以 .jpg/.png 等结尾的时候就会抛出异常。我看了你们的代码,我觉得这里不能这么判断吧,不能完全根据 url 的后缀来判断,因为有些图片没有后缀名,应该根据 http 请求的 head 中的 content-type 来判断才准确。涉及到的代码如下

https://github.com/Chatie/wechaty-puppet-puppeteer/blob/master/src/puppet-puppeteer.ts#L1247

An in-range update of wechaty-puppet is breaking the build 🚨

Version 0.8.2 of wechaty-puppet was just published.

Branch Build failing 🚨
Dependency wechaty-puppet
Current Version 0.8.1
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

wechaty-puppet is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 1 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Cannot recognize room topic with `&` char #524

Moved from wechaty/wechaty#524, author @lijiarui

Expected behavior

find the room '清华黑马&wechaty' with Room.find()

Actual behavior

Cannot find the room, after change room name with '清华黑马_wechaty', it works successfully.

I guess it cannot recognize the char &

When I have time will come to dive in it.

Steps to reproduce the behavior (and fixes, if any)

code as follows

async function roomAdd(contact: Contact) {
  console.log('!!!!!!!')
  const room = await Room.find({topic: '清华黑马&wechaty'})
  if (room) {
    console.log('find room')
    await room.add(contact)
    contact.say(`我新建了一个微信群,会自动把大家拉入群中哦~`)
  } else {
    console.log(`cannot find room!`)
  }
}

Paste the full output logs here with WECHATY_LOG=silly set

12:15:42 VERB Room find({ topic: 清华黑马&wechaty })
12:15:42 VERB Room findAll({ topic: 清华黑马&wechaty })
12:15:42 VERB PuppetWebBridge proxyWechaty(roomFind, (function (c) { return c === '清华黑马&wechaty' }))
12:15:42 SILL PuppetWebBridge execute()
12:15:42 SILL PuppetWebBrowser Browser.execute("return typeof WechatyBro === "undefined"")
12:15:42 SILL StateSwitch Browser:target() - open
12:15:42 SILL StateSwitch Browser:current() - open
12:15:42 SILL PuppetWebBridge execute()
12:15:42 SILL PuppetWebBrowser Browser.execute(" const callback = arguments[arguments.length - 1] const isAsync = (typeof  ... ")
12:15:42 SILL StateSwitch Browser:target() - open
12:15:42 SILL StateSwitch Browser:current() - open
12:15:42 SILL PuppetWebBridge execute()
12:15:42 SILL PuppetWebBrowser Browser.execute(" const callback = arguments[arguments.length - 1] const isAsync = (typeof  ... ")
12:15:42 SILL StateSwitch Browser:target() - open
12:15:42 SILL StateSwitch Browser:current() - open
12:15:42 SILL Message constructor() SN:14
12:15:42 SILL Message ready()
12:15:42 SILL Contact ready()
12:15:42 SILL Contact ready()
12:15:42 SILL Message ready()
12:15:42 SILL Contact ready()
12:15:42 SILL Contact ready()
cannot find room!

偶现 Error: connect ETIMEDOUT,导致进程退出

这个问题出现的概率不大,但出现必然导致进程退出。
logs:

2018-12-22 16:37:03.690 { Error: connect ETIMEDOUT 223.166.152.108:80
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1113:14)
  errno: 'ETIMEDOUT',
  code: 'ETIMEDOUT',
  syscall: 'connect',
  address: '223.166.152.108',
  port: 80 }

Error: connect ETIMEDOUT 223.166.152.108:80
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1113:14)

2018-12-22 16:37:03.744 PID:16356 npm 1 exit!

fix recalled message (from @wxul)

Author: @wxul

最近使用发现撤回消息不会被触发, 在分析源码和进行调试后发现有以下几个问题并提交此PR修复:
MessageType.Recalled will not be triggered. After analyzing the source code and debugging, I found the following problems and submitted this PR to fix:

  1. 撤回消息的xml中多了一些<br/>导致 xml2json 解析失败 (The <br/> tag in message text causing xml2json parsing to fail.)

src/wechaty-bro.js

      var content = utilFactory.htmlDecode(m.MMActualContent)
      content = utilFactory.encodeEmoji(content)
      // remove <br/> here
      content = content.replace(/<br.*?\/>/g, '')
      var revokemsg = utilFactory.xml2json(content).revokemsg
  1. 撤回消息会被当成 MessageType.Text 类型 (WebMessageType.RECALLED message will be converted to MessageType.Text)

src/pure-function-helpers/web-message-type.ts

    // add recall type
    case WebMessageType.RECALLED:
      return MessageType.Recalled
  1. 撤回消息之后, 触发的message事件中收到的消息是MessageType.Recalled类型的源消息实例, 无法判断其原有类型 (When message triggered, the received message is revoked message and it's type was overridden by MessageType.Recalled.)

根据我的设想, MessageType.Recalled消息应该保存被撤销消息的id, 然后由用户去获取被撤销的消息实例
According to my assumption, user should get message ID from MessageType.Recalled message, then find the revoked message.

src/wechaty-bro.js
old

      if (revokemsg.msgid) {
        var chatMsgs = chatFactory.getChatMessage(m.MMPeerUserName)
        var i = chatFactory._findMessageByMsgId(chatMsgs, revokemsg.msgid)
        if (i > -1) {
          m = chatMsgs[i]
          m.MsgType = confFactory.MSGTYPE_RECALLED
        } else {
          m.MsgId = revokemsg.msgid
          m.MMActualContent = m.Content = revokemsg.replacemsg.replace(/"/g, '')
        }
        WechatyBro.emit('message', m)
      }

new

      if (revokemsg.msgid) {
        // add recalled message
        m.MsgType = confFactory.MSGTYPE_RECALLED
        m.MMActualContent = JSON.stringify(revokemsg)
        chatFactory.addChatMessage(m)
      }

usage

bot.on('message', async function(message) {
  switch (message.type()) {
    case Message.Type.Recalled:
      console.log('Recalled', message.text()); // {"session":"7056706088@chatroom","oldmsgid":"1627228679","msgid":"176813759318050095","replacemsg":"\\"XXXXX\\" 撤回了一条消息"}
      try {
        let revokemsg = JSON.parse(message.text());
        let msgId = revokemsg.msgid;
        let msg = bot.Message.load(msgId);
        await msg.ready();

        console.log('Revoked message', msg.toString());
      } catch (error) {}
      break;
  }
});

END

PS: 我看源码的时间并不多, 对wechaty以及puppet的理解也仅限于业务接触到的地方, 如果有不合理的设计, 还望指正.

PS(from Google translate): I don't have much time to look at the source code. The understanding of wechaty and puppet is limited to the places where the business comes into contact. If there is an unreasonable design, I still want to correct me.

See Also

#81 #84 wechaty/wechaty#1728

An in-range update of wechaty is breaking the build 🚨

Version 0.17.132 of wechaty was just published.

Branch Build failing 🚨
Dependency wechaty
Current Version
</td>
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

wechaty is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of ajv is breaking the build 🚨

The devDependency ajv was updated from 6.5.3 to 6.5.4.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

ajv is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).
  • Travis CI - Branch: The build failed.

Commits

The new version differs by 8 commits.

  • 8578816 6.5.4
  • 5c41a84 Merge pull request #863 from epoberezkin/fix-861-property-names
  • c1f929b fix: propertyNames with empty schema, closes #861
  • 70362b9 test: failing test for #861
  • 12e1655 Merge pull request #862 from billytrend/patch-2
  • f01e92a Fixes grammar
  • 851b73c Merge pull request #858 from epoberezkin/greenkeeper/bluebird-pin-3.5.1
  • 9aa65f7 fix: pin bluebird to 3.5.1

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

room-join event cannot get inviteeList when name of invitee contains some emoji

Moved from wechaty/wechaty#588, author @kk3hi3123

Provide Your Network Information

Where is the location of your server? (i.e. City, or In/Out China)
Hong Kong

Run npm run doctor or wechaty run doctor(for docker user), paste output here

npm ERR! missing script: doctor

node -v: v8.0.0
npm -v: 5.0.0

Expected behavior

When users join the room, send a welcome message and friend requests to them.

Actual behavior

InviteeList cannot get the contact object that name contains some emoji.

I have tested for some cases. Some emoji like ring bell has no problem.
obj:
{ ......
name: '丁叮🛎',
...... }

But some other emoji like pumpkin cannot run correctly.
obj:
{ ......
name: '丁叮<img class="emoji emoji1f383" text="_web" src="/zh_CN/htmledition/v2/images/spacer.gif" />',
...... }
(This object is got in 'message' event by message.from(). By the way, on 'message' gets no problem with pumpkin emoji)

Steps to reproduce the behavior (and fixes, if any)

bot.on('room-join', (room, inviteeList, inviter) => {
        const nameList = inviteeList.map(c => c.name()).join(',');
        room.say(`歡迎新成員 ${nameList} 加入`);
    })

In this case, '歡迎新成員 加入' will be displayed in the room.

Paste the full output logs here with WECHATY_LOG=silly set

log.txt

add an event when the bot is invited into a room

Moved from wechaty/wechaty#255

When others join in the room, it can emit 'room-join' event, but when the bot is invited to a room, we don't have any event.

So I suggested adding an event when the bot is invited to a room.

Maybe we can still use room-join event.

Sys Message as follows:

"李佳芮"邀请你加入了群聊,群聊参与人还有:洁云微商、感觉、逗比
“李佳芮”invited you to a group chat with 独留一人、于、DEE

An in-range update of bl is breaking the build 🚨

The dependency bl was updated from 2.0.1 to 2.1.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

bl is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).
  • Travis CI - Branch: The build failed.

Release Notes for v2.1.0
  • Added indexOf #59
Commits

The new version differs by 4 commits.

  • 8c596a8 Bumped v2.1.0.
  • de8ba93 Merge pull request #59 from reconbot/reconbot/indexOf
  • 104b478 indexOf: Add native indexOf support for 1 byte searchs
  • 0d4d16a indexOf that conforms to nodejs 10 tests

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of @types/node is breaking the build 🚨

Version 10.7.2 of @types/node was just published.

Branch Build failing 🚨
Dependency @types/node
Current Version 10.7.1
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

@types/node is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).
  • Travis CI - Branch: The build failed.

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

PuppetPuppeteerFier fireRoomJoin() resolve payload fail

Moved from wechaty/wechaty#1491 author: @suntong

Caught one, after just logging in on second attempt (was trying to give up as I haven't caught anything for a day, but decided to give it another try). Anyway:

22:12:51 INFO Messenger: Contact<me> login
22:13:03 SILL Wechaty memoryCheck() free: 701 MB, require: 4 MB
22:13:03 VERB Wechaty start() throttleQueue.subscribe() new item: [object Object]
22:13:03 VERB MemoryCard <puppeteer> set(PUPPET_PUPPETEER, [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object])
22:13:03 VERB MemoryCard <puppeteer> save() file: /path/to/default.memory-card.json
22:13:03 VERB MemoryCard <> save() file: /path/to/default.memory-card.json
22:13:18 SILL Wechaty memoryCheck() free: 701 MB, require: 4 MB
22:13:33 SILL Wechaty memoryCheck() free: 701 MB, require: 4 MB
22:13:34 VERB PuppetPuppeteerFirer parseRoomJoin("Melody"邀请"louis"加入了群聊)
22:13:34 SILL PuppetPuppeteerFirer checkRoomJoin() inviteeList: louis, inviter: Melody
22:13:34 SILL PuppetPuppeteerFirer fireRoomJoin() retry() ttl 59
22:13:34 VERB Puppet roomMemberSearch(@@013f4fab7068f77094a867dd174b27f42acd91fc969547cc9db5154e44d26fc2, "louis")
22:13:34 VERB Puppet roomMemberSearch(@@013f4fab7068f77094a867dd174b27f42acd91fc969547cc9db5154e44d26fc2, {"roomAlias":"louis"})
22:13:34 VERB PuppetPuppeteer roommemberList(@@013f4fab7068f77094a867dd174b27f42acd91fc969547cc9db5154e44d26fc2)
22:13:34 VERB PuppetPuppeteer roomRawPayload(@@013f4fab7068f77094a867dd174b27f42acd91fc969547cc9db5154e44d26fc2)
22:13:34 SILL PuppetPuppeteerBridge getContact(@@013f4fab7068f77094a867dd174b27f42acd91fc969547cc9db5154e44d26fc2) retry attempt 1
22:13:34 SILL PuppetPuppeteerBridge proxyWechaty(getContact, @@013f4fab7068f77094a867dd174b27f42acd91fc969547cc9db5154e44d26fc2)
22:13:34 VERB PuppetPuppeteerFirer parseRoomJoin("louis"与群里其他人都不是微信朋友关系,请注意隐私安全)
22:13:34 SILL PuppetPuppeteerFirer checkRoomJoin() ""louis"与群里其他人都不是微信朋友关系,请注意隐私安全" is not a join message
22:13:34 VERB PuppetPuppeteerFirer fireRoomLeave("louis"与群里其他人都不是微信朋友关系,请注意隐私安全)
22:13:34 SILL PuppetPuppeteerFirer fireRoomLeave() no match
/home/u/wechaty1.log:22:13:34 WARN PuppetPuppeteerEvent checkRoomSystem message: <"louis"与群里其他人都不是微信朋友关系,请注意隐私安全> not found

I noticed that checkRoomJoin() has already found everything:

22:13:34 SILL PuppetPuppeteerFirer checkRoomJoin() inviteeList: louis, inviter: Melody

So I don't know what else checkRoomSystem is trying to find...


Caught one, after just logging in on second attempt (was trying to give up as I haven't caught anything for a day, but decided to give it another try). Anyway:

22:12:51 INFO Messenger: Contact<me> login
22:13:03 SILL Wechaty memoryCheck() free: 701 MB, require: 4 MB
22:13:03 VERB Wechaty start() throttleQueue.subscribe() new item: [object Object]
22:13:03 VERB MemoryCard <puppeteer> set(PUPPET_PUPPETEER, [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object])
22:13:03 VERB MemoryCard <puppeteer> save() file: /path/to/default.memory-card.json
22:13:03 VERB MemoryCard <> save() file: /path/to/default.memory-card.json
22:13:18 SILL Wechaty memoryCheck() free: 701 MB, require: 4 MB
22:13:33 SILL Wechaty memoryCheck() free: 701 MB, require: 4 MB
22:13:34 VERB PuppetPuppeteerFirer parseRoomJoin("Melody"邀请"louis"加入了群聊)
22:13:34 SILL PuppetPuppeteerFirer checkRoomJoin() inviteeList: louis, inviter: Melody
22:13:34 SILL PuppetPuppeteerFirer fireRoomJoin() retry() ttl 59
22:13:34 VERB Puppet roomMemberSearch(@@013f4fab7068f77094a867dd174b27f42acd91fc969547cc9db5154e44d26fc2, "louis")
22:13:34 VERB Puppet roomMemberSearch(@@013f4fab7068f77094a867dd174b27f42acd91fc969547cc9db5154e44d26fc2, {"roomAlias":"louis"})
22:13:34 VERB PuppetPuppeteer roommemberList(@@013f4fab7068f77094a867dd174b27f42acd91fc969547cc9db5154e44d26fc2)
22:13:34 VERB PuppetPuppeteer roomRawPayload(@@013f4fab7068f77094a867dd174b27f42acd91fc969547cc9db5154e44d26fc2)
22:13:34 SILL PuppetPuppeteerBridge getContact(@@013f4fab7068f77094a867dd174b27f42acd91fc969547cc9db5154e44d26fc2) retry attempt 1
22:13:34 SILL PuppetPuppeteerBridge proxyWechaty(getContact, @@013f4fab7068f77094a867dd174b27f42acd91fc969547cc9db5154e44d26fc2)
22:13:34 VERB PuppetPuppeteerFirer parseRoomJoin("louis"与群里其他人都不是微信朋友关系,请注意隐私安全)
22:13:34 SILL PuppetPuppeteerFirer checkRoomJoin() ""louis"与群里其他人都不是微信朋友关系,请注意隐私安全" is not a join message
22:13:34 VERB PuppetPuppeteerFirer fireRoomLeave("louis"与群里其他人都不是微信朋友关系,请注意隐私安全)
22:13:34 SILL PuppetPuppeteerFirer fireRoomLeave() no match
/home/u/wechaty1.log:22:13:34 WARN PuppetPuppeteerEvent checkRoomSystem message: <"louis"与群里其他人都不是微信朋友关系,请注意隐私安全> not found

I noticed that checkRoomJoin() has already found everything:

22:13:34 SILL PuppetPuppeteerFirer checkRoomJoin() inviteeList: louis, inviter: Melody

So I don't know what else checkRoomSystem is trying to find...


Found some fireRoomJoin() resolve payload fail cases. Folded up to protect PII data from the innocent eyes.

Debug Logs

Full output logs here with WECHATY_LOG=silly set

## Case #1

23:07:05 VERB Puppet roomMemberSearch(@@013f4fab7068f77094a867dd174b27f42acd9
1fc969547cc9db5154e44d26fc2, {"contactAlias":"Mary Guan <span class=\"emoji emoji2122\"></span> 伦敦理财"})
23:07:05 VERB PuppetPuppeteer roommemberList(@@013f4fab7068f77094a867dd174b27f42acd91fc969547cc9db5154e44d26fc2)
23:07:05 VERB PuppetPuppeteer roomRawPayload(@@013f4fab7068f77094a867dd174b27f42acd91fc969547cc9db5154e44d26fc2)
23:07:05 SILL PuppetPuppeteerBridge getContact(@@013f4fab7068f77094a867dd174b27f42acd91fc969547cc9db5154e44d26fc2) retry attempt 1
23:07:05 SILL PuppetPuppeteerBridge proxyWechaty(getContact, @@013f4fab7068f77094a867dd174b27f42acd91fc969547cc9db5154e44d26fc2)
23:07:05 SILL PuppetPuppeteer roomPayload() this.bridge.getContact(@@013f4fab7068f77094a867dd174b27f42acd91fc969547cc9db5154e44d26fc2) MemberList.length:(prev:0, curr:319) at ttl:6
23:07:05 SILL PuppetPuppeteer roomPayload() puppet.getContact(@@013f4fab7068f77094a867dd174b27f42acd91fc969547cc9db5154e44d26fc2) retry at ttl:6
23:07:06 SILL PuppetPuppeteerBridge getContact(@@013f4fab7068f77094a867dd174b27f42acd91fc969547cc9db5154e44d26fc2) retry attempt 1
23:07:06 SILL PuppetPuppeteerBridge proxyWechaty(getContact, @@013f4fab7068f77094a867dd174b27f42acd91fc969547cc9db5154e44d26fc2)
23:07:06 SILL PuppetPuppeteer roomPayload() this.bridge.getContact(@@013f4fab7068f77094a867dd174b27f42acd91fc969547cc9db5154e44d26fc2) MemberList.length:(prev:319, curr:319) at ttl:5
23:07:06 SILL PuppetPuppeteer roomPayload() puppet.getContact(@857611455f2c8f
a958b13eb97882a3013d8bb382c86e3e875261d5eebd98fee0) done at ttl:5 with length:319
23:07:06 VERB Puppet contactSearch(query={"alias":"Mary Guan <span class=\"emoji emoji2122\"></span> 伦敦理财"}, idList.length = 319)
23:07:06 SILL Puppet contactSearch() searchIdList.length = 319
23:07:06 VERB Puppet contactQueryFilterFactory({"alias":"Mary Guan <span class=\"emoji emoji2122\"></span> 伦敦理财"})
23:07:06 SILL Puppet contactSearch() searchContactPayloadList.length = 0
23:07:06 VERB Puppet roomMemberPayload(roomId=@@013f4fab7068f77094a867dd174b27f42acd91fc969547cc9db5154e44d26fc2, contactId=@9f673b0e2eed298af1b7b6b69059b0d6ac80ad359d66526e8dff1964de55bda6)

 ... skipping loads of the roomMemberPayloads (IMHO, this should not be in the debug output unless expressively requested) ...

23:07:06 VERB Puppet roomMemberPayload(roomId=@@013f4fab7068f77094a867dd174b2
7f42acd91fc969547cc9db5154e44d26fc2, contactId=@e10e30536e2dd036b7bf694dd7f68
731ff44800141e171e4926ba62697e513e0)
23:07:06 VERB Puppet roomMemberPayload(roomId=@@013f4fab7068f77094a867dd174b2
7f42acd91fc969547cc9db5154e44d26fc2, contactId=@c459c1baad08142db863023eece61
68256995631a894782e326f41a0034d3301)
23:07:06 WARN PuppetPuppeteerFier fireRoomJoin() resolve payload fail.
23:07:06 VERB PuppetPuppeteerFirer fireRoomLeave("NK 刘旭伟法律留学4163589377"邀请"Mary Guan <span class="emoji emoji2122"></span> 伦敦理财"加入了群聊)
23:07:06 SILL PuppetPuppeteerFirer fireRoomLeave() no match
23:07:06 WARN PuppetPuppeteerEvent checkRoomSystem message: <"NK 刘旭伟法律留学4163589377"邀请"Mary Guan <span class="emoji emoji2122"></span> 伦敦理财"加入了群聊> not found
23:07:06 VERB Message static create(4904610157633791086)
23:07:06 SILL Accessory #2984<Message> constructor()
23:07:06 VERB Message constructor(4904610157633791086) for class Message
23:07:06 VERB Message ready()



## Case #2

01:15:15 VERB Puppet roomMemberPayload(roomId=@@013f4fab7068f77094a867dd174b27f42acd91fc969547cc9db5154e44d26fc2, contactId=@81beed378a44396dd79acf5b99290dfdf11aa3e0c9777113df56421712d5ca17)
01:15:15 VERB Puppet roomMemberSearch(@@013f4fab7068f77094a867dd174b27f42acd91fc969547cc9db5154e44d26fc2, {"contactAlias":"快乐燕子"})
01:15:15 VERB PuppetPuppeteer roommemberList(@@013f4fab7068f77094a867dd174b27f42acd91fc969547cc9db5154e44d26fc2)
01:15:15 VERB PuppetPuppeteer roomRawPayload(@@013f4fab7068f77094a867dd174b27f42acd91fc969547cc9db5154e44d26fc2)
01:15:15 SILL PuppetPuppeteerBridge getContact(@@013f4fab7068f77094a867dd174b27f42acd91fc969547cc9db5154e44d26fc2) retry attempt 1
01:15:15 SILL PuppetPuppeteerBridge proxyWechaty(getContact, @@013f4fab7068f77094a867dd174b27f42acd91fc969547cc9db5154e44d26fc2)
01:15:16 SILL PuppetPuppeteer roomPayload() this.bridge.getContact(@@013f4fab7068f77094a867dd174b27f42acd91fc969547cc9db5154e44d26fc2) MemberList.length:(prev:0, curr:325) at ttl:6
01:15:16 SILL PuppetPuppeteer roomPayload() puppet.getContact(@@013f4fab7068f77094a867dd174b27f42acd91fc969547cc9db5154e44d26fc2) retry at ttl:6
01:15:17 SILL PuppetPuppeteerBridge getContact(@@013f4fab7068f77094a867dd174b27f42acd91fc969547cc9db5154e44d26fc2) retry attempt 1
01:15:17 SILL PuppetPuppeteerBridge proxyWechaty(getContact, @@013f4fab7068f77094a867dd174b27f42acd91fc969547cc9db5154e44d26fc2)
01:15:17 SILL PuppetPuppeteer roomPayload() this.bridge.getContact(@@013f4fab7068f77094a867dd174b27f42acd91fc969547cc9db5154e44d26fc2) MemberList.length:(prev:325, curr:325) at ttl:5
01:15:17 SILL PuppetPuppeteer roomPayload() puppet.getContact(@857611455f2c8fa958b13eb97882a3013d8bb382c86e3e875261d5eebd98fee0) done at ttl:5 with length:325
01:15:17 VERB Puppet contactSearch(query={"alias":"快乐燕子"}, idList.length = 325)
01:15:17 SILL Puppet contactSearch() searchIdList.length = 325
01:15:17 VERB Puppet contactQueryFilterFactory({"alias":"快乐燕子"})
01:15:17 SILL Puppet contactSearch() searchContactPayloadList.length = 0
01:15:17 VERB Puppet roomMemberPayload(roomId=@@013f4fab7068f77094a867dd174b27f42acd91fc969547cc9db5154e44d26fc2, contactId=@9f673b0e2eed298af1b7b6b69059b0d6ac80ad359d66526e8dff1964de55bda6)

 ... skipping loads of the roomMemberPayloads (IMHO, this should not be in the debug output unless expressively requested) ...

01:15:17 VERB Puppet roomMemberPayload(roomId=@@013f4fab7068f77094a867dd174b27f42acd91fc969547cc9db5154e44d26fc2, contactId=@81beed378a44396dd79acf5b99290dfdf11aa3e0c9777113df56421712d5ca17)
01:15:17 WARN PuppetPuppeteerFier fireRoomJoin() resolve payload fail.
01:15:17 VERB PuppetPuppeteerFirer fireRoomLeave("快乐燕子"邀请"李菊"加入了群聊)
01:15:17 SILL PuppetPuppeteerFirer fireRoomLeave() no match
01:15:17 WARN PuppetPuppeteerEvent checkRoomSystem message: <"快乐燕子"邀请"
李菊"加入了群聊> not found
01:15:17 VERB Message static create(6271236879510998245)
01:15:17 SILL Accessory #3169<Message> constructor()
01:15:17 VERB Message constructor(6271236879510998245) for class Message
01:15:17 VERB Message ready()
. . .

An in-range update of request is breaking the build 🚨

Version 2.88.0 of request was just published.

Branch Build failing 🚨
Dependency request
Current Version 2.87.0
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

request is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).
  • Travis CI - Branch: The build failed.

Commits

The new version differs by 13 commits.

  • 6420240 2.88.0
  • bd22e21 fix: massive dependency upgrade, fixes all production vulnerabilities
  • 925849a Merge pull request #2996 from kwonoj/fix-uuid
  • 7b68551 fix(uuid): import versioned uuid
  • 5797963 Merge pull request #2994 from dlecocq/oauth-sign-0.9.0
  • 628ff5e Update to oauth-sign 0.9.0
  • 10987ef Merge pull request #2993 from simov/fix-header-tests
  • cd848af These are not going to fail if there is a server listening on those ports
  • a92e138 #515, #2894 Strip port suffix from Host header if the protocol is known. (#2904)
  • 45ffc4b Improve AWS SigV4 support. (#2791)
  • a121270 Merge pull request #2977 from simov/update-cert
  • bd16414 Update test certificates
  • 536f0e7 2.87.1

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Connection closed. Most likely the page has been closed

0. Report Issue Guide

  1. Please search in the issue first, and make sure your problem had not been reported before.
  2. If your issue is related to wechaty-puppet-padchat, please report the issue at https://github.com/lijiarui/wechaty-puppet-padchat/issues/new
  3. If your issue is related to wechaty-puppet-puppeteer, please report the issue at https://github.com/Chatie/wechaty-puppet-puppeteer/issues/new
  4. If your issue is DIRECT related to Wechaty, then please follow the below template and make sure you fill it as required in detail.

1. Expected behavior

Question: What behavior do you expect?

Answer: I want to keep the robot running

2. Actual behavior

Question: What actual behavior did you experience?

Answer: The robot has gone wrong for ten minutes.

3. Steps to reproduce your problem (and fixes, if any)

Start the robot, after the login is successful, the error occurs after running for ten minutes.

Question: What're the reproducible steps for us to see your problem?

Answer: gone wrong for ten minutes.

4. Full Output Logs

WARN PuppetPuppeteerBridge stop() page.close() exception: Error: Protocol error: Connection closed. Most likely the page has been closed.
Connection closed4

Recalled type of messages do not trigger .on('message') again

Moved from wechaty/wechaty#1065 author @WiseClock

Provide Your Network Information

  1. Where is the location of your server? (i.e. City, or In/Out China)
    Canada
  2. Which cloud platform(AliYun/Qcloud/DigitalOcean/etc) are you using?
    Own PC

Run npm run doctor or wechaty run doctor(for docker user), paste output here

npm ERR! missing script: doctor

Expected behavior

Recalling messages trigger the .on('message') method with a message of type RECALLED and the original message wrapped in.

It should be fixed months ago in: wechaty/wechaty@174b677
Am I missing something in the setup or is the API changed?

Actual behavior

Recalling a message does not trigger the .on('message') method and shows nothing in the console output.

Steps to reproduce the behavior (and fixes, if any)

  1. Write a .on('message') method to log the message into console.
  2. Send a message to the bot, and it'll show in console
  3. Recall the message sent, nothing will show up in console

Full Output Logs

Show Logs ### Paste the full output logs here with `WECHATY_LOG=silly` set
D:\CODE\node\rin_wechaty>set WECHATY_LOG=silly

D:\CODE\node\rin_wechaty>node index.js WECHATY_LOG=silly
22:50:24 SILL Brolog WECHATY_LOG set level to silly
22:50:24 INFO Config registering process.on("unhandledRejection") for development/debug
22:50:24 VERB Config constructor()
22:50:25 SILL StateSwitch constructor(Wechaty)
22:50:25 VERB Wechaty contructor()
22:50:25 VERB Profile constructor(rin)
22:50:25 VERB Wechaty on(scan, function) registered
22:50:25 VERB Wechaty onFunction(scan)
22:50:25 VERB Wechaty on(login, function) registered
22:50:25 VERB Wechaty onFunction(login)
22:50:25 VERB Wechaty on(message, function) registered
22:50:25 VERB Wechaty onFunction(message)
22:50:25 SILL Wechaty version() form development environment is not availble: ENOENT: no such file o
r directory, stat 'D:\CODE\node\rin_wechaty\node_modules\wechaty\dist\.git'
22:50:25 INFO Wechaty v0.13.42 starting...
22:50:25 VERB Wechaty puppet: web
22:50:25 VERB Wechaty profile: rin
22:50:25 VERB Wechaty uuid: 2adc06ea-47a2-4bee-8769-88953859c350
22:50:25 SILL StateSwitch <Wechaty> on() is false
22:50:25 SILL StateSwitch <Wechaty> on() is false
22:50:25 SILL StateSwitch <Wechaty> on() is false
22:50:25 VERB StateSwitch <Wechaty> on(pending) <- (false)
22:50:25 VERB Profile load() file: D:\CODE\node\rin_wechaty\rin.wechaty.json
22:50:25 VERB Wechaty initPuppet()
22:50:25 SILL StateSwitch constructor(Puppet)
22:50:25 VERB Wechaty initPuppet() puppet.on(error) registered
22:50:25 VERB Wechaty initPuppet() puppet.on(friend) registered
22:50:25 VERB Wechaty initPuppet() puppet.on(heartbeat) registered
22:50:25 VERB Wechaty initPuppet() puppet.on(login) registered
22:50:25 VERB Wechaty initPuppet() puppet.on(logout) registered
22:50:25 VERB Wechaty initPuppet() puppet.on(message) registered
22:50:25 VERB Wechaty initPuppet() puppet.on(room-join) registered
22:50:25 VERB Wechaty initPuppet() puppet.on(room-leave) registered
22:50:25 VERB Wechaty initPuppet() puppet.on(room-topic) registered
22:50:25 VERB Wechaty initPuppet() puppet.on(scan) registered
22:50:25 VERB Config puppetInstance(PuppetWeb)
22:50:25 VERB PuppetWeb init() with Profile<rin>
22:50:25 SILL StateSwitch <Puppet> on() is false
22:50:25 VERB StateSwitch <Puppet> on(pending) <- (false)
22:50:25 VERB PuppetWeb initWatchdogForPuppet()
22:50:25 VERB PuppetWeb initWatchdogForScan()
22:50:25 VERB PuppetWeb initBridge()
22:50:25 SILL StateSwitch <Puppet> off() is false
22:50:25 VERB PuppetWebBridge constructor()
22:50:25 SILL StateSwitch constructor(PuppetWebBridge)
22:50:25 VERB PuppetWebBridge init()
22:50:25 SILL StateSwitch <PuppetWebBridge> on() is false
22:50:25 VERB StateSwitch <PuppetWebBridge> on(pending) <- (false)
22:50:25 VERB PuppetWebBridge initBrowser()
22:50:27 VERB PUppetWebBridge initBrowser() version: HeadlessChrome/65.0.3312.0
22:50:27 VERB PuppetWebBridge init() initBrowser() done
22:50:27 VERB PuppetWebBridge initPage()
22:50:28 VERB Profile get(cookies)
22:50:28 VERB PuppetWebBridge cookieDomain([object Object],[object Object],[object Object],[object O
bject],[object Object],[object Object],[object Object],[object Object],[object Object],[object Objec
t],[object Object],[object Object])
22:50:28 SILL PuppetWebBridge cookieDomain() got https://web.wechat.com
22:50:28 VERB PuppetWebBridge initPage() before page.goto(url)
22:50:32 VERB PuppetWebBridge initPage() after page.goto(url)
22:50:32 SILL PuppetWebBridge initPage() page.setCookie() 12 cookies set back
22:50:32 VERB PuppetWebBridge initPage() on(load) https://web.wechat.com/
22:50:32 SILL StateSwitch <PuppetWebBridge> off() is false
22:50:33 VERB PuppetWebBridge readyAngular()
22:50:33 VERB PuppetWebBridge inject()
22:50:33 SILL PuppetWebBridge inject() eval(Wechaty) return code[200] message[WechatyBro Inject Done
]
22:50:33 SILL PuppetWebBridge proxyWechaty(init)
22:50:33 SILL PuppetWebEvent onLog(login(page refresh))
22:50:33 VERB PuppetWebEvent onLogin(page refresh, 30)
22:50:33 SILL StateSwitch <Puppet> off() is false
22:50:33 VERB PuppetWebBridge getUserName()
22:50:33 SILL PuppetWebBridge proxyWechaty(getUserName)
22:50:33 SILL PuppetWebEvent onLog(init() scanCode: null)
22:50:33 SILL PuppetWebEvent onDing(heartbeat@browser)
22:50:33 SILL PuppetWeb initWatchdogForPuppet() dog.on(feed, food={type=undefined, data=heartbeat@br
owser})
22:50:33 SILL PuppetWebEvent onLog(inited!. ;-D)
22:50:33 VERB PuppetWebEvent onLogin() browser not fully loaded(ttl=30), retry later
22:50:33 SILL PuppetWebBridge evaluate()
22:50:33 SILL PuppetWebBridge inject() Wechaty.init() return code[200] message[WechatyBro Init Succ]

22:50:33 VERB PuppetWebBridge ding(ding() OK!)
22:50:33 SILL PuppetWebBridge proxyWechaty(ding , ding() OK!)
22:50:33 SILL PuppetWebEvent onLogin() innerHTML:
    <canvas style="position:absolute;top:0;left:0;bottom:0;right:0;z-index:-1;width:100%;height:100%
;" id="heroCanvas"></canvas>

    <!--[if lt IE 8]>
    <p class="browsehappy">
      你正在使用一个<strong>过时</strong>的浏览器。请<a class="link" href="http://browsehappy.com" t
arget="_blank">升级你的浏览器</a>以查看微信网页版。</p>
    </p>
    <![endif]-->

    <!--BEGIN login-->
    <!-- ngIf: false -->
    <!--END login-->
    <!--BEGIN main-->
    <div class="main">
        <div class="main_inner" ng-right-click="showC
22:50:33 SILL PuppetWebEvent onLog(recv ding)
22:50:33 SILL PuppetWebBridge inject() ding success
22:50:33 VERB PuppetWebBridge clickSwitchAccount()
22:50:33 VERB PuppetWebBridge clickSwitchAccount() listXpath()
22:50:33 SILL StateSwitch <PuppetWebBridge> on() is pending
22:50:33 VERB StateSwitch <PuppetWebBridge> on(true) <- (pending)
22:50:33 VERB PuppetWebBridge init() initPage() done
22:50:33 VERB PuppetWeb initBridge() done
22:50:33 SILL StateSwitch <Puppet> on() is pending
22:50:33 VERB StateSwitch <Puppet> on(true) <- (pending)
22:50:33 SILL PuppetWeb initWatchdogForPuppet() dog.on(feed, food={type=undefined, data=inited})
22:50:33 VERB PuppetWeb init() done
22:50:33 VERB Wechaty on(heartbeat, function) registered
22:50:33 VERB Wechaty onFunction(heartbeat)
22:50:33 SILL StateSwitch <Wechaty> on() is pending
22:50:33 VERB StateSwitch <Wechaty> on(true) <- (pending)
22:50:34 SILL PuppetWebEvent onLog(checkScan() - already login, no more check, and return(only))
22:50:34 VERB PuppetWebEvent onLogin(page refresh, 29)
22:50:34 SILL StateSwitch <Puppet> off() is false
22:50:34 VERB PuppetWebBridge getUserName()
22:50:34 SILL PuppetWebBridge proxyWechaty(getUserName)
22:50:34 SILL PuppetWebEvent bridge.getUserName: @f2b91da57f0df1970741382303d3530c1a51984fa2550082ce
3ac0589b7f040f
22:50:34 SILL Contact constructor(@f2b91da57f0df1970741382303d3530c1a51984fa2550082ce3ac0589b7f040f)

22:50:34 SILL Contact get contact via PuppetWeb
22:50:34 SILL PuppetWebBridge getContact() retryPromise: attampt 1/35 time for timeout 306250
22:50:34 SILL PuppetWebBridge proxyWechaty(getContact , @f2b91da57f0df1970741382303d3530c1a51984fa25
50082ce3ac0589b7f040f)
22:50:34 SILL Contact contactGetter(@f2b91da57f0df1970741382303d3530c1a51984fa2550082ce3ac0589b7f040
f) resolved
22:50:34 SILL PuppetWebEvent onLogin() user 玲‎ logined
22:50:34 SILL StateSwitch <Puppet> on() is true
22:50:34 VERB Profile set(cookies, [object Object],[object Object],[object Object],[object Object],[
object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[obje
ct Object],[object Object])
22:50:34 VERB Profile save() file: D:\CODE\node\rin_wechaty\rin.wechaty.json
22:50:34 VERB PuppetWeb readyStable()
22:50:34 SILL PuppetWeb readyStable() stable() counter=-1
22:50:34 VERB Cotnact findAll({ name: /.*/ })
22:50:34 SILL PuppetWebBridge proxyWechaty(contactFind , (function (c) { return /.*/.test(c.NickName
) }))
22:50:34 SILL Contact constructor(@991de494c36eeea277fd7edaa32d6e9b)
22:50:34 SILL Contact constructor(weixin)
22:50:34 SILL Contact constructor(filehelper)
22:50:34 SILL Contact get contact via PuppetWeb
22:50:34 SILL PuppetWebBridge getContact() retryPromise: attampt 1/35 time for timeout 306250
22:50:34 SILL PuppetWebBridge proxyWechaty(getContact , @991de494c36eeea277fd7edaa32d6e9b)
22:50:34 SILL Contact get contact via PuppetWeb
22:50:34 SILL PuppetWebBridge getContact() retryPromise: attampt 1/35 time for timeout 306250
22:50:34 SILL PuppetWebBridge proxyWechaty(getContact , weixin)
22:50:34 SILL Contact get contact via PuppetWeb
22:50:34 SILL PuppetWebBridge getContact() retryPromise: attampt 1/35 time for timeout 306250
22:50:34 SILL PuppetWebBridge proxyWechaty(getContact , filehelper)
22:50:34 SILL Contact contactGetter(@991de494c36eeea277fd7edaa32d6e9b) resolved
22:50:34 SILL Contact contactGetter(weixin) resolved
22:50:34 SILL Contact contactGetter(filehelper) resolved
22:50:35 SILL PuppetWeb readyStable() stable() counter=3
22:50:35 VERB Cotnact findAll({ name: /.*/ })
22:50:35 SILL PuppetWebBridge proxyWechaty(contactFind , (function (c) { return /.*/.test(c.NickName
) }))
22:50:35 VERB PuppetWeb readyStable() stable() READY counter=3
User Contact<玲‎> logged in.
22:50:37 SILL Message constructor() SN:0
22:50:37 SILL Message ready()
22:50:37 SILL Room constructor(@@0e3a0ca99aff4dd4bb4695be2d48cd91b9b726b4d9a1e26803dda72d4beec5dc)
22:50:37 SILL Room ready()
22:50:37 SILL PuppetWebBridge getContact() retryPromise: attampt 1/35 time for timeout 306250
22:50:37 SILL PuppetWebBridge proxyWechaty(getContact , @@0e3a0ca99aff4dd4bb4695be2d48cd91b9b726b4d9
a1e26803dda72d4beec5dc)
22:50:37 SILL Room ready() contactGetter(@@0e3a0ca99aff4dd4bb4695be2d48cd91b9b726b4d9a1e26803dda72d4
beec5dc) MemberList.length:2 at ttl:6
22:50:37 SILL Room ready() contactGetter(@@0e3a0ca99aff4dd4bb4695be2d48cd91b9b726b4d9a1e26803dda72d4
beec5dc) retry at ttl:6
22:50:38 SILL PuppetWebBridge getContact() retryPromise: attampt 1/35 time for timeout 306250
22:50:38 SILL PuppetWebBridge proxyWechaty(getContact , @@0e3a0ca99aff4dd4bb4695be2d48cd91b9b726b4d9
a1e26803dda72d4beec5dc)
22:50:38 SILL Room ready() contactGetter(@@0e3a0ca99aff4dd4bb4695be2d48cd91b9b726b4d9a1e26803dda72d4
beec5dc) MemberList.length:2 at ttl:5
22:50:38 VERB Room ready() contactGetter(@@0e3a0ca99aff4dd4bb4695be2d48cd91b9b726b4d9a1e26803dda72d4
beec5dc) done at ttl:5
22:50:38 SILL Message ready()
22:50:38 SILL Room ready()
22:50:38 SILL Room ready()
Message: Message<test>
22:50:48 SILL PuppetWebEvent onDing(heartbeat@browser)
22:50:48 SILL PuppetWeb initWatchdogForPuppet() dog.on(feed, food={type=undefined, data=heartbeat@br
owser})
22:50:48 SILL Wechaty memoryCheck() free: 804 MB, require: 4 MB
22:50:48 VERB Wechaty init() throttleQueue.subscribe() new item: heartbeat@browser
22:50:48 VERB Profile set(cookies, [object Object],[object Object],[object Object],[object Object],[
object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[obje
ct Object],[object Object])
22:50:48 VERB Profile save() file: D:\CODE\node\rin_wechaty\rin.wechaty.json

An in-range update of wechaty-puppet is breaking the build 🚨

Version 0.8.5 of wechaty-puppet was just published.

Branch Build failing 🚨
Dependency wechaty-puppet
Current Version 0.8.4
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

wechaty-puppet is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Commits

The new version differs by 3 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

feature for configurable autoLogin and switchAccount

Moved from wechaty/wechaty#1172 author: @alamusi

Provide Your Network Information

  1. Where is the location of your server? (i.e. City, or In/Out China)
    North America

  2. Which cloud platform(AliYun/Qcloud/DigitalOcean/etc) are you using?
    AWS

Run npm run doctor or wechaty run doctor(for docker user), paste output here

[email protected] doctor /wechaty
npm run check-node-version && ts-node bin/doctor

[email protected] check-node-version /wechaty
check-node-version --node ">= 8.5"

Wechaty Doctor

  1. Wechaty version: #git[32b624e]
  2. Linux x64 version 4.4.0-1054-aws memory 963/7478 MB
  3. Docker: true
  4. Node version: v9.11.1
  5. Tcp IPC TEST: PASS

Expected behavior

Add configurable element to Wechaty.instance({}) to control the default init behaviour:

  1. autoAogin (fires the login event and ask user to confirm login on his/her phone)
  2. switchAccount (fires scan event and ask user to scan the QR code)

Actual behavior

puppet always calls clickSwitchAccount() per implementation on issue #636

Steps to reproduce the behavior (and fixes, if any)


@zixia correct!

Similar to some other web-wechat based projects, make the init behaviour configuration with a default value. if we set "autoLogin", then the puppet init will try to find the "log in" button to click; otherwise, the puppet init will try to find the "switch account" button to click (current behaviour)

The reason is that our client would like to have the ability to re-login to his/her previous wechaty instance without having to scan the QR, under the circumstances that the instance was kicked out by other web/mac/pc login.

thanks!


use 0.14 as an example, there are two approaches to pass the autoLogin option over.

  • add autoLogin as a public property in config.ts; init the value from process.env.WECHATY_AUTOLOGIN (default to false as of the current behaviour);
  • add one more option to WechatyOptions as autoLogin (besides puppet and profile as the current behaviour) and pass it to PuppetWeb constructor (besides profile as the current behaviour) in wechaty.ts;

once the autoLogin is passed over to puppet-web, the rest is the same

  • add one more option to pass into Bridge constructor as autoLogin (besides head and profile as the current behaviour) in puppet-web.ts;
  • add one more function clickLogIn(page), and the logic to clickLogin(page) or clickSwitchAccount(page) in bridge.ts;

@zixia let me know which approach you would like to take. thanks

当在一个群里发送逐条转发超过4张图片时,进程退出

以下例子可以重现异常。

Code:

let file = await message.toFileBox().catch (e=>{
    logger.error(e);
    return null;
});

logger.info(`[Get File] [${file.name}] message.toFileBox()`);

let base64 = await file.toBase64().catch ((e)=>{
    logger.info(`[ERROR] [${file.name}] file.toBase64()`);
    logger.error(e);
    return "";
});

if (!fs.existsSync(`${dir_path}${file_path}${file_name}`)) {
    logger.info(`Try Save file to [${dir_path}${file_path}${file_name}]`);
    await file.toFile(`${dir_path}${file_path}${file_name}`,true).catch ((e)=>{
        logger.info(`Save File Fail: ${dir_path}${file_path}${file_name}`);
        logger.error(e);
        file_path="";
    });
    logger.info(`File Saved to ${dir_path}${file_path}${file_name}`);
} else {
    logger.info(`File exist ${dir_path}${file_path}${file_name}`);
}

Logs

2019-01-28 19:10:44.373 [Get File] [4953615700276791816.jpg] message.toFileBox()
2019-01-28 19:10:44.377 [Get File] [6887988699651279779.jpg] message.toFileBox()
2019-01-28 19:10:44.382 [Get File] [2442350745976153281.jpg] message.toFileBox()
2019-01-28 19:10:44.384 [Get File] [4391266251532604927.jpg] message.toFileBox()

2019-01-28 19:10:45.412 Try Save file to [/Users/meizu_t122/projects/robot/assets/image/2019-01-28/be28053b538947ecf35947efa9e6d9e3.jpg]
2019-01-28 19:10:46.487 Try Save file to [/Users/meizu_t122/projects/robot/assets/image/2019-01-28/f67d7532a21ee32a4bf9243f9aed6a2e.jpg]
2019-01-28 19:10:47.378 Try Save file to [/Users/meizu_t122/projects/robot/assets/image/2019-01-28/660a7707996b3bc28bf8796e67d1f440.jpg]
2019-01-28 19:10:48.634 File exist /Users/meizu_t122/projects/robot/assets/image/2019-01-28/d7ebd959481fa5454ddde751275d0a34.jpg


Error: read ECONNRESET
    at TCP.onStreamRead (internal/stream_base_commons.js:111:27)
  onFatalError.defaultOnFatalError	
  (anonymous function)	
  (anonymous function)	
  ontimeout	
  tryOnTimeout	
  listOnTimeout	
  processTimers	
2019-01-28 19:10:48.676 PID:4922 node 1 exit!

Sending pdf fille will get error

Moved from wechaty/wechaty#985 author: @lijiarui

The latest wechaty npm version will catch error when anyone send a pdf file.

wechaty version: 0.13.32

log as follows

Full Output Logs

08:22:11 ERR PuppetWebEvent onMessage() exception: Error: no MMAppMsgDownloadUrl
    at MediaMessage.<anonymous> (/home/ubuntu/workspace/node_modules/wechaty/src/message.ts:736:23)
    at next (native)
    at fulfilled (/home/ubuntu/workspace/node_modules/wechaty/dist/src/message.js:4:58)
    at process._tickDomainCallback (internal/process/next_tick.js:135:7)
(node:55851) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: no MMAppMsgDownloadUrl

An in-range update of rx-queue is breaking the build 🚨

The dependency rx-queue was updated from 0.4.28 to 0.4.30.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

rx-queue is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).
  • Travis CI - Branch: The build failed.

Commits

The new version differs by 8 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

ERR PuppetPuppeteer initScanWatchdog() on(reset) recover FAIL: Error: Error: Navigation failed because browser has disco nnected!

I got the following error after running few days.

06:53:29 WARN PuppetPuppeteer initScanWatchdog() on(reset) lastFood: https://login.weixin.qq.com/l/wao-9aYzOw==, timePast: 120000
06:54:00 ERR PuppetPuppeteer initScanWatchdog() on(reset) exception: TimeoutError: Navigation Timeout Exceeded: 30000ms exceeded
06:54:00 ERR PuppetPuppeteer initScanWatchdog() on(reset) try to recover by bridge.{quit,init}()
06:54:18 ERR PuppetPuppeteerBridge start() exception: Error: Navigation failed because browser has disconnected!
06:54:18 ERR PuppetPuppeteerBridge start() exception Error: Navigation failed because browser has disconnected!, close page/browser exception Error: Protocol error: Connection closed. Most likely the page has been closed. 
06:54:18 ERR PuppetPuppeteer initScanWatchdog() on(reset) recover FAIL: Error: Error: Navigation failed because browser has disconnected!
(node:25550) UnhandledPromiseRejectionWarning: Error: Error: Error: Navigation failed because browser has disconnected!
    at PuppetPuppeteer.puppet.on.error (/root/wechatbot/node_modules/wechaty/src/wechaty.ts:600:32)
    at emitOne (events.js:116:13)
    at PuppetPuppeteer.emit (events.js:211:7)
    at PuppetPuppeteer.emit (/root/wechatbot/node_modules/wechaty-puppet/src/puppet.ts:298:18)
    at PuppetPuppeteer.<anonymous> (/root/wechatbot/node_modules/wechaty-puppet-puppeteer/src/puppet-puppeteer.ts:242:16)
    at Generator.throw (<anonymous>)
    at rejected (/root/wechatbot/node_modules/wechaty-puppet-puppeteer/dist/src/puppet-puppeteer.js:23:65)
    at <anonymous>
    at process._tickDomainCallback (internal/process/next_tick.js:228:7)
(node:25550) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
(node:25550) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

wechaty: ^0.22.4

I'm running in a very tight environment with a lot of tasks.

Failed to launch chrome in CentOS

When starting on the CentOS:

[root@blissCheng wechatBot]# node index.js
17:14:41 INFO Wechaty <default> start() v0.22.6 is starting...
17:14:41 INFO PuppetManager install(wechaty-puppet-puppeteer@^0.14.1) please wait ...
npm:
> [email protected] install /root/www/wechatBot/node_modules/wechaty/node_modules/puppeteer
> node install.js


npm:

npm: Chromium downloaded to /root/www/wechatBot/node_modules/wechaty/node_modules/puppeteer/.local-chromium/linux-624492

npm: npm notice created a lockfile as package-lock.json. You should commit this file.

npm: npm WARN [email protected] requires a peer of file-box@^0.8.22 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of wechaty-puppet@^0.14.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of brolog@^1.4.9 but none is installed. You must install peer dependencies yourself.


npm: + [email protected]
added 140 packages from 157 contributors and audited 292 packages in 35.364s
found 0 vulnerabilities


17:15:17 INFO PuppetManager install(wechaty-puppet-puppeteer@^0.14.1) done
17:15:19 ERR PuppetPuppeteerBridge start() exception: Error: Failed to launch chrome!
/root/www/wechatBot/node_modules/wechaty/node_modules/puppeteer/.local-chromium/linux-624492/chrome-linux/chrome: error while loading shared libraries: libXcomposite.so.1: cannot open shared object file: No such file or directory


TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md

I checked the path:

[root@blissCheng wechatBot]# cd /root/www/wechatBot/node_modules/wechaty/node_modules/puppeteer/.local-chromium/linux-624492/chrome-linux
[root@blissCheng chrome-linux]# ls
chrome                  libGLESv2.so           product_logo_48.png
chrome_100_percent.pak  locales                resources
chrome_200_percent.pak  MEIPreload             resources.pak
chrome_sandbox          nacl_helper            swiftshader
chrome-wrapper          nacl_helper_bootstrap  v8_context_snapshot.bin
icudtl.dat              nacl_helper_nonsfi     xdg-mime
libclearkeycdm.so       nacl_irt_x86_64.nexe   xdg-settings
libEGL.so               natives_blob.bin

chrome exists but not want the script expects

An in-range update of ts-node is breaking the build 🚨

Version 7.0.1 of ts-node was just published.

Branch Build failing 🚨
Dependency ts-node
Current Version 7.0.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

ts-node is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).
  • Travis CI - Branch: The build failed.

Release Notes Strip TypeScript "composite" flag

Added

  • Strip TypeScript composite flag from configuration file
Commits

The new version differs by 7 commits.

  • ad6183a 7.0.1
  • 6df09a9 Remove composite option from configuration (#657)
  • 2017b3a Ignore TypeScript error 2355 in REPL (#645)
  • 743e80f Add documentation for fixing missing types (#627)
  • 55741b6 Note defaults, ignoring node_modules, types tip
  • ff8ed42 Use argv defaults consistently
  • c692f94 Test custom typeRoots support in tsconfig.json

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of @types/puppeteer is breaking the build 🚨

The devDependency @types/puppeteer was updated from 1.6.4 to 1.8.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@types/puppeteer is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).
  • Travis CI - Branch: The build failed.

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.