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

Warn reviewers if an existing redirect is present #57

Merged
merged 1 commit into from Aug 25, 2016

Conversation

kalleth
Copy link
Contributor

@kalleth kalleth commented Aug 24, 2016

Paired with @NeilvB

Trello card

screenshot 2016-08-24 16 20 23

Reviewers can inadvertently overwrite existing short URL's without realising it because there is no immediate feedback that a redirect with the same from_path already exists.

Display a warning to the reviewer if accepting the short url request will overwrite an existing, live redirect.

Rather than refactoring the data model to give the history of every short URL request, having talked to Keith this appears to resolve the immediate user need from the reviewers side.

We are running a couple of subsequent stories to warn requesters they are requesting a duplicate to further reduce risk.

Reviewers can inadvertently overwrite existing short URL's without
realising it because there is no immediate feedback that a redirect with
the same `from_path` already exists.

Display a warning to the reviewer if accepting the short url request
will overwrite an existing, live redirect.
@@ -8,6 +8,7 @@ def index
end

def show
@existing_redirect = Redirect.where(from_path: @short_url_request.from_path).first
Copy link
Contributor

@elliotcm elliotcm Aug 25, 2016

Choose a reason for hiding this comment

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

Can there be multiple existing requests? The ticket says "If there are other requests for this short URL, display a list of each request and the following associated fields:".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There can be multiple ShortUrlRequests, but there can only be a single Redirect for a given from_path -- which is created or updated when a request is accepted.

See https://github.com/alphagov/short-url-manager/blob/master/app/models/short_url_request.rb#L28-L42

Copy link
Contributor

Choose a reason for hiding this comment

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

OK. The ticket talks about "other requests" rather than "an existing redirect". Could you confirm whether this is a mistake in the ticket?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The ticket describes a scenario where multiple people have made multiple requests (plus an existing redirect already exists -- a previous request for a short url was accepted). It turns out that this scenario is very rare and the main (initial) piece of work is aimed at stopping reviewers overwriting existing redirects.

This piece of work solves that user need, with subsequent pieces of work (the next two short URL manager stories) surfacing subsequent requests to the requestor.

I should have updated the story to reflect that, I apologise.

@kalleth
Copy link
Contributor Author

kalleth commented Aug 25, 2016

@elliotcm I have replaced the trello card with a new one; https://trello.com/c/D0Ibyt84/36-show-reviewers-if-they-will-overwrite-an-existing-redirect

The ticket I previously linked described providing way more information to the requestor that we don't think is necessary following conversations we had, but we will revisit/ask for David to revisit this with Keith to find out if it's still valuable.

@elliotcm elliotcm merged commit 71786b9 into master Aug 25, 2016
@elliotcm elliotcm deleted the show-existing-when-reviewing-short-urls branch August 25, 2016 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants