Skip to content

Workbench can crash with "At least one object must implement IComparable" while a sorted table refreshes #47

Description

@woksin

Describe the bug

The workbench crashed once with At least one object must implement IComparable. and exited to the shell. It has not reproduced since, so this is filed to keep it from being lost rather than as a confirmed repro.

Steps to reproduce

Not reliably reproducible. Observed once under these conditions:

  1. cratis chronicle workbench against a store where a client was actively appending events.
  2. The workbench was launched with a restored LastNavIndex pointing at a table view (Failures).
  3. Data changed underneath the view while it was sorted.

Roughly a dozen subsequent launches under similar conditions did not reproduce it.

Expected behavior

A refresh that arrives while a table is sorted re-sorts the rows.

Actual behavior

The workbench terminated and printed:

╭─Error────────────────────────────────────────╮
│ At least one object must implement IComparable. │
╰──────────────────────────────────────────────╯

Environment

  • OS: macOS 15 (arm64)
  • .NET version: 10.0.x
  • Chronicle version: server 16.7.0, CLI built from main

Additional context

The message is what Comparer<object>.Default throws when asked to order a type that does not implement IComparable — so the likely path is a column comparer falling back to the default comparer on a value it cannot order.

Worth looking at:

  • FilterableTableView.GetColumnComparer — the base implementation stringifies through BuildRow and is safe, but a view overriding it could return values that are not comparable.
  • The col.CustomRowComparer wiring around FilterableTableView.BuildContent, and TableControl.SortByColumn's own fallback when no custom comparer is set.
  • RebuildRows(), which clears and re-adds rows and then re-applies the sort — the most likely place for a refresh to race a sort.

The relevant history is in project_workbench_pitfalls.md item 3, which records that SortByColumn previously re-sorted with an OrdinalIgnoreCase fallback and was fixed by wiring typed comparers for every column. A null or non-comparable cell reaching that path would produce exactly this exception.

Metadata

Metadata

Assignees

No one assigned

    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