Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate extension wallet to Manifest V3 architecture #2120

Merged
merged 20 commits into from
Feb 1, 2025
Merged

Conversation

lukaw3d
Copy link
Member

@lukaw3d lukaw3d commented Jan 27, 2025

@lukaw3d lukaw3d requested review from buberdds and csillag January 27, 2025 20:21
Copy link

github-actions bot commented Jan 27, 2025

Deployed to Cloudflare Pages

Latest commit: 330eb29b28a0d882e0b0e698c12c135d60d1c148
Status:✅ Deploy successful!
Preview URL: https://26ff830b.oasis-wallet.pages.dev
Alias: https://pr-2120.oasis-wallet.pages.dev

Copy link

socket-security bot commented Jan 27, 2025

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report↗︎

@lukaw3d lukaw3d changed the title Manifest v3 extension Migrate extension wallet to Manifest V3 architecture Jan 27, 2025
@@ -8,7 +8,7 @@ import type {
} from '../../src/vendors/nexus/index'
import { StringifiedBigInt } from '../../src/types/StringifiedBigInt'

export async function mockApi(context: BrowserContext | Page, balance: StringifiedBigInt) {
export async function mockApi(context: BrowserContext | Page, balance: number | StringifiedBigInt) {
Copy link
Contributor

Choose a reason for hiding this comment

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

oh I did not update all mockApi usage. this is minor and not related to this PR, but Account['available'] would be more accurate. can bump it once this is one is merged if that works for you.

public/manifest.json Outdated Show resolved Hide resolved
Comment on lines 224 to 230
yield* fork(function* () {
const channelQueue = yield* actionChannel<AnyAction>('*')
let previousStringifiedEncryptionKey: PersistState['stringifiedEncryptionKey'] = undefined
while (true) {
yield* take(channelQueue)
const stringifiedEncryptionKey = yield* select(selectStringifiedEncryptionKey)
if (stringifiedEncryptionKey !== previousStringifiedEncryptionKey) {
previousStringifiedEncryptionKey = stringifiedEncryptionKey
yield* call(writeSharedExtMemory, stringifiedEncryptionKey)
}
}
})

yield* fork(function* () {
const encryptedState = window.localStorage.getItem(
STORAGE_FIELD,
) as EncryptedString<PersistedRootState> | null
if (!encryptedState) return // Ignore
try {
Copy link
Member Author

@lukaw3d lukaw3d Jan 30, 2025

Choose a reason for hiding this comment

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

From michal: does order matter?
does look risky to write before reading the stored value from previous session

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

Copy link
Member Author

Choose a reason for hiding this comment

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

Hm, bfe226e breaks v0 migration

Copy link
Member Author

Choose a reason for hiding this comment

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

ah I lost one commit during squashing

@lukaw3d lukaw3d force-pushed the lw/manifest-v3-3 branch 4 times, most recently from bfe226e to 922a75d Compare January 31, 2025 06:44
Copy link

socket-security bot commented Jan 31, 2025

Report too large to display inline

View full report↗︎

@lukaw3d lukaw3d merged commit 94420f5 into master Feb 1, 2025
13 checks passed
@lukaw3d lukaw3d deleted the lw/manifest-v3-3 branch February 1, 2025 17:43
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.

2 participants