aws-amplify / aws-amplify/amplify-hosting

Bulk redirect editor does not save country conditions

Open
#3,203 4 comments 1 reaction 0 assignees View on GitHub
bug pending-prioritization redirects
Dominant language
Dockerfile
Stars
481
Forks
123
PR merge metrics
No merged PRs in 30d

Description

### Before opening, please confirm:

- [X] I have checked to see if my question is addressed in the [FAQ](https://github.com/aws-amplify/amplify-hosting/blob/master/FAQ.md).
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-hosting/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-hosting/blob/master/CONTRIBUTING.md).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- [X] I have removed any sensitive information from my code snippets and submission.

### App Id

dv9w89pivcsv7

### AWS Region

us-east-1

### Amplify Hosting feature

Redirects

### Describe the bug

It is not possible to save redirects that include a region condition using the bulk redirect editor. Conditions can only be added individually in the form-based editor. But even if you do add conditions manually, opening and saving the bulk editor clears conditions from *all* existing redirects.

### Expected behavior

Expect that providing properly formatted JSON for redirects that include conditions will be applied on save.

### Reproduction steps

1. Visit the Rewrites and Redirects settings, click Edit

![image](https://user-images.githubusercontent.com/160900/207712598-380f02fe-fd92-41dd-8b84-2cced32bc392.png)

3. Click "open text editor"
4. Paste redirects JSON. Example:
```json
[
{
"source": "/",
"target": "/de",
"status": "302",
"condition": ""
}
]
```

![image](https://user-images.githubusercontent.com/160900/207712734-49a28031-8ed7-42d3-a5fa-f0abcea4777c.png)

5. Click Save
6. Confirm that the saved redirect does not include the country code condition specified in the JSON

![image](https://user-images.githubusercontent.com/160900/207712939-67c905d0-5295-4ada-bb86-24bfe61faed7.png)

### Build Settings

_No response_

### Log output

```
# Put your logs below this line

```

### Additional information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start in the Rewrites and Redirects settings and reproduce the failure through the bulk text editor using the JSON example in the report. Trace how redirect conditions are parsed and saved; done means a country condition survives saving and existing conditions are not cleared.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws
Domain
cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.