Cannot identify ['] in room topic
Created by: lijiarui
npm run doctor
or wechaty run doctor
(for docker user), paste output here
Run Starting Wechaty ... v0.6.22
> wechaty@0.6.22 doctor /wechaty
> ts-node bin/doctor
SILL Brolog WECHATY_LOG set level to SILLY
SILL StateMonitor constructor(Wechaty, standby)
VERB Wechaty contructor()
SILL Wechaty version() test Error: spawnSync git ENOENT
#### Wechaty Doctor
1. Wechaty version: 0.6.22
2. Linux x64 version 3.16.0-4-amd64 memory 244/2010 MB
3. Docker: true
4. Node version: v7.2.0
Expected behavior
try to invite contact to room when room topic contains "'" but failed.
Log says WARN PuppetWeb roomFind(c => c === 'Wechaty Developers' Home') rejected: unknown error: Unexpected identifier
I thought it begin to find Wechaty Developers not Wechaty Developers' Home due to "'"
Steps to reproduce the behavior (and fixes, if any)
code as follows:
import {
Wechaty
, Room
} from 'wechaty'
const bot = Wechaty.instance()
bot
.on('scan', (url, code) => {
console.log(`${url}\n[${code}] Scan QR Code in above url to login: `)
})
.on('login',user => {
console.log(`${user}login`)
})
.on('message',async function(m){
const content = m.content()
const contact = m.from()
if(/wechaty/.test(content)){
let weRoom = await Room.find({topic:"Wechaty Developers' Home"})
if(weRoom){
weRoom.add(contact)
contact.say('Welcome')
}
}
})
.init()
WECHATY_LOG=silly
set
Paste the full output logs here with SILL Message constructor() SN:5
SILL Message ready()
SILL Contact constructor(@657d1f0799287f91cb46e7eef77757d2c8f4dcca4ab5e6522dd3c457ebaf9f5d)
SILL Contact ready()
SILL Contact get contact via PuppetWeb
SILL PuppetWebBridge getContact() retryPromise: attampt 1/35 time for timeout 306250
VERB PuppetWebBridge proxyWechaty(getContact, @657d1f0799287f91cb46e7eef77757d2c8f4dcca4ab5e6522dd3c457ebaf9f5d)
SILL PuppetWebBridge execute()
SILL PuppetWebBrowser Browser.execute("return typeof WechatyBro === "undefined"")
SILL StateMonitor Browser:target() open
SILL StateMonitor Browser:current() open
SILL PuppetWebBridge execute()
SILL PuppetWebBrowser Browser.execute(" const callback = arguments[arguments.length - 1] const isAsync = (typeof ... ")
SILL StateMonitor Browser:target() open
SILL StateMonitor Browser:current() open
SILL Contact contactGetter(@657d1f0799287f91cb46e7eef77757d2c8f4dcca4ab5e6522dd3c457ebaf9f5d) resolved
SILL Contact ready()
SILL Message ready()
SILL Contact ready()
SILL Contact ready()
VERB Room find({ topic: Wechaty Developers' Home })
VERB Room findAll({ topic: Wechaty Developers' Home })
VERB PuppetWebBridge proxyWechaty(roomFind, c => c === 'Wechaty Developers' Home')
SILL PuppetWebBridge execute()
SILL PuppetWebBrowser Browser.execute("return typeof WechatyBro === "undefined"")
SILL StateMonitor Browser:target() open
SILL StateMonitor Browser:current() open
SILL PuppetWebBridge execute()
SILL PuppetWebBrowser Browser.execute(" const callback = arguments[arguments.length - 1] const isAsync = (typeof ... ")
SILL StateMonitor Browser:target() open
SILL StateMonitor Browser:current() open
SILL PuppetWebBrowser execute() script: const callback = arguments[arguments.length - 1]
const isAsync = (typeof callback === 'function')
return WechatyBro
.roomFind
.apply(undefined
, isAsync
? JSON.parse(decodeURIComponent(window.atob('JTVCJTIyYyUyMCUzRCUzRSUyMGMlMjAlM0QlM0QlM0QlMjAnV2VjaGF0eSUyMERldmVsb3BlcnMnJTIwSG9tZSclMjIlNUQ='))).concat(callback)
: JSON.parse(decodeURIComponent(window.atob('JTVCJTIyYyUyMCUzRCUzRSUyMGMlMjAlM0QlM0QlM0QlMjAnV2VjaGF0eSUyMERldmVsb3BlcnMnJTIwSG9tZSclMjIlNUQ=')))
)
WARN PuppetWebBrowser execute() exception: unknown error: Unexpected identifier
(Session info: chrome=53.0.2785.92)
(Driver info: chromedr, WebDriverError: unknown error: Unexpected identifier
(Session info: chrome=53.0.2785.92)
(Driver info: chromedriver=2.22 (5e2d5494d735a71aa5c2e7ef9bf5ce96945e92e9),platform=Linux 3.16.0-4-amd64 x86_64)
at Object.checkLegacyResponse (/wechaty/node_modules/selenium-webdriver/lib/error.js:505:15)
at parseHttpResponse (/wechaty/node_modules/selenium-webdriver/lib/http.js:509:13)
at doSend.then.response (/wechaty/node_modules/selenium-webdriver/lib/http.js:440:13)
at process._tickDomainCallback (internal/process/next_tick.js:129:7)
WARN PuppetWebBridge execute() exception: unknown error: Unexpected identifier
(Session info: chrome=53.0.2785.92)
(Driver info: chromedriver=2.22 (5e2d5494d735a71aa5c2e7ef9bf5ce96945e92e9),platform=Linux 3.16.0-4-amd64 x86_64)
VERB PuppetWebBridge proxyWechaty(roomFind, c => c === 'Wechaty Developers' Home')
WARN PuppetWebBridge proxyWechaty() exception: unknown error: Unexpected identifier
(Session info: chrome=53.0.2785.92)
(Driver info: chromedriver=2.22 (5e2d5494d735a71aa5c2e7ef9bf5ce96945e92e9),platform=Linux 3.16.0-4-amd64 x86_64)
ERR PuppetWebBridge roomFind() exception: unknown error: Unexpected identifier
(Session info: chrome=53.0.2785.92)
(Driver info: chromedriver=2.22 (5e2d5494d735a71aa5c2e7ef9bf5ce96945e92e9),platform=Linux 3.16.0-4-amd64 x86_64)
WARN PuppetWeb roomFind(c => c === 'Wechaty Developers' Home') rejected: unknown error: Unexpected identifier
(Session info: chrome=53.0.2785.92)
(Driver info: chromedriver=2.22 (5e2d5494d735a71aa5c2e7ef9bf5ce96945e92e9),platform=Linux 3.16.0-4-amd64 x86_64)
VERB Room findAll() rejected: unknown error: Unexpected identifier
(Session info: chrome=53.0.2785.92)
(Driver info: chromedriver=2.22 (5e2d5494d735a71aa5c2e7ef9bf5ce96945e92e9),platform=Linux 3.16.0-4-amd64 x86_64)
(node:22) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: no room found
(node:22) 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.