Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ VITE_PROXYGATEWAY=https://gateway.subquery.network
VITE_AI_URL=https://ai-reaction-backend.subquery.network/ai-network/v1/chat/completions
VITE_AI_REACTION_URL=https://ai-reaction-backend.subquery.network
VITE_CONSUMER_CAMPAIGN_URL=https://consumer-campaign-api.subquery.network
VITE_GRAPHQL_AGENT=https://graphql-agent.subquery.network
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify environment variable consistency across all environment files.

The .env.staging file removed VITE_SUBQUERY_OFFICIAL_ETH_RPC, but src/hooks/useSpaceId.tsx still references it. Ensure this variable exists in the base .env file (not shown in the diff) to prevent staging environment failures.


🏁 Script executed:

#!/bin/bash
# Check if VITE_SUBQUERY_OFFICIAL_ETH_RPC is defined in the base .env file

if [ -f .env ]; then
  echo "=== Checking .env ==="
  grep -n "VITE_SUBQUERY_OFFICIAL_ETH_RPC" .env || echo "Variable not found in .env"
else
  echo ".env file not found"
fi

echo ""
echo "=== Checking all .env* files ==="
fd -t f '^\.env' --exec grep -l "VITE_SUBQUERY_OFFICIAL_ETH_RPC" {} \; || echo "Variable not found in any .env* files"

Length of output: 328



---

🏁 Script executed:

```shell
#!/bin/bash
# Re-run with corrected fd command to find all .env files including hidden ones
echo "=== Checking all .env* files (with hidden files) ==="
fd -H -t f '\.env' --exec grep -l "VITE_SUBQUERY_OFFICIAL_ETH_RPC" {} \;

echo ""
echo "=== Searching for VITE_SUBQUERY_OFFICIAL_ETH_RPC references in codebase ==="
rg -n "VITE_SUBQUERY_OFFICIAL_ETH_RPC" --type ts --type tsx --type js --type jsx

echo ""
echo "=== Display all .env files found ==="
fd -H -t f '\.env' | sort

Length of output: 229


🏁 Script executed:

#!/bin/bash
# Search with corrected rg syntax (tsx is part of ts type)
echo "=== Searching for VITE_SUBQUERY_OFFICIAL_ETH_RPC in TypeScript/JavaScript files ==="
rg -n "VITE_SUBQUERY_OFFICIAL_ETH_RPC" --type ts --type js

echo ""
echo "=== View content of .env.staging ==="
cat git/.env.staging 2>/dev/null || echo ".env.staging not readable"

echo ""
echo "=== View content of .env.testnet ==="
cat git/.env.testnet 2>/dev/null || echo ".env.testnet not readable"

echo ""
echo "=== Check if useSpaceId.tsx exists and its content ==="
find . -name "useSpaceId.tsx" -type f 2>/dev/null | head -1 | xargs cat 2>/dev/null || echo "useSpaceId.tsx not found or not readable"

Length of output: 3985


🏁 Script executed:

#!/bin/bash
# Look for all .env files at root and subdirectories
echo "=== All .env files in repository ==="
find . -maxdepth 3 -name '.env*' -type f 2>/dev/null | sort

echo ""
echo "=== Check if .env exists at root ==="
ls -la .env 2>/dev/null || echo ".env not found at root"

echo ""
echo "=== Search for VITE_SUBQUERY_OFFICIAL_ETH_RPC in ALL files ==="
rg "VITE_SUBQUERY_OFFICIAL_ETH_RPC" -n

echo ""
echo "=== Check other files that reference the variable ==="
rg -n "VITE_SUBQUERY_OFFICIAL_ETH_RPC" src/config/rainbowConf.tsx src/hooks/useEthersProvider.ts

Length of output: 893


🏁 Script executed:

#!/bin/bash
# Display the content of .env file
echo "=== Content of .env file ==="
cat .env

echo ""
echo "=== Search for VITE_SUBQUERY in .env ==="
grep "VITE_SUBQUERY" .env || echo "No VITE_SUBQUERY variables found"

echo ""
echo "=== Search for VITE_SUBQUERY in .env.staging ==="
grep "VITE_SUBQUERY" .env.staging || echo "No VITE_SUBQUERY variables found in .env.staging"

Length of output: 1004


VITE_SUBQUERY_OFFICIAL_ETH_RPC is missing from all environment files but actively used in code.

The concern is valid and critical. The variable VITE_SUBQUERY_OFFICIAL_ETH_RPC is referenced in four source files:

  • src/hooks/useSpaceId.tsx (lines 23, 49)
  • src/hooks/useEthersProvider.ts (line 62)
  • src/config/rainbowConf.tsx (line 32)

However, it is not defined in .env, .env.staging, or .env.testnet. This will cause runtime errors when the application attempts to access import.meta.env.VITE_SUBQUERY_OFFICIAL_ETH_RPC and receives undefined.

Add VITE_SUBQUERY_OFFICIAL_ETH_RPC to the .env file (and any environment-specific files where needed), or handle the undefined case in the dependent code.

🧰 Tools
🪛 dotenv-linter (4.0.0)

[warning] 13-13: [UnorderedKey] The VITE_GRAPHQL_AGENT key should go before the VITE_IPFS_GATEWAY key

(UnorderedKey)

🤖 Prompt for AI Agents
In .env around line 13, VITE_SUBQUERY_OFFICIAL_ETH_RPC is missing though several
source files reference import.meta.env.VITE_SUBQUERY_OFFICIAL_ETH_RPC; add this
environment variable to .env (and mirror into .env.staging and .env.testnet)
with the correct RPC URL value, or alternatively update the referenced code to
guard against undefined by providing a sensible default or throwing a clear
error when the variable is absent; ensure all environments used in CI/deploy
contain the new key.

3 changes: 1 addition & 2 deletions .env.staging
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ VITE_NETWORK=mainnet
VITE_GQL_PROXY=https://gql-proxy.subquery.network
VITE_NETWORK_DEPLOYMENT_ID=QmQqqmwwaBben8ncfHo3DMnDxyWFk5QcEdTmbevzKj7DBd
VITE_PROXYGATEWAY=https://gateway.subquery.network
VITE_SUBQUERY_OFFICIAL_BASE_RPC=https://base.rpc.subquery.network/public
VITE_SUBQUERY_OFFICIAL_ETH_RPC=https://ethereum.rpc.subquery.network/public
VITE_USE_SCANNER=1
VITE_GRAPHQL_AGENT=https://graphql-agent.subquery.network
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify that removed RPC environment variables are not referenced elsewhere.

The variables VITE_SUBQUERY_OFFICIAL_BASE_RPC and VITE_SUBQUERY_OFFICIAL_ETH_RPC were removed from this environment file. However, src/hooks/useSpaceId.tsx still references VITE_SUBQUERY_OFFICIAL_ETH_RPC at lines 23 and 49. This could result in undefined values being added to the RPC arrays, potentially breaking Web3 name resolution functionality.


🏁 Script executed:

#!/bin/bash
# Search for references to the removed environment variables

rg -n 'VITE_SUBQUERY_OFFICIAL_(BASE_RPC|ETH_RPC)' --type ts --type tsx -C 3

Length of output: 27


I need to retry the search with a corrected command. Let me search for these environment variable references using a different approach:


---

🏁 Script executed:

```shell
#!/bin/bash
# Search for references to the removed environment variables without tsx file type
rg -n 'VITE_SUBQUERY_OFFICIAL_(BASE_RPC|ETH_RPC)' --type ts -C 3

