Skip to content

Sorting on complex fields is silently ignored #174

Description

@woksin

The source proxy generator emits sortBy helpers for every result field, including complex ones such as records, nested models and polymorphic types. In the #167 comparison fixture, these are detail and notice. The TypeScript server's compareValues (Source/Core/queries/queryRendering.ts) falls back to String(left).localeCompare(String(right)). Every object compares as "[object Object]", so the request succeeds but leaves the order unchanged. Arc for .NET has the same limitation: on an in-memory IQueryable, OrderBy over a non-comparable record throws.

Acceptance:

  • Emit sort helpers only for comparable scalar fields: string, number, boolean, Date, Guid, enum and concepts over those.
  • The server rejects a sort on a non-scalar field with a 400 validation result, rather than silently not sorting.
  • Specs cover both, using multiple distinct rows.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions