Propossal to use decorators as gatekeepers #455
Closed
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.
PR Details
Thank you for your contribution. Before submitting this PR, please include:
Id of the task, bug, story or other reference
Description
We allow calls even unders scenarios set to fail, like offline devices or expired tokens
we need to find a way to prevent those scenarios
Include a description of the problem to be solved
Solution Proposed
Use of decorator pattern to wrap function in a non-invasive way,
The gatekeeper will intercept the call and then evalute the condition, this can be extended to additional business rules,
only if those conditions are meet the call will be performed, otherwise we inform the caller to adjust due to the current state
Detail what is the solution proposed, include links to design document if required or any other document required to support the solution
Acceptance criteria
Define what are the conditions to consider the PR has achieved the intended goal
Test cases and evidence
offline situation midway during the conversation
loads and get messages while online
offfline is detected
online recovered
Include what tests cases were considered, any evidence of testing for future references, to identify any corner cases, etc
Sanity Tests
A11y
Please provide justification if any of the validations has been skipped.