Skip to content

remove device share web crypto - #1109

Open
Ethella wants to merge 3 commits into
masterfrom
jerry/remove-dkms-device-share
Open

remove device share web crypto#1109
Ethella wants to merge 3 commits into
masterfrom
jerry/remove-dkms-device-share

Conversation

@Ethella

@Ethella Ethella commented Aug 11, 2026

Copy link
Copy Markdown
Member

📦 Pull Request

[Provide a general summary of the pull request here.]

✅ Fixed Issues

  • [List any fixed issues here like: Fixes #XXXX]

🚨 Test instructions

[Describe any additional context required to test the PR/feature/bug fix.]

⚠️ Don't forget to add a semver label!

Please 🚨 ONLY ADD ONE 🚨 of the following labels, failing to do so may lead to adverse versioning of your changes when published:

  • patch: Bug Fix?
  • minor: New Feature?
  • major: Breaking Change?
  • skip-release: It's unnecessary to publish this change.

Special Note

Please avoid adding any of the Priority labels as they conflict with the labels above ☝️

@Ethella
Ethella requested a review from a team as a code owner August 11, 2026 18:46
@Ethella
Ethella requested a lite review from Copilot August 11, 2026 18:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the legacy “device share” WebCrypto-based caching flow from the Magic SDK provider, and introduces a lightweight cleanup path to delete any leftover device-share artifacts from older SDK versions.

Changes:

  • Removes deviceShare from message/request types and from the ViewController request/response flow.
  • Deletes the legacy device-share-web-crypto utility (and related tests) and removes networkHash plumbing previously used for per-network device-share caching.
  • Adds device-share-cleanup and invokes cleanup from SDK initialization (and keeps logout cleanup via UserModule).

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/@magic-sdk/types/src/core/message-types.ts Removes deviceShare from cross-window message request/response typings.
packages/@magic-sdk/provider/test/spec/util/device-share-web-crypto.spec.ts Removes tests for the deleted legacy WebCrypto device-share utilities.
packages/@magic-sdk/provider/test/spec/core/view-controller/post.spec.ts Removes device-share-related post behavior tests and stubbing.
packages/@magic-sdk/provider/test/spec/core/sdk/constructor.spec.ts Removes assertion tied to the removed networkHash behavior.
packages/@magic-sdk/provider/test/factories.ts Updates test ViewController factory to match the new constructor signature (no networkHash).
packages/@magic-sdk/provider/test/constants.ts Removes TEST_NETWORK_HASH constant that supported the removed device-share cache flow.
packages/@magic-sdk/provider/src/util/view-controller-utils.ts Removes deviceShare from the standardized request shape.
packages/@magic-sdk/provider/src/util/device-share-web-crypto.ts Deletes legacy encrypt/decrypt/persist device-share WebCrypto implementation.
packages/@magic-sdk/provider/src/util/device-share-cleanup.ts Adds legacy-storage cleanup to remove ds_*, ek, and iv keys.
packages/@magic-sdk/provider/src/modules/user.ts Redirects logout cleanup import to the new cleanup utility.
packages/@magic-sdk/provider/src/core/view-controller.ts Removes device-share send/receive/persist logic and networkHash plumbing.
packages/@magic-sdk/provider/src/core/sdk.ts Calls device-share cleanup during SDK initialization; updates overlay controller construction signature.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +13 to +22
export async function clearDeviceShares() {
const keysToRemove: string[] = [ENCRYPTION_KEY_KEY, INITIALIZATION_VECTOR_KEY];
await iterate((value, key) => {
if (key.startsWith(`${DEVICE_SHARE_KEY}_`)) {
keysToRemove.push(key);
}
});
for (const key of keysToRemove) {
await removeItem(key);
}
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.

3 participants