Length of output: 2642


🏁 Script executed:

#!/bin/bash
# Also search directly in the hooks directory to be thorough
rg -n 'VITE_SUBQUERY_OFFICIAL' src/hooks/ -C 3

Length of output: 1412


🏁 Script executed:

#!/bin/bash
# Check if the specific file exists and examine it
if [ -f "src/hooks/useSpaceId.tsx" ]; then
  echo "=== File exists. Examining lines around 20-30 and 45-55 ==="
  sed -n '15,35p' src/hooks/useSpaceId.tsx | cat -n
  echo ""
  sed -n '40,60p' src/hooks/useSpaceId.tsx | cat -n
else
  echo "File src/hooks/useSpaceId.tsx not found"
fi

Length of output: 1726


Remove references to deleted environment variables or restore them to .env.staging.

The removed variables VITE_SUBQUERY_OFFICIAL_BASE_RPC and VITE_SUBQUERY_OFFICIAL_ETH_RPC are still referenced in at least four locations:

  • src/hooks/useSpaceId.tsx (lines 23, 49): Variable is used in RPC array and as a parameter
  • src/hooks/useEthersProvider.ts (lines 61-62): Both variables are cast to string and used for RPC endpoints
  • src/config/rainbowConf.tsx (lines 31-32): Both variables are passed directly to HTTP transport configuration
  • src/pages/bridge/index.tsx (line 147): VITE_SUBQUERY_OFFICIAL_BASE_RPC is used for provider configuration

Removing these without updating all references will result in undefined values being passed to RPC endpoints, breaking Web3 name resolution, provider initialization, and bridge functionality.

🧰 Tools
🪛 dotenv-linter (4.0.0)

[warning] 11-11: [UnorderedKey] The VITE_GRAPHQL_AGENT key should go before the VITE_IPFS_GATEWAY key

(UnorderedKey)

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"localforage": "^1.10.0",
"lodash-es": "^4.17.21",
"lru-cache": "^6.0.0",
"lucide-react": "^0.544.0",
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify the lucide-react version for security and currency.

Ensure that version ^0.544.0 is the latest stable release and has no known security vulnerabilities.


🏁 Script executed:

#!/bin/bash
# Check for the latest version and any security advisories for lucide-react

# Check npm for latest version
npm view lucide-react version

# Check for security advisories using GitHub CLI
gh api graphql -f query='
{
  securityVulnerabilities(first: 5, ecosystem: NPM, package: "lucide-react") {
    nodes {
      advisory {
        summary
        severity
        publishedAt
      }
      vulnerableVersionRange
      firstPatchedVersion {
        identifier
      }
    }
  }
}'

Length of output: 57


Update lucide-react to the latest stable release (0.548.0).

The specified version 0.544.0 is not the latest stable release; version 0.548.0 is now available on npm. While the caret allows for updates within the minor/patch range, no known security vulnerabilities were found. Consider updating to the latest stable release to benefit from bug fixes and improvements.

🤖 Prompt for AI Agents
In package.json around line 56, the lucide-react dependency is pinned to
"^0.544.0"; update it to the latest stable release by changing the version to
"^0.548.0" and then run your package manager to update the lockfile (npm install
or yarn install) so the lockfile and node_modules reflect the new version; also
run tests/build to verify no regressions.

"p-limit": "^4.0.0",
"p-queue": "^7.3.4",
"postcss-import": "^15.1.0",
Expand Down
Loading