Conversation
… clearing acquired cookies Introduce SetCommunicationTypeRequest (and associated BootstrapConfigRequest, SsoCookieVendorConfigRequest) that exclude the cookie_value field. The set_communication_type method now accepts this request type and preserves any previously acquired cookies from the repository, preventing config re-emissions during login auth state transitions from clobbering cookies.
Contributor
|
Great job! No new security vulnerabilities introduced in this pull request |
Contributor
🔍 SDK Breaking Change Detection ResultsSDK Version:
Breaking change detection completed. View SDK workflow |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #864 +/- ##
==========================================
+ Coverage 82.73% 82.76% +0.02%
==========================================
Files 353 353
Lines 42134 42203 +69
==========================================
+ Hits 34861 34928 +67
- Misses 7273 7275 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
dani-garcia
approved these changes
Mar 19, 2026
bw-ghapp bot
pushed a commit
to bitwarden/sdk-swift
that referenced
this pull request
Mar 19, 2026
…ication-config): prevent set_communication_type from clearing acquired cookies (bitwarden/sdk-internal#864)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




🎟️ Tracking
📔 Objective
During login, the
serverConfig$observable emits twice (once whenactiveUserId$changes, once when auth status transitions from Locked to Unlocked). Each emission callsparseBootstrapConfig()which produces aServerCommunicationConfigwithcookieValue: undefined, andsetCommunicationType()saved this directly to the repository, overwriting any previously acquired cookies. This causedSsoCookieMainto clear cookies and re-trigger acquisition on every config re-emission.The fix introduces a
SetCommunicationTypeRequesttype (withBootstrapConfigRequestandSsoCookieVendorConfigRequest) that structurally excludescookie_value. Theset_communication_typemethod now:cookie_valuefrom the repository when savingCookies are only ever set through
acquire_cookie, and this change makes that contract explicit at the type level.🚨 Breaking Changes
set_communication_typenow acceptsSetCommunicationTypeRequestinstead ofServerCommunicationConfig. Callers need to update to use the new request types (SetCommunicationTypeRequest,BootstrapConfigRequest,SsoCookieVendorConfigRequest), which have the same fields minuscookie_value.Migration: Replace
ServerCommunicationConfig/BootstrapConfig/SsoCookieVendorConfigwith their*Requestcounterparts when callingsetCommunicationType(). Thecookie_valuefield is simply removed from the input.