-
Notifications
You must be signed in to change notification settings - Fork 412
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
Fix: make safe app id an int #3722
Conversation
Branch preview✅ Deploy successful! Website: Storybook: |
ESLint Summary View Full Report
Report generated by eslint-plus-action |
📦 Next.js Bundle Analysis for safe-wallet-webThis analysis was generated by the Next.js Bundle Analysis action. 🤖 Eight Pages Changed SizeThe following pages changed size from the code in this PR compared to its base branch:
DetailsOnly 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 Any third party scripts you have added directly to your app using the 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. |
Coverage report
Show files with reduced coverage 🔻
Test suite run success1462 tests passing in 202 suites. Report generated by 🧪jest coverage report action from 8b858f5 |
src/services/safe-apps/manifest.ts
Outdated
@@ -99,7 +99,7 @@ const fetchSafeAppFromManifest = async ( | |||
const iconUrl = getAppLogoUrl(normalizedAppUrl, appManifest) | |||
|
|||
return { | |||
id: Math.random(), | |||
id: Math.round(Math.random() * Math.pow(10, 18)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This leads to a number space that can still include low numbers which are given to actual Safe apps.
Lets add a billion or so to the random number: id: Math.round(1_000_000_000 + Math.random() * Math.pow(10, 18))
to avoid collisions.
Verified , works with https://safe-apps-test-app.pages.dev/ |
What it solves
Custom Safe Apps get a random id which might be a problem when validating messages.