[PR #1865] [MERGED] [EC-437][BEEEP] Improved the ServiceContainer Register/Resolve #3190

Closed
opened 2025-11-26 23:29:28 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/1865
Author: @fedemkr
Created: 3/25/2022
Status: Merged
Merged: 7/5/2022
Merged by: @fedemkr

Base: masterHead: tech-debt/refactor-service-container


📝 Commits (2)

  • 48a99aa Improved the ServiceContainer to be easier to use and not to have the service name hardcoded to register/resolve a service
  • 6ff995a Merge branch 'master' into tech-debt/refactor-service-container

📊 Changes

1 file changed (+86 additions, -6 deletions)

View changed files

📝 src/Core/Utilities/ServiceContainer.cs (+86 -6)

📄 Description

Type of change

  • Bug fix
  • New feature development
  • Tech debt (refactoring, code cleanup, dependency upgrades, etc)
  • Build/deploy pipeline (DevOps)
  • Other

Objective

Improve the ServiceContainer so that we can register/resolve service a lot easier.
Also made the collection a ConcurrentDictionary so we don't have threading issues.

Code changes

  • ServiceContainer.cs: Changed RegisteredServices to be a ConcurrentDictionary so that we don't run in threading issues. Also added several methods that don't need the serviceName string to register/resolve the services.

Testing requirements

Nothing, right now it's just an addition to the component so nothing on the app has actually changed.

Before you submit

  • I have added unit tests where it makes sense to do so (encouraged but not required)
  • This change requires a documentation update (notify the documentation team)
  • This change has particular deployment requirements (notify the DevOps team)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/1865 **Author:** [@fedemkr](https://github.com/fedemkr) **Created:** 3/25/2022 **Status:** ✅ Merged **Merged:** 7/5/2022 **Merged by:** [@fedemkr](https://github.com/fedemkr) **Base:** `master` ← **Head:** `tech-debt/refactor-service-container` --- ### 📝 Commits (2) - [`48a99aa`](https://github.com/bitwarden/android/commit/48a99aa0443834a26000fbd2dea50e17ff80de2e) Improved the ServiceContainer to be easier to use and not to have the service name hardcoded to register/resolve a service - [`6ff995a`](https://github.com/bitwarden/android/commit/6ff995a62595a16d089a45f64374d73095fca2e5) Merge branch 'master' into tech-debt/refactor-service-container ### 📊 Changes **1 file changed** (+86 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `src/Core/Utilities/ServiceContainer.cs` (+86 -6) </details> ### 📄 Description ## Type of change - [ ] Bug fix - [ ] New feature development - [X] Tech debt (refactoring, code cleanup, dependency upgrades, etc) - [ ] Build/deploy pipeline (DevOps) - [ ] Other ## Objective <!--Describe what the purpose of this PR is. For example: what bug you're fixing or what new feature you're adding--> Improve the `ServiceContainer` so that we can register/resolve service a lot easier. Also made the collection a `ConcurrentDictionary` so we don't have threading issues. ## Code changes <!--Explain the changes you've made to each file or major component. This should help the reviewer understand your changes--> <!--Also refer to any related changes or PRs in other repositories--> * **ServiceContainer.cs:** Changed `RegisteredServices` to be a `ConcurrentDictionary` so that we don't run in threading issues. Also added several methods that don't need the `serviceName` string to register/resolve the services. ## Testing requirements <!--What functionality requires testing by QA? This includes testing new behavior and regression testing--> Nothing, right now it's just an addition to the component so nothing on the app has actually changed. ## Before you submit - [ ] I have added **unit tests** where it makes sense to do so (encouraged but not required) - [ ] This change requires a **documentation update** (notify the documentation team) - [ ] This change has particular **deployment requirements** (notify the DevOps team) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-26 23:29:28 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#3190