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

Remove the data-client app adapter implementation #5499

Merged
merged 8 commits into from
Jan 31, 2024

Conversation

psh
Copy link
Collaborator

@psh psh commented Jan 30, 2024

This PR started off as a simple "Let's slim down the commons app-adapter" and as it got toward the end, turned into "OK, this thing has surely got to go!"

It was worked as a series of discrete steps, to remove one method from the app-adapter at a time, so if you look at the commits it might be a little easier to follow. Mostly they're removing unused methods or inlining single-line methods.

High-level overview -

  • The SharedPreferenceCookieManager was broken into 2 pieces - cookie jar (integration with OkHttp) and cookie storage (integration with shared preferences). Each was converted to Kotlin and now managed using dependency injection.
  • The test app-adapter was replaced with a simple utility method to create an OkHttpClient in the tests that matched what the old app-adapter was doing. The large number of files in the PR are mostly unit tests now calling this method in their setup.
  • How we log out was abstracted (as I believe it was always intended to be) behind a little LogoutClient.

This PR relates to the discussion in #5165

@psh psh changed the title Refactor the data-client app adapter Remove the data-client app adapter implementation Jan 30, 2024
@nicolas-raoul nicolas-raoul merged commit 8db0b54 into commons-app:main Jan 31, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants