Sync returns immediately with empty timeline #425

Open
opened 2024-03-01 08:24:34 +00:00 by kkyriakis · 2 comments
kkyriakis commented 2024-03-01 08:24:34 +00:00 (Migrated from gitlab.com)

Description

I am using GET /_matrix/client/v3/sync to sync filtered by a certain user and using since to fetch latest state. I also set timeout to 30 seconds and repeat after it expires.
Example /_matrix/client/v3/sync?filter=sofW&since=425298&timeout=30000

When a message event is actually sent to an encrypted room where user is member of, instead of this message event being delivered with the current open sync GET request, it immediately returns with an empty timeline

{
    "next_batch": "425298",
    "device_one_time_keys_count": {
        "signed_curve25519": 50
    },
    "device_unused_fallback_key_types": null
}

and I have to repeat the exact same sync request to get the new timeline.
I checked documentation and I made an assumption that the full_state is maybe not respected cause of this:

If this is set to true, then all state events will be returned, even if since is non-empty. The timeline will still be limited by the since parameter. In this case, the timeout parameter will be ignored and the query will return immediately, possibly with an empty timeline.

and therefore I tried to explicitly set it to false (full_state=false) but no difference.

Is there a reason for that? To me it seems more like a bug rather than intended behavior.

System Configuration

Version: v0.6.0

Conduit Version:
Database backend (default is sqlite): sqlite

### Description I am using GET [/_matrix/client/v3/sync ](/_matrix/client/v3/sync) to sync filtered by a certain user and using `since` to fetch latest state. I also set timeout to 30 seconds and repeat after it expires. Example `/_matrix/client/v3/sync?filter=sofW&since=425298&timeout=30000` When a message event is actually sent to an encrypted room where user is member of, instead of this message event being delivered with the current open sync GET request, it immediately returns with an empty timeline ```json { "next_batch": "425298", "device_one_time_keys_count": { "signed_curve25519": 50 }, "device_unused_fallback_key_types": null } ``` and I have to repeat the exact same sync request to get the new timeline. I checked documentation and I made an assumption that the `full_state` is maybe not respected cause of this: > If this is set to true, then all state events will be returned, even if since is non-empty. The timeline will still be limited by the since parameter. In this case, the timeout parameter will be ignored and the query will return immediately, possibly with an empty timeline. and therefore I tried to explicitly set it to false (`full_state=false`) but no difference. Is there a reason for that? To me it seems more like a bug rather than intended behavior. ### System Configuration Version: v0.6.0 Conduit Version: Database backend (default is sqlite): sqlite
timokoesters commented 2024-03-01 09:55:51 +00:00 (Migrated from gitlab.com)

it immediately returns with an empty timeline

and I have to repeat the exact same sync request to get the new timeline

Yes I am aware of this /sync behavior. It is a bit weird and slightly less efficient and we should improve it in the future. Is it a problem for you in practice?

> it immediately returns with an empty timeline > and I have to repeat the exact same sync request to get the new timeline Yes I am aware of this /sync behavior. It is a bit weird and slightly less efficient and we should improve it in the future. Is it a problem for you in practice?
kkyriakis commented 2024-03-01 10:00:59 +00:00 (Migrated from gitlab.com)

thank you Timo for the quick response. It has a latency impact and since we are trying to achieve max performance and min latency (we are considering using the messenger as means of exchanging messages in an automated way also between machines), it adds an overhead.
I would try to fork and figure it out but I have 0 rust knowledge :P
Do you maybe have an estimate?

thank you Timo for the quick response. It has a latency impact and since we are trying to achieve max performance and min latency (we are considering using the messenger as means of exchanging messages in an automated way also between machines), it adds an overhead. I would try to fork and figure it out but I have 0 rust knowledge :P Do you maybe have an estimate?
goldhamster2 added a new dependency 2024-03-08 01:11:19 +00:00
goldhamster2 removed a dependency 2024-03-08 01:24:30 +00:00
Sign in to join this conversation.
No labels
Android
CS::needs customer feedback
CS::needs follow up
CS::needs on prem installation
CS::waiting
Chrome
Design:: Ready
Design:: in progress
Design::UX
E2EE
Edge
Firefox
GDPR
Iteration 13 IM
Linux
MacOS
Need::Discussion
Need::Steps to reproduce
Need::Upstream fix
Needs:: Planning
Needs::Dev-Team
Needs::More information
Needs::Priority
Needs::Product
Needs::Refinement
Needs::Severity
Priority::1-Critical
Priority::2-Max
Priority::3-Impending
Priority::4-High
Priority::5-Medium
Priority::6-Low
Priority::7-None
Progress::Backlog
Progress::Review
Progress::Started
Progress::Testing
Progress::Triage
Progress::Waiting
Reporter::Sentry
Safari
Target::Community
Target::Customer
Target::Internal
Target::PoC
Target::Security
Team:Customer-Success
Team:Design
Team:Infrastructure
Team:Instant-Messaging
Team:Product
Team:Workflows
Type::Bug
Type::Design
Type::Documentation
Type::Feature
Type::Improvement
Type::Support
Type::Tests
Windows
blocked
blocked-by-spec
cla-signed
conduit
contribution::advanced
contribution::easy
contribution::help needed
from::review
iOS
p::ti-tenant
performance
product::triage
proposal
refactor
release-blocker
s: dart_openapi_codegen
s::Famedly-Patient
s::Org-Directory
s::Passport-Generator
s::Requeuest
s:CRM
s:Famedly-App
s:Famedly-Web
s:Fhiroxide
s:Fhiroxide-cli
s:Fhiroxide-client
s:Fhirs
s:Hedwig
s:LISA
s:Matrix-Dart-SDK
s:Role-Manager
s:Synapse
s:User-Directory
s:WFS-Matrix
s:Workflow Engine
s:dtls
s:famedly-error
s:fcm-shared-isolate
s:matrix-api-lite
s:multiple-tab-detector
s:native-imaging
severity::1
severity::2
severity::3
severity::4
technical-debt
voip
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Matthias/conduit#425
No description provided.