Skip to content
This repository was archived by the owner on Nov 10, 2023. It is now read-only.

Conversation

@katspaugh
Copy link
Member

What it solves

According to my academic research (a quick Google search), there's no performance benefit in promisifying localStorage calls, so I've removed all of the related async-awaits.

@katspaugh katspaugh requested a review from iamacook December 15, 2021 15:27
@github-actions
Copy link

CLA Assistant Lite All Contributors have signed the CLA.

setConsentReceived(true)
} else {
setConsentReceived(false)
}
Copy link
Member Author

Choose a reason for hiding this comment

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

🤦

const checkIfSafeIsPendingToBeCreated = async (): Promise<void> => {
setIsLoading(true)
const safePendingToBeCreated = (await loadFromStorage(SAFE_PENDING_CREATION_STORAGE_KEY)) as CreateSafeFormValues
const safePendingToBeCreated = await Promise.resolve(
Copy link
Member Author

Choose a reason for hiding this comment

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

Removing the promise completely here was breaking the CreateSafePage tests for a mysterious reason, so I kept this for now.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add a @TODO: comment?

@github-actions
Copy link

github-actions bot commented Dec 15, 2021

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 1 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

const checkIfSafeIsPendingToBeCreated = async (): Promise<void> => {
setIsLoading(true)
const safePendingToBeCreated = (await loadFromStorage(SAFE_PENDING_CREATION_STORAGE_KEY)) as CreateSafeFormValues
const safePendingToBeCreated = await Promise.resolve(
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add a @TODO: comment?

const name = STORAGE_KEYS[id] || id
// Legacy ImmortalDB prefix
// @TODO: migrate it
return `_immortal|v2_${name}__`
Copy link
Contributor

Choose a reason for hiding this comment

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

We'll be forever haunted by this.

Copy link
Member Author

Choose a reason for hiding this comment

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

Restored the comment. I was actually working on a migration PR but then decided to get rid of async-await first.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 1583412943

  • 27 of 56 (48.21%) changed or added relevant lines in 13 files are covered.
  • 3 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+0.03%) to 32.279%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/logic/currentSession/utils/index.ts 2 3 66.67%
src/logic/safe/utils/safeStorage.ts 9 10 90.0%
src/routes/CreateSafePage/CreateSafePage.tsx 3 4 75.0%
src/routes/safe/components/Apps/hooks/useLegalConsent.ts 0 1 0.0%
src/logic/safe/hooks/useLocalSafes.tsx 0 2 0.0%
src/logic/safe/store/actions/fetchSafe.ts 2 4 50.0%
src/logic/safe/store/middleware/notificationsMiddleware.ts 1 4 25.0%
src/logic/wallets/transactionDataCheck/index.ts 0 3 0.0%
src/routes/CreateSafePage/components/SafeCreationProcess.tsx 0 15 0.0%
Files with Coverage Reduction New Missed Lines %
src/logic/safe/hooks/useLocalSafes.tsx 1 0%
src/logic/safe/utils/safeStorage.ts 1 70.0%
src/routes/CreateSafePage/CreateSafePage.tsx 1 85.14%
Totals Coverage Status
Change from base Build 1582074445: 0.03%
Covered Lines: 3089
Relevant Lines: 8492

💛 - Coveralls

@github-actions
Copy link

Deployment links

🟠 Safe Rinkeby Safe Mainnet 🟣 Safe Polygon 🟡 Safe BSC Safe Arbitrum 🟢 Safe xDai

@katspaugh
Copy link
Member Author

katspaugh commented Dec 15, 2021

No need to test this. (Famous last words)

@katspaugh katspaugh merged commit af50bcc into dev Dec 15, 2021
@katspaugh katspaugh deleted the localstorage branch December 15, 2021 15:45
@github-actions github-actions bot locked and limited conversation to collaborators Dec 15, 2021
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.

4 participants