psu-libraries / etda_workflow

Electronic Theses and Dissertations Application: Admin, Author, and Committee Member workflows.
MIT License
3 stars 1 forks source link

Fix approver bug #804

Closed ajkiessl closed 3 months ago

ajkiessl commented 3 months ago

This addresses a couple things.

First, I fixed our authentication to strip the format off the urls when determine the login type (Author, Admin, or Approver). If the format is sent along — like .json — it defaults to an Author login, when it could be an Approver or Admin. Ultimately, the datatables, which send a request with a .json format, shouldn't be happening before the user logs in. I still do not have a solution for this, nor do I fully understand why it's happening. However, we should at least stop getting errors from those datatable ajax calls. We can proceed from there.

Second, I received an example of a special member that was having issues and was given the committee member token for this user. Searching with this token in splunk showed that the user was getting this error:

ActionController::RoutingError (No route matches [GET] "/special_committee/{token}/advance_to_reviews"):

For some reason this does not register as a 500 error, so it was not showing up in our error tracking systems. There is a button on the special committee page that is supposed to send a POST to this path, but for some reason it is sending a GET for some people in prod. FWIW it sends a POST for me in dev, qa, and prod. I think there might have been a change to rails that only allows link_to to send a GET. I seem to remember this, but I may be wrong. Still not sure why it works in some places but not others. Perhaps browser differences? I changed this to a button_to which should always send a POST (since it generates a form to submit in html).

I also added a little fail-safe to the approver index that only links approvers to committee members when html is requested. That way, the linking code isn't run when the datatables load.