Project

General

Profile

Patch #40775 ยป optimize-retrieve_default_query.patch

Go MAEDA, 2024-06-02 09:25

View differences:

app/controllers/issues_controller.rb
502 502
      return
503 503
    end
504 504
    if !params[:set_filter] && use_session && session[:issue_query]
505
      # Don't apply the default query if a valid query id is set in the session
505 506
      query_id, project_id = session[:issue_query].values_at(:id, :project_id)
506
      return if IssueQuery.where(id: query_id).exists? && project_id == @project&.id
507
      return if query_id && project_id == @project&.id && IssueQuery.exists?(id: query_id)
507 508
    end
508 509
    if default_query = IssueQuery.default(project: @project)
509 510
      params[:query_id] = default_query.id
    (1-1/1)