diff --git a/backend/domain/app/internal/dal/app_release_record.go b/backend/domain/app/internal/dal/app_release_record.go index 2db8c3e2ab..6f020b891c 100644 --- a/backend/domain/app/internal/dal/app_release_record.go +++ b/backend/domain/app/internal/dal/app_release_record.go @@ -72,10 +72,9 @@ func (r *APPReleaseRecordDAO) getSelected(opt *APPSelectedOption) (selected []fi } table := r.query.AppReleaseRecord + // Always include ID, it may be used as cursor in pagination loops + selected = append(selected, table.ID) - if opt.PublishRecordID { - selected = append(selected, table.ID) - } if opt.APPID { selected = append(selected, table.AppID) } diff --git a/backend/domain/plugin/internal/dal/agent_tool_draft.go b/backend/domain/plugin/internal/dal/agent_tool_draft.go index d03e571148..b2a819dc04 100644 --- a/backend/domain/plugin/internal/dal/agent_tool_draft.go +++ b/backend/domain/plugin/internal/dal/agent_tool_draft.go @@ -67,6 +67,8 @@ func (at *AgentToolDraftDAO) getSelected(opt *ToolSelectedOption) (selected []fi } table := at.query.AgentToolDraft + // Always include ID, it may be used as cursor in pagination loops + selected = append(selected, table.ID) if opt.ToolID { selected = append(selected, table.ToolID) diff --git a/backend/domain/plugin/internal/dal/plugin.go b/backend/domain/plugin/internal/dal/plugin.go index ff1222b64d..d8df052a6c 100644 --- a/backend/domain/plugin/internal/dal/plugin.go +++ b/backend/domain/plugin/internal/dal/plugin.go @@ -72,10 +72,9 @@ func (p *PluginDAO) getSelected(opt *PluginSelectedOption) (selected []field.Exp } table := p.query.Plugin + // Always include ID, it may be used as cursor in pagination loops + selected = append(selected, table.ID) - if opt.PluginID { - selected = append(selected, table.ID) - } if opt.OpenapiDoc { selected = append(selected, table.OpenapiDoc) } diff --git a/backend/domain/plugin/internal/dal/plugin_draft.go b/backend/domain/plugin/internal/dal/plugin_draft.go index 40ba82a1c1..78f816b84d 100644 --- a/backend/domain/plugin/internal/dal/plugin_draft.go +++ b/backend/domain/plugin/internal/dal/plugin_draft.go @@ -72,10 +72,9 @@ func (p *PluginDraftDAO) getSelected(opt *PluginSelectedOption) (selected []fiel } table := p.query.PluginDraft + // Always include ID, it may be used as cursor in pagination loops + selected = append(selected, table.ID) - if opt.PluginID { - selected = append(selected, table.ID) - } if opt.OpenapiDoc { selected = append(selected, table.OpenapiDoc) } diff --git a/backend/domain/plugin/internal/dal/plugin_version.go b/backend/domain/plugin/internal/dal/plugin_version.go index 89b76a1f5b..a9b0df1eda 100644 --- a/backend/domain/plugin/internal/dal/plugin_version.go +++ b/backend/domain/plugin/internal/dal/plugin_version.go @@ -71,6 +71,8 @@ func (p *PluginVersionDAO) getSelected(opt *PluginSelectedOption) (selected []fi } table := p.query.PluginVersion + // Always include ID, it may be used as cursor in pagination loops + selected = append(selected, table.ID) if opt.PluginID { selected = append(selected, table.PluginID) diff --git a/backend/domain/plugin/internal/dal/tool.go b/backend/domain/plugin/internal/dal/tool.go index 5be97f1f32..3d0eccc671 100644 --- a/backend/domain/plugin/internal/dal/tool.go +++ b/backend/domain/plugin/internal/dal/tool.go @@ -67,10 +67,9 @@ func (t *ToolDAO) getSelected(opt *ToolSelectedOption) (selected []field.Expr) { } table := t.query.Tool - - if opt.ToolID { - selected = append(selected, table.ID) - } + // Always include ID, it may be used as cursor in pagination loops + selected = append(selected, table.ID) + if opt.ActivatedStatus { selected = append(selected, table.ActivatedStatus) } diff --git a/backend/domain/plugin/internal/dal/tool_draft.go b/backend/domain/plugin/internal/dal/tool_draft.go index b7edd2f731..b2c99031dc 100644 --- a/backend/domain/plugin/internal/dal/tool_draft.go +++ b/backend/domain/plugin/internal/dal/tool_draft.go @@ -71,10 +71,9 @@ func (t *ToolDraftDAO) getSelected(opt *ToolSelectedOption) (selected []field.Ex } table := t.query.ToolDraft + // Always include ID, it may be used as cursor in pagination loops + selected = append(selected, table.ID) - if opt.ToolID { - selected = append(selected, table.ID) - } if opt.ActivatedStatus { selected = append(selected, table.ActivatedStatus) }