Skip to content

Conversation

@Adamj1232
Copy link
Contributor

@Adamj1232 Adamj1232 commented Jun 17, 2024

Description

Handling of empty localStorage item, remove default of empty string and perform a falsey check.
Ensure that if an empty connect config object is passed and the user doesnt have a localStorage wallet set as the last used then handle check for the last connected wallet properly.
Also properly handles empty object passed in through connect({})
Closes: #2227
Closes: #2237

Checklist

  • Increment the version field in package.json of the package you have made changes in following semantic versioning and using alpha release tagging
  • Check the box that allows repo maintainers to update this PR
  • Test locally to make sure this feature/fix works
  • Run yarn check-all to confirm there are not any associated errors
  • Confirm this PR passes Circle CI checks
  • Add or update relevant information in the documentation

Tests with demo app (injected)

  • send transaction
  • switch chains
  • sign message
  • sign typed message
  • disconnect

@socket-security
Copy link

socket-security bot commented Jun 17, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@babel/[email protected] None 0 6.56 kB nicolo-ribaudo
npm/@babel/[email protected] None 0 11.6 kB nicolo-ribaudo
npm/@babel/[email protected] None 0 1.89 MB nicolo-ribaudo
npm/@esbuild/[email protected] None 0 11.1 MB evanw
npm/@esbuild/[email protected] None 0 9.57 MB evanw
npm/@esbuild/[email protected] None 0 11.1 MB evanw
npm/@esbuild/[email protected] None 0 9.51 MB evanw
npm/@esbuild/[email protected] None 0 9.92 MB evanw
npm/@esbuild/[email protected] None 0 8.65 MB evanw
npm/@esbuild/[email protected] None 0 9.35 MB evanw
npm/@esbuild/[email protected] None 0 8.85 MB evanw
npm/@esbuild/[email protected] None 0 8.65 MB evanw
npm/@esbuild/[email protected] None 0 8.9 MB evanw
npm/@esbuild/[email protected] None 0 9.11 MB evanw
npm/@esbuild/[email protected] None 0 10.2 MB evanw
npm/@esbuild/[email protected] None 0 8.91 MB evanw
npm/@esbuild/[email protected] None 0 8.85 MB evanw
npm/@esbuild/[email protected] None 0 9.77 MB evanw
npm/@esbuild/[email protected] None 0 9.35 MB evanw
npm/@esbuild/[email protected] None 0 9.33 MB evanw
npm/@esbuild/[email protected] None 0 9.37 MB evanw
npm/@esbuild/[email protected] None 0 9.33 MB evanw
npm/@esbuild/[email protected] None 0 8.76 MB evanw
npm/@esbuild/[email protected] None 0 9.2 MB evanw
npm/@esbuild/[email protected] None 0 9.55 MB evanw
npm/@jridgewell/[email protected] None 0 55.2 kB jridgewell
npm/@types/[email protected] None 0 1.68 MB types
npm/@web3-onboard/[email protected] None 0 0 B
npm/[email protected] None 0 2.14 MB caniuse-lite
npm/[email protected] None 0 9.36 kB dfcreative
npm/[email protected] None 0 2.69 kB jbnicolai
npm/[email protected] None 0 95.5 kB mdevils
npm/[email protected] None 0 235 kB jordanbtucker
npm/[email protected] None 0 21.7 kB ai
npm/[email protected] None 0 15.3 kB ai
npm/[email protected] None 0 32.2 kB chicoxyzzy
npm/[email protected] None 0 4.5 MB blesh
npm/[email protected] None 0 14.8 kB isaacs

🚮 Removed packages: npm/@esbuild-plugins/[email protected], npm/@esbuild-plugins/[email protected], npm/@ethersproject/[email protected], npm/@ethersproject/[email protected], npm/@ethersproject/[email protected], npm/@ethersproject/[email protected], npm/@fontsource/[email protected], npm/@jridgewell/[email protected], npm/@lit/[email protected], npm/@rollup/[email protected], npm/@stablelib/[email protected], npm/@sveltejs/[email protected], npm/@sveltejs/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@typescript-eslint/[email protected], npm/@typescript-eslint/[email protected], npm/@walletconnect/[email protected], npm/@walletconnect/[email protected], npm/@walletconnect/[email protected], npm/@walletconnect/[email protected], npm/@walletconnect/[email protected], npm/@web3-onboard/[email protected], npm/@web3-onboard/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected]

View full report↗︎

@socket-security
Copy link

socket-security bot commented Jun 17, 2024

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Alert Package NoteSourceCI
Install scripts npm/[email protected]
  • Install script: install
  • Source: npm run rebuild || echo "Secp256k1 bindings compilation fail. Pure JS implementation will be used."
Install scripts npm/[email protected]
  • Install script: install
  • Source: npm run rebuild || echo "Keccak bindings compilation fail. Pure JS implementation will be used."

View full report↗︎

Next steps

What is an install script?

Install scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.

Packages should not be running non-essential scripts during install and there are often solutions to problems people solve with install scripts that can be run at publish time instead.

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/[email protected] or ignore all packages with @SocketSecurity ignore-all

@Adamj1232 Adamj1232 merged commit f145192 into develop Jun 17, 2024
@Adamj1232 Adamj1232 deleted the fix/disconnect_with_empty_localStore branch June 17, 2024 18:00
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.

connect({}) throws runtime error, yet compiles according to type system a disconnect error by default value or other reason can not set local storage

2 participants