You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm experiencing issues with real-time user presence updates in TDLib. Despite setting up listeners for updateUserStatus events and polling for user status every 10 seconds using methods like TdApi.GetUser, the returned status data often appears outdated.
After reviewing the TDLib source—specifically in the UserManager::on_update_user_online methods—it seems that the internal caching mechanism might be preventing fresh data from being fetched promptly.
Steps to Reproduce:
Initialize a TDLib client with a standard session and caching enabled.
Subscribe to user status updates (e.g., via updateUserStatus).
Poll for many user presence using TdApi.GetUser every 10 seconds. (some users will work some won't)
Observe that the status information (such as was_online) does not update in real-time, even when updates are expected.
Expected Behavior:
User presence updates should reflect the current online status almost immediately when the status changes on the server.
Actual Behavior:
The status information appears to be cached, and even though update events are received (as seen in the on_update_user_online function), the cached value does not refresh quickly enough, resulting in stale status data.
Questions/Request for Guidance:
Cache Invalidation: Is there a supported way to clear or bypass the TDLib cache for user status data without disconnecting or restarting the client?
Feature Request: Could a mechanism be introduced to force a refresh of cached user presence data, or allow developers to disable caching for specific API calls?
Workarounds: Are there recommended workarounds to obtain real-time presence updates given the current caching behavior?
Any insights, workarounds, or plans for addressing this behavior would be greatly appreciated. Thank you for your time and support!
The text was updated successfully, but these errors were encountered:
This is intended behavior. It is impossible to know exact status of all other Telegram users and this is never needed by real app users. The information is updated whenever needed and updates are sent after that.
While I understand that this behavior is intended, would it be possible to introduce an optional mode for applications that require more immediate presence updates? My use case depends on near real-time user status information, and I'm wondering if there are any recommended workarounds or plans for future improvements in this area.
I'm experiencing issues with real-time user presence updates in TDLib. Despite setting up listeners for updateUserStatus events and polling for user status every 10 seconds using methods like TdApi.GetUser, the returned status data often appears outdated.
After reviewing the TDLib source—specifically in the UserManager::on_update_user_online methods—it seems that the internal caching mechanism might be preventing fresh data from being fetched promptly.
Steps to Reproduce:
Initialize a TDLib client with a standard session and caching enabled.
Subscribe to user status updates (e.g., via updateUserStatus).
Poll for many user presence using TdApi.GetUser every 10 seconds. (some users will work some won't)
Observe that the status information (such as was_online) does not update in real-time, even when updates are expected.
Expected Behavior:
User presence updates should reflect the current online status almost immediately when the status changes on the server.
Actual Behavior:
The status information appears to be cached, and even though update events are received (as seen in the on_update_user_online function), the cached value does not refresh quickly enough, resulting in stale status data.
Questions/Request for Guidance:
Cache Invalidation: Is there a supported way to clear or bypass the TDLib cache for user status data without disconnecting or restarting the client?
Feature Request: Could a mechanism be introduced to force a refresh of cached user presence data, or allow developers to disable caching for specific API calls?
Workarounds: Are there recommended workarounds to obtain real-time presence updates given the current caching behavior?
Any insights, workarounds, or plans for addressing this behavior would be greatly appreciated. Thank you for your time and support!
The text was updated successfully, but these errors were encountered: