Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

checkRoomJoin() cannot get inviteeList sometimes #248

Closed
lijiarui opened this issue Feb 13, 2017 · 4 comments
Closed

checkRoomJoin() cannot get inviteeList sometimes #248

lijiarui opened this issue Feb 13, 2017 · 4 comments
Labels

Comments

@lijiarui
Copy link
Member

lijiarui commented Feb 13, 2017

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

> [email protected] doctor /Users/lijiarui/Documents/git/wechaty
> npm run check-node-version && ts-node bin/doctor


> [email protected] check-node-version /Users/lijiarui/Documents/git/wechaty
> check-node-version --node ">= 6.9"

node: v7.0.0
npm: v4.0.5

  #### Wechaty Doctor

  1. Wechaty version: #git[7faecd6 0.7.32]
  2. Darwin x64 version 14.5.0 memory 831/16384 MB
  3. Docker: false
  4. Node version: v7.0.0
  5. Tcp IPC TEST: PASS

Expected behavior

emit room-join event when someone joins the room

Actual behavior

Sometimes, when someone joins the room, we cannot emit room-join event.

Paste the full output logs here with WECHATY_LOG=silly set

SILL Room member({ name: ffc94c25-eda9-91fa-9d80-558d101bd88e })
SILL Room member() check ffc94c25-eda9-91fa-9d80-558d101bd88e from nameMap: {"@e479472340ee83f01aa28c6ce787e8306cb283e14aa0c78aca54a7206b7769bb":"琦琦","@74fc244e14625a45d8f3cd1801e97fe9":"f9a5bf05-871b-6462-22f1-02a93743c975","@819ba74d359cb71202d8ada32f12042f":"9bd02793-1142-e4c5-86f6-2242fc7927ab"}
...
SILL PuppetWebFirer fireRoomJoin() reject() inviteeContactList: , inviterContact: 你

The log showed nameMap isn't updated with the newcomer(ffc94c25-eda9-91fa-9d80-558d101bd88e) of the room when room-joined event failed to emitted.

Trying to find the reason...

First, I suggest changing

catch(e => {
      log.silly('PuppetWebFirer', 'fireRoomJoin() reject() inviteeContactList: %s, inviterContact: %s'
                            , inviteeContactList.map((c: Contact) => c.name()).join(',')
                            , inviter
      )

to log.warn() when await retryPromise({ max: max, backoff: backoff }, async (attempt: number) => { catch exception.

@huan huan added the bug label Feb 13, 2017
@d2cs
Copy link

d2cs commented Jun 8, 2017

same at my wechaty.. any workaround yet?

@huan
Copy link
Member

huan commented Aug 18, 2017

When someone is invited to the group, we can see the invitation message first, which could trigger our room-join event.

However, the rawObj of that contact will come later, means that we might can not get the rawObj when we fire the event.

To fix this, we can check the rawObj before fire the event. if there's no rawObj yet, we hold the event and check it later(like after 10 seconds)

@lijiarui
Copy link
Member Author

lijiarui commented Aug 18, 2017

This is because when someone joins the room by scanning QR code, it will add a blank by wechat.

I have fix this bug on #651

When someone is invited to the group, it seldom happened, 90% can detect.

@huan
Copy link
Member

huan commented Aug 18, 2017

Great to hear that problem had already been fixed.

It would be more professional if you could close the related issue right after you fixed it.

Anyway, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants