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

feat(sdk): Sliding sync has a timeout if all lists require a timeout #3853

Merged
merged 6 commits into from
Aug 21, 2024

Commits on Aug 19, 2024

  1. test(sdk): Rename tests.

    This patch renames tests.
    Hywan committed Aug 19, 2024
    Configuration menu
    Copy the full SHA
    1c16fdb View commit details
    Browse the repository at this point in the history
  2. feat(sdk): Implement SlidingSyncListLoadingState::is_fully_loaded.

    This patch implements and tests
    `SlidingSyncListLoadingState::is_fully_loaded` for more convenience.
    Hywan committed Aug 19, 2024
    Configuration menu
    Copy the full SHA
    464befe View commit details
    Browse the repository at this point in the history

Commits on Aug 21, 2024

  1. feat(sdk): Add SlidingSyncListRequestGenerator::is_selective.

    This patch adds a small helper:
    `SlidingSyncListRequestGenerator::is_selective`.
    Hywan committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    719d2e4 View commit details
    Browse the repository at this point in the history
  2. feat(sdk): Add SlidingSyncList::requires_timeout.

    This patchs adds the `SlidingSyncList::requires_timeout` method to know
    exactly when a list should trigger a `timeout` on the request.
    Hywan committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    b3e0bd0 View commit details
    Browse the repository at this point in the history
  3. feat(sdk): Sliding sync has a timeout if all lists require a timeout.

    This patch updates when sliding sync requests have a `timeout`.
    
    Prior to this patch, all requests had a `timeout` query, set to the
    `poll_timeout` duration value. However it means: if there is no data
    to return, wait `timeout` milliseconds for new data before returning.
    This definition is correct. Problem: if the current range of a list
    has no data, the server will wait! It means that, in a situation where
    there is no update at all, but the client is fetching all rooms batch by
    batch, it will wait `poll_timeout` for each batch!
    
    The behaviour described above is absolutely correct. Some server
    implementations are less strict though, and we didn't realise our code
    was doing that, because the server had some optimisations to ignore the
    timeout if the range wasn't covering all the rooms. Nonetheless, a new
    server implementation (namely Synapse) is strict, and it confirms we
    have a bug here.
    
    This patch then configures a `timeout` if all lists require a timeout,
    otherwise there is no `timeout`, which is equivalent to `timeout=0`.
    Hywan committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    ec62782 View commit details
    Browse the repository at this point in the history
  4. chore(sdk): Clean documentation and remove a useless pub(super).

    This patch is a small cleanup.
    Hywan committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    a84c172 View commit details
    Browse the repository at this point in the history