-
Notifications
You must be signed in to change notification settings - Fork 49
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
Discussion: do we need a new event when sync contacts done #7
Comments
I would like to think about your proposal after the publish of Wechaty v0.18 because currently, we have too many more important BUGS to fire. Before that, I believe you can solve this problem by mocking the Sync Data. |
Okay, I got that. Mocking SyncData is not hard, the hard thing is I need to find a way to detect when the sync data finished. I will try to find a way or get a work around. But please leave this issue open, so we can discuss this after the publish of v0.18 :) |
I would like to re-active this discussion thread since we are receiving developers asking for right way to get the room members. Refer here I think if we have an event telling the developers that the Currently their alternative way of getting the whole room information is that they do @zixia If you agree with this idea, I would send out PR later. |
Understand. I think you can send a workable PR to demonstrate your implementation, then we could be able to discuss base on that. |
Hey @zixia , here is the c9 link: https://ide.c9.io/lijiarui/sync-done-event-test Please take a look and let me know what do you think. |
Ok, I will go to have a look. But I need you to send the PR for the related source code before I can involve. |
Could you please add me as collaborator of |
Sorry, I'm afraid that I can not add you for now because all the repo is in DevOps mode and it will be very dangerous if we made any mistake. So I'm sorry that you have to use the standard fork/pr for our collaboration, and you need not worry about me: I can edit based on your code at any time after you sent PR. |
I'm thinking about the event name. It is very important because your PR will introduce a new I do not satisfy with However, the name Do you have any better idea about the event name? |
I agree with you about the event name. I am also not satisfied with the Originally I was thinking about |
How do you feel about |
As you said, I also think it is too general. If What do you think about |
* update padchat version * 0.17.119 * prototype for room-invite event * Revert "prototype for room-invite event" This reverts commit 33c4321. * add data-ready event * add `ready` event and ready() method (wechaty/puppet#7) * make lint happy * 0.19.113
I decide to use
The
Usage1. @event
|
That is to say, it is encouraged to do chaining when creating bot with bot
.on('ready', () => console.log('wechaty is ready')
.start() The |
Correct. |
Okay, got it, thanks for make this implemented such soon. 👍 |
* update padchat version * 0.17.119 * prototype for room-invite event * Revert "prototype for room-invite event" This reverts commit 33c4321. * add data-ready event * add `ready` event and ready() method (wechaty/puppet#7) * make lint happy * 0.19.113 * add method on contact-self to update name and signature * change log and add comments for new method * code clean * 0.19.125
I would like to discuss whether we need a new event, emitted when we sync all the contacts after login.
I encountered this problem when I was trying to write the integration tests. I want to do my tests after the contacts are all loaded, but found it is pretty hard to get to that point. I can write tests in
login
event, but during that time, the contacts are not loaded.Reason I think we should have this event:
Give the devs an entry point when the contacts are all fully loaded, otherwise, if the developer try to find a contact, but the contact is not fully loaded, and the
contactList
is from our cache, so the returned contacts collection to be searched is not in ready state. Then the searchContact will fail.@zixia
The text was updated successfully, but these errors were encountered: