-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Skip validation when previous state is empty due to reset #20585
Conversation
final AirbyteApiClient airbyteApiClient1 = mock(AirbyteApiClient.class); | ||
final StateApi stateApi1 = mock(StateApi.class); | ||
final ConnectionState connectionState = mock(ConnectionState.class); | ||
Mockito.lenient().when(connectionState.getStateType()).thenReturn(ConnectionStateType.LEGACY); |
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.
Why do we bypass strict stubbing? Do we need those mock?
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.
@benmoriceau I am not sure why this test has to do this. It is already creating lenient mocks and I originally attempted to not do that, but the tests fail without marking them lenient. In particular, these mocks are necessary, as we want to test the case where the previous state returned by the call to the state API returns a legacy state with an empty state JSON object for the data.
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.
Sounds good, let's not address that in this PR
@benmoriceau I discovered a failing acceptance test which lead me to add an additional |
What
Fix an edge case related to resets and syncs where at least one stream doesn't produce any data. The specific scenario plays out something like this:
LEGACY
with a value of{"state":{}}
How
LEGACY
AND is empty. In this case, we don't care if we overwrite the existing state, as it has nothing in it and we don't risk losing state.Recommended reading order
PersistStateActivityImpl.java
Tests