Skip to content

[PM-39357] Make it possible to go offline from pricing service#7867

Draft
justindbaur wants to merge 1 commit into
mainfrom
enable-offline-development-with-local-pricing-service
Draft

[PM-39357] Make it possible to go offline from pricing service#7867
justindbaur wants to merge 1 commit into
mainfrom
enable-offline-development-with-local-pricing-service

Conversation

@justindbaur

@justindbaur justindbaur commented Jun 24, 2026

Copy link
Copy Markdown
Member

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-39357

📔 Objective

Updated the DI registration of IPricingClient to allow for a null pricing service url in settings in Development mode only. When the setting is null it will return an instance that does not need to reach out to the broader internet and will return local plan information. This information will eventually get stale from the real stuff but that is not a huge concern and can easily be updated later on.

📸 Screenshots

@justindbaur justindbaur added the t:misc Change Type - ¯\_(ツ)_/¯ Prefer using other type labels label Jun 24, 2026
@sonarqubecloud

Copy link
Copy Markdown

// Assert
Assert.Null(result);
}
var mockHttp = new MockHttpMessageHandler();
Comment on lines +168 to +171
var httpClient = new HttpClient(mockHttp)
{
BaseAddress = new Uri("https://test.com/")
};
Comment on lines +157 to +163
foreach (var remotePlan in remotePlans)
{
if (localPlans.All(local => local.Type != remotePlan.Type))
{
failures.Add($"{remotePlan.Type}: present remotely, absent locally");
}
}
Comment on lines +197 to +203
foreach (var remotePlan in remotePlans)
{
if (localPlans.All(local => local.Name != remotePlan.Name))
{
failures.Add($"{remotePlan.Name}: present remotely, absent locally");
}
}
@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 2.71985% with 1073 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.55%. Comparing base (926a5c6) to head (097ae4a).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
src/Core/Billing/Pricing/LocalPricingClient.cs 0.00% 1068 Missing ⚠️
src/Core/Billing/Pricing/NoopPricingClient.cs 0.00% 5 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (926a5c6) and HEAD (097ae4a). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (926a5c6) HEAD (097ae4a)
2 1
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7867      +/-   ##
==========================================
- Coverage   65.79%   60.55%   -5.24%     
==========================================
  Files        2212     2219       +7     
  Lines       97922    99128    +1206     
  Branches     8836     8855      +19     
==========================================
- Hits        64426    60028    -4398     
- Misses      31287    36988    +5701     
+ Partials     2209     2112      -97     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@justindbaur justindbaur changed the title Make it possible to go offline from pricing service [PM-39357] Make it possible to go offline from pricing service Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t:misc Change Type - ¯\_(ツ)_/¯ Prefer using other type labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant