aws-amplify / aws-amplify/amplify-hosting

Disconnecting a branch does not clean up notifications for it

Open
#2,213 0 comments 0 reactions 0 assignees View on GitHub
bug
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-console/blob/master/FAQ.md).
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-console/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-console/blob/master/CONTRIBUTING.md).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

### App Id

d2ibhgok7yafet

### Region

us-east-1

### Amplify Console feature

Notifications

### Describe the bug

Adding 2 new connected branches and deleting 2 old ones left us in an inconsistent state:
1. CloudWatch event rules exist for all 4 branches
2. Amplify console shows 2 old branches under "Notifications". In the edit dialog branch name appears as blank, and if I choose a new branch name, saving has no effect.

### Expected behavior

1. Deleting a connected branch in AWS Amplify console should delete a corresponding CloudWatch Events Rule.
2. AWS Amplify console should not display deleted branches anywhere.

### Reproduction steps

1. Connect a new branch (`A`), configure notifications for it
2. Connect a new branch (`B`), delete the first one (`A)`
3. Attempt to configure notifications for branch `B`

### Build Settings

_No response_

### Additional information

Connected branches in Amplify console:
![image](https://user-images.githubusercontent.com/8446128/131286320-8855b524-804a-4d7b-a92f-e42e3cb6c9ff.png)

Notifications in Amplify Console:
![image](https://user-images.githubusercontent.com/8446128/131287587-b17fb605-293e-4f7a-bf54-4b9324fd0605.png)

View in CloudWatch console - the rules marked in orange should have been deleted:
![image](https://user-images.githubusercontent.com/8446128/131286385-c902a214-4b7a-49b6-b3bc-27321601b60f.png)

Workaround:
1. Add new notification rules for the new branches using the same email. Confirm subscription.
2. Delete existing notification rules related to now-deleted branches.

This makes Amplify show correct branch names:
![image](https://user-images.githubusercontent.com/8446128/131287763-3e019afb-6cf4-44d6-8444-42d6a5c0381e.png)

However, CloudWatch Event Rules are still present for now-deleted branches.

Contributor guide

Open the contributing guide

Research direction

Reproduce the branch lifecycle in the Notifications feature: connect branches A and B, configure notifications for A, delete A, and configure notifications for B. Inspect the resulting Amplify Console notification entries and CloudWatch Event Rules; done means deleted branches no longer appear and their corresponding rules are removed.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws
Domain
cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.