Skip to content

fix(seed-fear-greed): declare _proxyAuth — resolves ReferenceError in fetchAll()#2540

Merged
koala73 merged 1 commit intomainfrom
fix/fear-greed-proxy-auth-undeclared
Mar 30, 2026
Merged

fix(seed-fear-greed): declare _proxyAuth — resolves ReferenceError in fetchAll()#2540
koala73 merged 1 commit intomainfrom
fix/fear-greed-proxy-auth-undeclared

Conversation

@koala73
Copy link
Copy Markdown
Owner

@koala73 koala73 commented Mar 30, 2026

Summary

  • _proxyAuth was referenced in the console.log source summary at line 362 but never declared
  • This caused a ReferenceError on every seeder run in strict ES module mode
  • runSeed() catches the error and extends TTL without writing seed-meta, so FSI stays stale

Fix

Import resolveProxyForConnect from _seed-utils.mjs and declare const _proxyAuth at module level.

Test plan

  • Verify seeder no longer crashes with ReferenceError: _proxyAuth is not defined
  • Confirm proxy=yes or proxy=no appears correctly in Railway container logs

… fetchAll()

`_proxyAuth` was referenced in the log line at line 362 but never
declared, causing a ReferenceError on every seeder run. Import
`resolveProxyForConnect` and declare it at module level.
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
worldmonitor Ignored Ignored Mar 30, 2026 5:14am

Request Review

@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Mar 30, 2026

Greptile Summary

This PR fixes a ReferenceError that crashed the fear-and-greed seeder on every run. The _proxyAuth variable was used in a diagnostic console.log at line 364 but never declared; in strict ES module mode this throws unconditionally, causing runSeed() to catch the error, extend TTL without writing seed-meta, and leave FSI data stale.

Changes:

  • Adds resolveProxyForConnect to the named imports from _seed-utils.mjs
  • Declares _proxyAuth at module scope via the new import, after loadEnvFile() so env vars are already populated

No issues found. The fix is minimal and correct: the function is synchronous so module-level placement is safe, the underlying helper returns an empty string (falsy) when no proxy is configured so the 'yes'/'no' log check works correctly in both cases, and loadEnvFile runs before resolveProxyForConnect() in source order ensuring proxy env vars are loaded first.

Confidence Score: 5/5

Safe to merge — single-line bug fix with no side effects

The change is a minimal, correct fix for a confirmed ReferenceError. All call-site invariants (synchronous function, correct env-load ordering, falsy-empty-string check) are satisfied. No P1 or P0 issues found.

No files require special attention

Important Files Changed

Filename Overview
scripts/seed-fear-greed.mjs Adds resolveProxyForConnect import and module-level _proxyAuth declaration to fix a ReferenceError that was crashing every seeder run in strict ES module mode

Sequence Diagram

sequenceDiagram
    participant Node as Node.js (ES module)
    participant SeedFG as seed-fear-greed.mjs
    participant Utils as _seed-utils.mjs
    participant Proxy as _proxy-utils.cjs

    Node->>SeedFG: execute module (top-level)
    SeedFG->>Utils: loadEnvFile(import.meta.url)
    Note over Utils: loads proxy env vars into process.env
    SeedFG->>Utils: resolveProxyForConnect()
    Utils->>Proxy: resolveProxyStringConnect()
    Proxy-->>Utils: user:pass@host:port or empty string
    Utils-->>SeedFG: _proxyAuth (string)
    Note over SeedFG: module-level const _proxyAuth now defined
    SeedFG->>SeedFG: fetchAll() → console.log(proxy=yes/no)
    Note over SeedFG: Before fix: ReferenceError thrown here
Loading

Reviews (1): Last reviewed commit: "fix(seed-fear-greed): declare _proxyAuth..." | Re-trigger Greptile

@koala73 koala73 merged commit 4fe3bf9 into main Mar 30, 2026
8 checks passed
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.

1 participant