Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#3830] Update request base calculated status #7378

Merged
merged 1 commit into from
Nov 20, 2023

Conversation

gbp
Copy link
Member

@gbp gbp commented Oct 21, 2022

Relevant issue(s)

Fixes #3830

What does this do?

Update request base calculated status

Why was this needed?

Once a requester has asked for a internal review their request's base status shouldn't ever be waiting_classification as this limits the possible classification statuses.

Returning internal_review allows the requester to classify the request as I'm still waiting for the internal review after they receive an acknowledgement of their review.

Implementation notes

Screenshots

Notes to reviewer

@gbp gbp force-pushed the 3830-update-status-internal-review branch from d082470 to 0a502ec Compare October 21, 2022 10:38
app/models/info_request.rb Outdated Show resolved Hide resolved
@gbp gbp requested a review from garethrees October 21, 2022 11:43
@gbp gbp marked this pull request as ready for review October 21, 2022 11:50
Copy link
Member

@garethrees garethrees left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(For future PRs), it's really helpful to add before/after screenshots to demonstrate the before/after so that it's clear that we have reproduced the problem behaviour and that the commit fixes it, and that the reviewer understands what they're looking for when assessing the fix.

Screenshot 2022-10-21 at 17 05 42


Once a requester has asked for a internal review their request's base status shouldn't ever be waiting_classification

This logic doesn't sound right. Waiting classification is where the user must update the state, which they could well be asked to do after an internal review. For example:

  1. some correspondence has happened and the user is not happy
  2. they request an internal review
  3. the authority sends an auto-acknowledgement of their correspondence

At step 3 the request would need classification. Obviously the fix has rendered the correct option, but I'm not sure I understand why.


The original issue (#3830 (comment)) noted:

I think we could resolve this by switching it to use @info_request.described_state

This implementation obviously adds the option, but would be good for this PR to note why we didn't just switch to #described_state


This returns the "internal review" variation of the form if the request has ever had an internal review requested. I think that's okay? What happens if we get a chain like:

  • normal outgoing
  • internal review
  • normal outgoing
  • normal outgoing

Should it always be treated as internal review in those later messages?

@gbp gbp closed this Oct 24, 2022
@gbp gbp reopened this Oct 24, 2022
@gbp gbp force-pushed the 3830-update-status-internal-review branch from 0a502ec to 91eeaa3 Compare October 20, 2023 15:44
@gbp
Copy link
Member Author

gbp commented Oct 20, 2023

Rebased without doing any of the changes required to move this forward.

@gbp gbp force-pushed the 3830-update-status-internal-review branch from 91eeaa3 to c7c54e5 Compare October 27, 2023 15:41
@gbp
Copy link
Member Author

gbp commented Oct 27, 2023

Once a requester has asked for a internal review their request's base status shouldn't ever be waiting_classification

This logic doesn't sound right. Waiting classification is where the user must update the state, which they could well be asked to do after an internal review.

It's been awhile but I think what I was getting on here was the internal_review state is equivalent to waiting_classification once a review has been requested, but yes, I agree that sounds wrong.

Looking back on it now, it seems like I was thinking this because it was an easy way to get the correct options displayed on the describe state form. I probably was thinking short of adding new states (like internal_review_waiting_classification/internal_review_done) there is no real way to track if an internal review had been request or completed.

@gbp
Copy link
Member Author

gbp commented Oct 27, 2023

The original issue (#3830 (comment)) noted:

I think we could resolve this by switching it to use @info_request.described_state

This implementation obviously adds the option, but would be good for this PR to note why we didn't just switch to #described_state

I have looked at this method but using it causes other issues, for example the overdue and very overdue phases aren't returned any more. There is extra logic in calculate_status to handle these states. I'm happy that sticking with calculate_status is the easier option.

@gbp
Copy link
Member Author

gbp commented Oct 27, 2023

This returns the "internal review" variation of the form if the request has ever had an internal review requested. I think that's okay? ...

There is a way we can still have both variations of the form. I have pushed a fixup which reverts the changes to calculate_status, instead now using the internal_review_requested? conditional in the state calculator to show the internal_review option (but bumped to the top of the list to be more prominent), we already show this option on the main (non-internal review variation) form if the user has selected 'Update the status of this request' from the action popup. I think this is all that is needed to fixed this issue/PR.

There are really 4 variations; screenshots of each are below:
7378-1-request-response
7378-2-request-manual
7378-3-ir-response
7378-4-ir-manual

@gbp gbp requested a review from garethrees October 27, 2023 16:02
@gbp gbp assigned garethrees and unassigned gbp Nov 10, 2023
Copy link
Member

@garethrees garethrees left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice – seems to look good! 🙏

Once a requester has asked for a internal review their request's base
status shouldn't ever be `waiting_classification` as this limits the
possible classification statuses.

Returning `internal_review` allows the requester to classify the request
as `I'm still waiting for the internal review` after they receive an
acknowledgement of their review.

Fixes #3830
@gbp gbp force-pushed the 3830-update-status-internal-review branch from dbaebae to 08d04f0 Compare November 20, 2023 10:20
@gbp gbp merged commit 008009b into develop Nov 20, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants