• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pulibrary / tigerdata-app / e70740c6-12b7-42e6-bab1-2069172c3569

21 Nov 2025 12:38PM UTC coverage: 87.606% (-3.7%) from 91.311%
e70740c6-12b7-42e6-bab1-2069172c3569

push

circleci

web-flow
Improve logging when deleting asset.query.iterators (#2228)

When deleting an iterator we now ignore errors if the iterator is
missing. This is because Mediaflux automatically deletes iterators when
we have read all its contents which happens if the project has only a
handful of files and they are read all at once in the first iteration.
In that case we get the following error:

```
E, [2025-11-19T15:01:29.960006 #2438857] ERROR -- : [b6390527-4de0-4e5a-b5e3-f50585d45b5f]
Mediaflux error: arc.mf.server.Services$ExServiceError, call to service 'asset.query.iterator.destroy' failed:
The session does not have an iterator (id): 1
```

This is because Mediaflux automatically deletes the iterator as soon as
we read all the files from the query.

2 of 2 new or added lines in 1 file covered. (100.0%)

165 existing lines in 9 files now uncovered.

2785 of 3179 relevant lines covered (87.61%)

358.67 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

53.19
/app/controllers/requests_controller.rb
1
# frozen_string_literal: true
UNCOV
2
class RequestsController < ApplicationController
1✔
UNCOV
3
  before_action :set_breadcrumbs
1✔
4

5
  # GET /requests
UNCOV
6
  def index
1✔
7
    if current_user.eligible_sysadmin?
×
8
      add_breadcrumb("Project Requests - All")
×
9
      @draft_requests = Request.where(state: Request::DRAFT).map do |request|
×
10
        request.project_title = "no title set" if request.project_title.blank?
×
11
        request
×
UNCOV
12
      end
13
      @submitted_requests = Request.where(state: Request::SUBMITTED)
×
UNCOV
14
    else
15
      error_message = "You do not have access to this page."
×
16
      flash[:notice] = error_message
×
17
      redirect_to dashboard_path
×
UNCOV
18
    end
UNCOV
19
  end
20

UNCOV
21
  def show
1✔
22
    if current_user.developer || current_user.sysadmin || current_user.trainer
×
23
      @request_model = Request.find(params[:id])
×
24
      @request_presenter = RequestPresenter.new(@request_model)
×
25
      add_breadcrumb("New Project Request", new_project_project_info_path)
×
26
      render :show
×
UNCOV
27
    else
28
      error_message = "You do not have access to this page."
×
29
      flash[:notice] = error_message
×
30
      redirect_to dashboard_path
×
UNCOV
31
    end
UNCOV
32
  end
33

34
  # rubocop:disable Metrics/AbcSize
35
  # rubocop:disable Metrics/MethodLength
36
  # rubocop:disable Metrics/PerceivedComplexity
37
  # rubocop:disable Metrics/CyclomaticComplexity
UNCOV
38
  def approve
1✔
UNCOV
39
    if eligible_to_approve
11✔
UNCOV
40
      @request_model = Request.find(params[:id])
6✔
UNCOV
41
      if @request_model.valid_to_submit?
6✔
UNCOV
42
        project = @request_model.approve(current_user)
6✔
UNCOV
43
        @request_model.destroy!
4✔
UNCOV
44
        stub_message = "The request has been approved and this project was created in the TigerData web portal.  The request has been processed and deleted."
4✔
UNCOV
45
        TigerdataMailer.with(project_id: project.id, approver: current_user).project_creation.deliver_later
4✔
UNCOV
46
        redirect_to project_path(project.id), notice: stub_message
4✔
UNCOV
47
      else
48
        redirect_to new_project_review_and_submit_path(@request_model)
×
UNCOV
49
      end
UNCOV
50
    else
UNCOV
51
      error_message = "You do not have access to this page."
5✔
UNCOV
52
      flash[:notice] = error_message
5✔
UNCOV
53
      redirect_to dashboard_path
5✔
UNCOV
54
    end
UNCOV
55
  rescue StandardError => ex
UNCOV
56
    if ex.is_a?(Mediaflux::SessionExpired) || ex.cause.is_a?(Mediaflux::SessionExpired)
2✔
UNCOV
57
      raise
1✔
UNCOV
58
    elsif ex.is_a?(ProjectCreate::ProjectCreateError) && ex.message.include?("Session expired for token")
1✔
UNCOV
59
      raise Mediaflux::SessionExpired
1✔
UNCOV
60
    else
61
      Rails.logger.error "Error approving request #{params[:id]}. Details: #{ex.message}"
×
62
      Honeybadger.notify "Error approving request #{params[:id]}. Details: #{ex.message}"
×
63
      flash[:notice] = "Error approving request #{params[:id]}"
×
64
      redirect_to request_path(@request_model)
×
UNCOV
65
    end
UNCOV
66
  end
67
  # rubocop:enable Metrics/MethodLength
68
  # rubocop:enable Metrics/AbcSize
69
  # rubocop:enable Metrics/PerceivedComplexity
70
  # rubocop:enable Metrics/CyclomaticComplexity
71

UNCOV
72
  private
1✔
73

UNCOV
74
    def set_breadcrumbs
1✔
UNCOV
75
      add_breadcrumb("Dashboard", dashboard_path)
11✔
UNCOV
76
    end
77

UNCOV
78
    def eligible_to_approve
1✔
UNCOV
79
      current_user.sysadmin || (current_user.developer && !Rails.env.production?)
11✔
UNCOV
80
    end
UNCOV
81
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc