Skip to content
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

Implemented RSC15f and RTN17e and improved fallback handling #385

Merged
merged 15 commits into from
Dec 12, 2019

Conversation

marto83
Copy link
Contributor

@marto83 marto83 commented Nov 12, 2019

To help you review this pull request you can look at it in 2 parts

  1. I implemented a test for RSC15f and realised to make what is required in the spec I need to refactor how we do fallback handling.
  2. The next few commits were a refactor of the Rest fallback handling followed by a refactor of the Realtime fallback handling
  3. Finally I implemented additional tests for RTN17e

Copy link
Contributor

@QuintinWillison QuintinWillison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coming in as cold to this codebase as I am it's near impossible to provide more constructive input on these changes, in particular the refactor, without spending much more time than I have available. A case in point is the RealtimeWorkflow class which is barely documented in respect of interface and, thus, daunting to approach for those (such as myself) who have not been immersed in this codebase yet.

I've submitted a few comments by way of quick / obvious wins, but otherwise I think we'll just have to ensure these changes have the right impact when you get to creating further tests (hopefully next week).

src/IO.Ably.Shared/Types/ErrorCodes.cs Show resolved Hide resolved
src/IO.Ably.Shared/Realtime/AttemptsHelpers.cs Outdated Show resolved Hide resolved
This commit fixes two long standing annoyances
1. Centralise the internet check to the Workflow. Now the skip internet
check is done when we process the disconnected state.
2. Renamed OnAttachToContext in the State classes. For ages it hasn't
done what's on the tin. All it really does now is start the timer if
necessary.
This refactor includes both the realtime and rest clients.
Realtime - I moved the connecting error logic to the Realtime workflow and created a special command to handle the different between receiving a disconnected and an error message from the server while connecting.
Rest:
The logic now follows the spec so we retry all possible options and on every request and save a preferred host when we succeed
Organised the workflow tests and the only addition is RTN14g which was moved from ConnectingStateSpecs. Everything else is the same here.
No new tests here just a tweak for WhenTransportFails_ShouldTransitionToDisconnectedAndEmitErrorWithRetry
This commit updates the logic for existing tests and adds an extra RTN17b and RTN17f to test the logic of the rest library when Realtime is connected to a fallback host.
@marto83 marto83 force-pushed the feature/fallback-handling branch from 55e3cad to 1d4ea52 Compare December 11, 2019 15:16
@marto83
Copy link
Contributor Author

marto83 commented Dec 11, 2019

Coming in as cold to this codebase as I am it's near impossible to provide more constructive input on these changes, in particular the refactor, without spending much more time than I have available. A case in point is the RealtimeWorkflow class which is barely documented in respect of interface and, thus, daunting to approach for those (such as myself) who have not been immersed in this codebase yet.

I've submitted a few comments by way of quick / obvious wins, but otherwise I think we'll just have to ensure these changes have the right impact when you get to creating further tests (hopefully next week).

Fair point. I've added a summary comment to Realtime Workflow. All checks pass so let me know if you are happy with the fixes and I'll merge this into develop as well.

@QuintinWillison
Copy link
Contributor

Thanks for adding those comments. That really helps.

If you're still happy then please go ahead and get this merged, please.
Once that's done please let me know and I'll create the integration branch for 1.2, which is what #386 will then target, leaving develop free to accumulate further 1.1 testing.

@marto83 marto83 changed the base branch from feature/spec-align to develop December 12, 2019 09:14
@marto83
Copy link
Contributor Author

marto83 commented Dec 12, 2019

Morning @QuintinWillison. I am happy to get this merged. I changed the base branch to develop. Could you approve it again and once the checks are done I'll get it merged.

@marto83 marto83 merged commit 5ae616a into develop Dec 12, 2019
@QuintinWillison QuintinWillison deleted the feature/fallback-handling branch February 3, 2020 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants