Skip to content

River Pro UI workflow list ignores configured database schema #628

Description

@jtbeach

Description

The River Pro UI workflow list endpoint does not use the schema configured on the River client.

This causes workflow listing to fail when River tables are stored outside the default PostgreSQL search path.

Versions

  • riverqueue.com/riverui/riverproui: v0.16.0
  • riverqueue.com/riverpro: v0.26.0
  • riverqueue.com/riverpro/driver/riverpropgxv5: v0.26.0
  • github.com/riverqueue/river: v0.41.0

Configuration

client, err := riverpro.NewClient(driver, &riverpro.Config{
    Config: river.Config{
        Schema: "river",
    },
})

The workflow tables exist under the configured schema, including:

river.river_workflow

Observed behaviour

Requesting:

GET /api/pro/workflows

returns:

error listing workflows: ERROR: relation "river_workflow" does not exist (SQLSTATE 42P01)

The schema capability check succeeds because requireWorkflowQueries calls HasWorkflowV2Tables with a.Client.Schema().

The subsequent workflow list calls omit the schema:

a.DB.WorkflowListActive(ctx, &riverprodriver.WorkflowListParams{
    After:           ...,
    PaginationLimit: ...,
})

The same omission exists for WorkflowListInactive and WorkflowListAll.

riverpropgxv5 receives an empty WorkflowListParams.Schema, so its generated query references unqualified tables such as river_workflow.

Expected behaviour

The workflow list endpoint should query the schema configured on the River client.

For example, each call could include:

Schema: a.Client.Schema(),

Suggested regression test

Exercise a successful workflow list request with River installed in a non-default schema.

The current test for NewWorkflowListEndpoint covers missing workflow v2 tables, but does not appear to cover successful listing from a custom schema.

Workaround

Setting the Admin UI connection search path to include the River schema works around the issue:

search_path=river,public

Metadata

Metadata

Assignees

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