Skip to content

The sender attributes of then and upon_xxx incorrectly answer queries for get_completion_scheduler and get_completion_domain #2415

Open

Description

@Cra3z

The sender attributes of then, upon_error, and upon_stopped incorrectly answer queries for get_completion_scheduler and get_completion_domain.
For example, in the current implementation, the set_value completion scheduler and completion domain of sndr | ex::upon_error([](...) noexcept { ... }) are reported as sndr's set_value completion scheduler and completion domain. However, this is incorrect; it should instead consider sndr's set_error completion scheduler and completion domain, because the receiver's set_value may complete on an execution agent of sndr's set_error completion scheduler.

Activity

  1. changed the title [-]The sender attributes of `then`, `upon_error`, and `upon_stopped` incorrectly answer queries for `get_completion_scheduler` and `get_completion_domai`n[/-] [+]The sender attributes of `then` and `upon_xxx` incorrectly answer queries for `get_completion_scheduler` and `get_completion_domain`[/+] on Nov 5, 2026
  2. Cra3z commented on Nov 6, 2026

    @Cra3z
    ContributorAuthor

    stopped_as_optional and stopped_as_error also have similar problems.

  3. Cra3z commented on Nov 6, 2026

    @Cra3z
    ContributorAuthor

    In the current implementation, the following program cannot be compiled:

    ex::run_loop loop;
    ex::prop env{
      ex::get_start_scheduler,
      loop.get_scheduler()
    };
    
    auto sndr1 = ex::just_stopped() | ex::stopped_as_error(-1);
    auto sch1 = ex::get_completion_scheduler<ex::set_error_t>(ex::get_env(sndr1), env);
    assert(sch1 == loop.get_scheduler());
    
    auto sndr2 = ex::just_error(-1) | ex::upon_error([](int i) noexcept { return i; });
    auto sch2 = ex::get_completion_scheduler<ex::set_value_t>(ex::get_env(sndr2), env);
    assert(sch2 == loop.get_scheduler());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions