Repository navigation
Conversation
SDK 8be9dbc adds `data: SendItem?` to Send, but the Send API models had no `data` field and every mapping hard-coded nil. An Item Send's data was dropped on sync, persistence and update. Add SendDataModel to the response and request models and map it both ways. The API stores the item's cipher as an opaque JSON string; the SDK exposes it only as a structured Cipher, so it is (de)serialized via CipherDetailsResponseModel.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## sdlc/sdk-update #3079 +/- ##
===================================================
+ Coverage 79.97% 82.30% +2.32%
===================================================
Files 1171 1048 -123
Lines 75846 68574 -7272
===================================================
- Hits 60657 56439 -4218
+ Misses 15189 12135 -3054 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
https://bitwarden.atlassian.net/browse/PM-44199
Stacked on #2989 (SDK update to 8be9dbc, which adds
Send.data).📔 Objective
#2989 maps every Send with
data: nil, andSendResponseModel/SendRequestModelhave nodatafield, so an Item Send'sdatais dropped on sync and on every round trip (edit, key rotation).SendDataModel { data: String?, encryptionVersion: Int? }to the response and request models;UpdateSendRequestcarries it.databoth ways inBitwardenSdk+Tools.swift.SendItem.datais a structured SDKCipherand the Swift bindings expose no JSON (de)serialization, so the cipher JSON goes through the existingCipherDetailsResponseModelmapping.localData,partialData) and any nested field the app models lack. A lossless fix needs the SDK to exposeCipher/SendItemJSON (de)serialization over UniFFI, or carry the raw string.data.datawithdeny_unknown_fields. Top-level keys emitted are a subset of the SDKCipher; nested models were not verified..unknownand are dropped inreplaceSends(PM-41094), so this matters once Item support lands.Related: bitwarden/sdk-internal#1535 (non-public API fields on encrypted models).
🧪 Testing
Tests written first and observed failing (3 failures), then passing:
BitwardenSdkToolsTests(response mapping, round trip),UpdateSendRequestTests. Send/Sync/Repository test classes pass (137 tests). SwiftLint/SwiftFormat clean.