Skip to content

Conversation

aaudin90
Copy link
Collaborator

@aaudin90 aaudin90 commented Jul 6, 2025

This commit refactors the SDK's user management by:

  • Introducing UserRepository to handle ApphudUser state and persistence.
  • Migrating ApphudInternal to delegate user operations to UserRepository.
  • Adding UpdateCustomerUseCase for customer data updates.
  • Converting SharedPreferencesStorage to a class for better dependency injection.
  • Updating the demo app's Apphud.start call with new parameters.

a.iudin and others added 3 commits July 6, 2025 23:53
This commit refactors the SDK's user management by:
- Introducing `UserRepository` to handle `ApphudUser` state and persistence.
- Migrating `ApphudInternal` to delegate user operations to `UserRepository`.
- Adding `UpdateCustomerUseCase` for customer data updates.
- Converting `SharedPreferencesStorage` to a class for better dependency injection.
- Updating the demo app's `Apphud.start` call with new parameters.
…ator

The SharedPreferencesStorage access mechanism has been redesigned. Instead of creating local instances in different classes, a single instance provided through ServiceLocator is now used.

This change centralizes dependency management, simplifies the structure of the code, and improves its testability by eliminating the direct creation of dependencies within classes.
…e and related classes

Removed userId and deviceId properties from Storage interface and their implementation in SharedPreferencesStorage, and removed references to them in ApphudInternal and UserRepository. Now user IDs are taken only from ApphudUser, which simplifies storage logic and prevents data duplication. This is a preparatory stage for further refactoring of work with users.
@aaudin90 aaudin90 force-pushed the UserStorageRefactoring branch from 4c637c2 to c5477ff Compare July 21, 2025 18:21
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.

1 participant