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:
Observed behaviour
Requesting:
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:
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.0riverqueue.com/riverpro: v0.26.0riverqueue.com/riverpro/driver/riverpropgxv5: v0.26.0github.com/riverqueue/river: v0.41.0Configuration
The workflow tables exist under the configured schema, including:
Observed behaviour
Requesting:
returns:
The schema capability check succeeds because
requireWorkflowQueriescallsHasWorkflowV2Tableswitha.Client.Schema().The subsequent workflow list calls omit the schema:
The same omission exists for
WorkflowListInactiveandWorkflowListAll.riverpropgxv5receives an emptyWorkflowListParams.Schema, so its generated query references unqualified tables such asriver_workflow.Expected behaviour
The workflow list endpoint should query the schema configured on the River client.
For example, each call could include:
Suggested regression test
Exercise a successful workflow list request with River installed in a non-default schema.
The current test for
NewWorkflowListEndpointcovers 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: