Actor reminders should return null if not registered #1468
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Actor reminders should return null if they aren't registered and should return a
ReminderInfoif they are registered. According to the API documentation, this is distinguished by the status code returned:The original implementation of this never read the status code and instead started with a
ReminderInfopopulated with default values for each property and attempted to deserialize each property and update the value if available in the returned body. As a result, this means that the response would never be null and if not registered, the only way to determine this was to do a default check against each of the properties.This PR changes this - if the status code is 500, this will return a null value. If the status code is 200, it will perform the
ReminderInfodeserialization as it did before.There were no unit tests validating this behavior, so I've also gone through and added several.
Issue reference
We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.
Please reference the issue this PR will close: #1466
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: