Skip to content

Return host-relative nextLink for legacy Datasync v6 clients - #630

Closed
jay23606 wants to merge 1 commit into
CommunityToolkit:mainfrom
jay23606:pr-go/629-support-legacy-datasync-zumo-v6-clients-
Closed

jay23606 wants to merge 1 commit into
CommunityToolkit:mainfrom
jay23606:pr-go/629-support-legacy-datasync-zumo-v6-clients-

Conversation

@jay23606

Copy link
Copy Markdown

Problem

TableController<TEntity>.QueryAsync returns PagedResult.NextLink as a query string only (for example $skip=50&$top=50). Datasync v6 clients and earlier resolve nextLink against the host root and send X-ZUMO-OPTIONS: nextLink=path to say so. With a query-only nextLink, those clients request the wrong URL, so paging fails once a result set exceeds PageSize.

Change

  • Add IsLegacyClient(HttpRequest), which returns true when the X-ZUMO-OPTIONS header contains nextLink=path (case-insensitive).
  • QueryAsync computes this once and passes it to BuildPagedResult, which passes it to CreateNextLink.
  • For legacy clients, CreateNextLink returns the host-relative path with no leading slash, followed by the query string, for example tables/<table>?$skip=50&$top=50. Other clients keep the query-only format.

Testing

  • dotnet test tests/CommunityToolkit.Datasync.Server.Test --filter "FullyQualifiedName~Query_LegacyClient_NextLinkIsRelativePath" passes on the fix. On the base source, with the same test file, it fails with Assert.StartsWith() Failure.
  • dotnet test tests/CommunityToolkit.Datasync.Server.Test --filter "FullyQualifiedName!~Live" passes: 561 of 561.
  • The unfiltered dotnet test tests/CommunityToolkit.Datasync.Server.Test exits with code 2. The live PostgreSQL tests fail with DockerUnavailableException because Docker is not running here. Those tests are not exercised by this change. CI needs to confirm the full suite.

Regression test: fails on base twice (/Assert.StartsWith() Failure/), passes on fix twice (dotnet test tests/CommunityToolkit.Datasync.Server.Test --filter "FullyQualifiedName~Query_LegacyClient_NextLinkIsRelativePath")

Fixes #629

@adrianhall

Copy link
Copy Markdown
Collaborator

This is not going to be accepted because legacy clients are not supported.

@adrianhall adrianhall closed this Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support legacy (Datasync/Zumo ≤ v6) clients that expect a relative nextLink

2 participants