-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor secondary url caching #163
Conversation
TODO:
|
…ndation/at_libraries into secondary_url_caching
} | ||
} | ||
|
||
static String stripAtSignFromAtSign(String atSign) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we had a utility method already somewhere to do this. I believe this method can be moved to a reusable place.
} | ||
|
||
static String getNotFoundExceptionMessage(String atSign) { | ||
return 'Unable to find secondary address for atSign:$atSign'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@murali-shris @kalluriramkumar We have to make the exception messages easily discoverable across the SDK. We will revisit this as part of the exception analysis task.
// .. and close the socket | ||
await socket.flush(); | ||
socket.destroy(); | ||
throw Exception('AtLookup.findSecondary timed out'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to our exception hierarchy, I recon this corresponds to TimeoutException. We will revisit this in a different PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
made the change to throw exact exceptions
|
||
void main() async { | ||
String rootDomain = 'root.atsign.unit.tests'; | ||
int rootPort = 64; | ||
SecondaryAddressFinder mockSecondaryFinder = MockSecondaryFinder(); | ||
SecondaryUrlFinder mockSecondaryFinder = MockSecondaryFinder(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very very nice to see mock in action. Abstracting out external dependency into SecondaryUrlFinder makes this possible. Good work Murali. Yayyyy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the tests were written by Gary as a part of initial checkin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments. Good job.
- What I did
- How I did it
- How to verify it
- Description for the changelog