Closed vemacs closed 8 years ago
The API will lazy load all chats unless you preload them
How would I preload them?
429s whenever I try it. Why does it need to load all this data from the chats in the first place to start listening? Is all of the data strictly necessary?
The data includes users in the chat, their roles, the chat's displayname, etc. Things that you would expect to return a valid value when you request it.
If you're hitting a 429, then request a bigger amount per load. There's not much I can do against a Too Many Requests response.
Loading all of those shouldn't be necessary for simply receiving messages. The message handler would presumably load all of that data "on-demand" via method calls, Skype4j loading that isn't needed and only serves to block.
So what would happen when you get a message and try to get the user? There's no way of getting a data for a single user from a Skype conversation, and if there was you would end up hitting that 429 a lot more often as you would be overly lazy-loading data.
Oh, wasn't aware of that. How come other implementations (EzSkype) don't have as noticeable of an initialization delay?
On chat load, all the users are loaded too, which means their contact data is also loaded. This may be the delay you're experiencing. I'll add in a lazy load for contact data. See if that helps
Thanks, the change removes the initialization delay. Can the getUsername() method return the username field (and schedule the data to be loaded async or just not load the data)? I'm currently working around it with reflection.
Perfect <3
You should release 0.1.5 proper, the current "stable" 0.1.4 doesn't log in properly
When the first message is received from a chat, the API takes around 5 seconds to process it. This is not an issue with subsequent messages. Could this initialization delay be fixed? I'm assuming the API is preloading display names or something, which should be done in the subscribe() method for all chats.