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

Can not get real-time alias when we modified contact alias in WeChat App by contact.alias(). #1964

Closed
su-chang opened this issue May 7, 2020 · 5 comments
Labels

Comments

@su-chang
Copy link
Member

su-chang commented May 7, 2020

Important:Please file the issue follow the template, or we won't help you to solve the problem.

0. Report Issue Guide

  1. Please run the following command and check whether the problem has been fixed:
rm -rf package-lock.json
rm -rf node_modules
npm install
  1. Please search in FAQ List first, and make sure your problem has not been solved before.

  2. Please search in the issue first, and make sure your problem had not been reported before

1. Versions

  • What is your wechaty version?
    Answer:0.39.26

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

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

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

  • What os are you using
    Answer:MacOS

2. Describe the bug

Give a clear and concise description of what the bug is.

Now we can get alias from payload, but if the payload is not the real-time, it will make the alias not real-time.

Due to wechaty-puppet-donut can not post real-time data when something modified, so maybe we should do some change for method alias() in Contact.

BTW, the method contactAlias(contactId) in wechaty-puppet has never been used due to we get alias from payload rather than this method.

3. To Reproduce

This part is very important: if you can not provide any reproduce steps, then the problem will be very hard to be recognized.

Steps to reproduce the behavior:

  1. run hosite for donut
  2. modified contact alias in WeChat App
  3. get contact alias in wechaty

4. Expected behavior

Give a clear and concise description of what you expected to happen.

if (typeof newAlias === 'undefined') {
  return this.payload.alias || null
}

change it to:

if (typeof newAlias === 'undefined') {
  return this.puppet.contactAlias(this.id)
}

Reasons

  1. it is not a breaking change for existed puppet neither
  2. could sync contact in base level
  3. make the puppet method contactAlias(contactId) make sense

I have test it in my local env, everything work as expected so far.

5. Actual behavior

If applicable, add screenshots to help explain your problem. But do not paste log screenshots here.
Can not get the real-time contact alias.

@huan
Copy link
Member

huan commented May 7, 2020

I believe what we should do is to set the payload dirty when the donut gets to know there are any modifications that happened on the WeChat Client.

Could the donut be able to know when there's a contact alias has been modified? If so, you can call the contactPayloadDirty(id) to make the downstream reload the data.

@huan huan added the question label May 7, 2020
@su-chang
Copy link
Member Author

su-chang commented May 7, 2020

The problem is that donut could not know when there's a contact alias has been modified.

So that why I create this issue.

@su-chang
Copy link
Member Author

su-chang commented May 9, 2020

@huan ping

@huan
Copy link
Member

huan commented May 10, 2020

I believe this problem is more complicated than you think because we should think it deeper from the perspective of the whole framework of Wechaty.

I'll take a look at it and let you know when I got any ideas.

Copy link

dosubot bot commented Nov 15, 2023

Hi, @su-chang. I'm Dosu, and I'm helping the wechaty team manage their backlog. I wanted to let you know that we are marking this issue as stale.

From what I understand, the issue is that the alias() method in Contact does not provide real-time alias information when the contact alias is modified in the WeChat app. There has been a discussion between you and maintainer huan about how to solve this issue. huan suggested setting the payload dirty when modifications are detected, but you explained that the donut cannot detect when a contact alias has been modified. huan has agreed to look into the issue further and provide updates.

Before we close this issue, we wanted to check with you if it is still relevant to the latest version of the wechaty repository. If it is, please let us know by commenting on the issue. Otherwise, feel free to close the issue yourself or it will be automatically closed in 7 days.

Thank you for your contribution to the wechaty repository!

@dosubot dosubot bot added the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Nov 15, 2023
@dosubot dosubot bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 22, 2023
@dosubot dosubot bot removed the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Nov 22, 2023
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

2 participants