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

Refactor: message origin instead of safeAppId #4680

Merged
merged 6 commits into from
Dec 19, 2024
Merged

Refactor: message origin instead of safeAppId #4680

merged 6 commits into from
Dec 19, 2024

Conversation

katspaugh
Copy link
Member

What it solves

Resolves #4420

How this PR fixes it

This PR replaces safeAppId with origin when proposing messages.

Copy link

github-actions bot commented Dec 17, 2024

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Code review by ChatGPT

package.json Show resolved Hide resolved
src/services/safe-messages/safeMsgSender.ts Show resolved Hide resolved
src/tests/mocks/chains.ts Outdated Show resolved Hide resolved
yarn.lock Outdated Show resolved Hide resolved
src/tests/mocks/chains.ts Outdated Show resolved Hide resolved
Copy link

github-actions bot commented Dec 17, 2024

📦 Next.js Bundle Analysis for safe-wallet-web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

🎉 Global Bundle Size Decreased

Page Size (compressed)
global 1011.96 KB (-1 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Seven Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load
/apps/open 54.18 KB (-3 B) 1.04 MB
/transactions 97.14 KB (-3 B) 1.08 MB
/transactions/history 97.1 KB (-3 B) 1.08 MB
/transactions/messages 58.87 KB (-3 B) 1.05 MB
/transactions/msg 55.12 KB (-2 B) 1.04 MB
/transactions/queue 47.97 KB (-3 B) 1.04 MB
/transactions/tx 47.33 KB (-3 B) 1.03 MB
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this.

Copy link

github-actions bot commented Dec 17, 2024

Coverage report

Caution

Test run failed

St.
Category Percentage Covered / Total
🟡 Statements 73.26% 14385/19635
🔴 Branches
50.51% (-0.01% 🔻)
3391/6713
🔴 Functions 55.83% 2016/3611
🟡 Lines 74.8% 13048/17444
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / safeMsgSender.ts
100%
50% (-50% 🔻)
100% 100%

Test suite run failed

Failed tests: 0/1672. Failed suites: 6/237.
  ● Test suite failed to run

    ReferenceError: Cannot access '_default' before initialization

    

      at Object.default (src/hooks/useChains.ts:839:5)
      at requireActual (src/services/safe-wallet-provider/useSafeWalletProvider.test.tsx:38:11)
      at Object.<anonymous> (src/components/common/WalletProvider/index.tsx:2000:27)
      at Object.<anonymous> (src/hooks/wallets/useWallet.ts:510:27)
      at Object.<anonymous> (src/hooks/useChainId.ts:1404:66)
      at Object.<anonymous> (src/hooks/useChains.ts:874:27)
      at requireActual (src/services/safe-wallet-provider/useSafeWalletProvider.test.tsx:38:11)
      at Object.<anonymous> (src/hooks/wallets/useOnboard.ts:3936:67)
      at Object.<anonymous> (src/services/tx/tx-sender/sdk.ts:3583:27)
      at Object.<anonymous> (src/services/contracts/safeContracts.ts:1896:28)
      at Object.<anonymous> (src/utils/safe-migrations.ts:1471:28)
      at Object.<anonymous> (src/utils/transaction-guards.ts:8984:27)
      at Object.<anonymous> (src/store/txHistorySlice.ts:992:27)
      at Object.<anonymous> (src/store/slices.ts:549:14)
      at Object.<anonymous> (src/store/index.ts:2090:67)
      at Object.<anonymous> (src/tests/test-utils.tsx:30:16)
      at Object.<anonymous> (src/services/safe-wallet-provider/useSafeWalletProvider.test.tsx:22:20)


  ● Test suite failed to run

    TypeError: Cannot read properties of undefined (reading 'AWAITING_CONFIRMATIONS')

      60 |
      61 | const BundleTxStatuses: Record<TransactionStatus, BundleStatus> = {
    > 62 |   [TransactionStatus.AWAITING_CONFIRMATIONS]: BundleStatus.PENDING,
         |                      ^
      63 |   [TransactionStatus.AWAITING_EXECUTION]: BundleStatus.PENDING,
      64 |   [TransactionStatus.CANCELLED]: BundleStatus.CONFIRMED,
      65 |   [TransactionStatus.FAILED]: BundleStatus.CONFIRMED,

      at Object.AWAITING_CONFIRMATIONS (src/services/safe-wallet-provider/index.ts:62:22)
      at Object.<anonymous> (src/utils/nested-safe-wallet.ts:1272:27)
      at Object.<anonymous> (src/components/common/WalletProvider/index.tsx:2006:27)
      at Object.<anonymous> (src/hooks/wallets/useWallet.ts:510:27)
      at Object.<anonymous> (src/hooks/useChainId.ts:1404:66)
      at Object.<anonymous> (src/hooks/useChains.ts:874:27)
      at Object.<anonymous> (src/hooks/wallets/useOnboard.ts:3936:67)
      at Object.<anonymous> (src/services/tx/tx-sender/sdk.ts:3583:27)
      at Object.<anonymous> (src/services/contracts/safeContracts.ts:1896:28)
      at Object.<anonymous> (src/utils/safe-migrations.ts:1471:28)
      at Object.<anonymous> (src/utils/transaction-guards.ts:8984:27)
      at Object.<anonymous> (src/store/txHistorySlice.ts:992:27)
      at Object.<anonymous> (src/store/slices.ts:549:14)
      at Object.<anonymous> (src/store/index.ts:2090:67)
      at Object.<anonymous> (src/tests/test-utils.tsx:30:16)
      at Object.<anonymous> (src/utils/__tests__/tx-history-filter.test.ts:20:20)


  ● Test suite failed to run

    ReferenceError: Cannot access '_getMinimumMultiSendCallOnlyVersion' before initialization

    

      at Object._getMinimumMultiSendCallOnlyVersion (src/services/contracts/safeContracts.ts:1828:5)
      at requireActual (src/hooks/coreSDK/__tests__/safeCoreSDK.test.ts:14:13)
      at Object.<anonymous> (src/utils/safe-migrations.ts:1471:28)
      at Object.<anonymous> (src/utils/transaction-guards.ts:8984:27)
      at Object.<anonymous> (src/store/txHistorySlice.ts:992:27)
      at Object.<anonymous> (src/store/slices.ts:549:14)
      at Object.<anonymous> (src/store/index.ts:2090:67)
      at Object.<anonymous> (src/hooks/useChains.ts:868:27)
      at Object.<anonymous> (src/hooks/wallets/useOnboard.ts:3936:67)
      at Object.<anonymous> (src/services/tx/tx-sender/sdk.ts:3583:27)
      at Object.<anonymous> (src/services/contracts/safeContracts.ts:1896:28)
      at requireActual (src/hooks/coreSDK/__tests__/safeCoreSDK.test.ts:14:13)
      at Object.<anonymous> (src/hooks/coreSDK/safeCoreSDK.ts:1602:28)
      at Object.<anonymous> (src/hooks/coreSDK/__tests__/safeCoreSDK.test.ts:43:22)


  ● Test suite failed to run

    ReferenceError: Cannot access '_default' before initialization

    

      at Object.default (src/hooks/useChains.ts:839:5)
      at requireActual (src/components/common/AddressBookInput/index.test.tsx:22:11)
      at Object.<anonymous> (src/components/common/WalletProvider/index.tsx:2000:27)
      at Object.<anonymous> (src/hooks/wallets/useWallet.ts:510:27)
      at Object.<anonymous> (src/hooks/useChainId.ts:1404:66)
      at Object.<anonymous> (src/hooks/useChains.ts:874:27)
      at requireActual (src/components/common/AddressBookInput/index.test.tsx:22:11)
      at Object.<anonymous> (src/hooks/wallets/useOnboard.ts:3936:67)
      at Object.<anonymous> (src/services/tx/tx-sender/sdk.ts:3583:27)
      at Object.<anonymous> (src/services/contracts/safeContracts.ts:1896:28)
      at Object.<anonymous> (src/utils/safe-migrations.ts:1471:28)
      at Object.<anonymous> (src/utils/transaction-guards.ts:8984:27)
      at Object.<anonymous> (src/store/txHistorySlice.ts:992:27)
      at Object.<anonymous> (src/store/slices.ts:549:14)
      at Object.<anonymous> (src/store/index.ts:2090:67)
      at Object.<anonymous> (src/tests/test-utils.tsx:30:16)
      at Object.<anonymous> (src/components/common/AddressBookInput/index.test.tsx:22:20)


  ● Test suite failed to run

    ReferenceError: Cannot access 'txQueueSlice' before initialization

    

      at Object.txQueueSlice (src/store/txQueueSlice.ts:1141:5)
      at Object.get [as txQueueSlice] (src/store/slices.ts:632:22)
      at Object.txQueueSlice (src/store/index.ts:37:11)
      at Object.<anonymous> (src/hooks/useChains.ts:868:27)
      at Object.<anonymous> (src/hooks/wallets/useOnboard.ts:3936:67)
      at Object.<anonymous> (src/services/tx/tx-sender/sdk.ts:3583:27)
      at Object.<anonymous> (src/services/contracts/safeContracts.ts:1896:28)
      at Object.<anonymous> (src/utils/safe-migrations.ts:1471:28)
      at Object.<anonymous> (src/utils/transaction-guards.ts:8984:27)
      at Object.<anonymous> (src/store/txQueueSlice.ts:1152:28)
      at Object.<anonymous> (src/store/__tests__/txQueueSlice.test.ts:8:23)


  ● Test suite failed to run

    ReferenceError: Cannot access 'txHistorySlice' before initialization

    

      at Object.txHistorySlice (src/store/txHistorySlice.ts:984:5)
      at Object.get [as txHistorySlice] (src/store/slices.ts:632:22)
      at Object.txHistorySlice (src/store/index.ts:36:11)
      at Object.<anonymous> (src/hooks/useChains.ts:868:27)
      at Object.<anonymous> (src/hooks/wallets/useOnboard.ts:3936:67)
      at Object.<anonymous> (src/services/tx/tx-sender/sdk.ts:3583:27)
      at Object.<anonymous> (src/services/contracts/safeContracts.ts:1896:28)
      at Object.<anonymous> (src/utils/safe-migrations.ts:1471:28)
      at Object.<anonymous> (src/utils/transaction-guards.ts:8984:27)
      at Object.<anonymous> (src/store/txHistorySlice.ts:992:27)
      at Object.<anonymous> (src/store/__tests__/txHistorySlice.test.ts:10:25)

Report generated by 🧪jest coverage report action from a172897

@katspaugh katspaugh marked this pull request as draft December 17, 2024 15:12
@katspaugh katspaugh marked this pull request as ready for review December 18, 2024 14:44
@katspaugh katspaugh merged commit f6750be into dev Dec 19, 2024
12 of 15 checks passed
@katspaugh katspaugh deleted the origin branch December 19, 2024 15:06
@github-actions github-actions bot locked and limited conversation to collaborators Dec 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate from safeAppId to origin for messages
2 participants