Skip to content

Update alert_contact.go to perform client-side filtering#8

Open
micahjsmith wants to merge 1 commit into
mindee:masterfrom
micahjsmith:patch-1
Open

Update alert_contact.go to perform client-side filtering#8
micahjsmith wants to merge 1 commit into
mindee:masterfrom
micahjsmith:patch-1

Conversation

@micahjsmith

Copy link
Copy Markdown

This is a workaround for the bug identified in #6

The getAlertContacts method on UptimeRobot public API has a bug and does not properly support filtering by alert contact id. However, we can easily implement this ourselves by filtering for the alert contact id from the response containing all the ids. https://uptimerobot.com/api/#getAlertContactsWrap

I will note that the code as written does not correctly handle the case where the user has more than 50 alert contacts since the API is paginated. I am not a go expert so would welcome feedback on whether addressing this limitation is in scope for this PR. For example, we could paginate over all the pages of alert contact responses and check if the desired id is present, failing only after the last page.

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.

1 participant