Skip to content
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(stats): fixes syntax for api prod version #683

Merged
merged 1 commit into from
Jan 21, 2025
Merged

Conversation

stalniy
Copy link
Contributor

@stalniy stalniy commented Jan 21, 2025

refs #645

Why

after deploying changes to beta, it appeared that I used wrong variable in reduce which was not initialized and /network-capacity request failed with 500 error:

{
    "severity": "ERROR",
    "@type": "type.googleapis.com/google.devtools.clouderrorreporting.v1beta1.ReportedErrorEvent",
    "time": "2025-01-21T11:01:46.704Z",
    "context": "ErrorHandler",
    "traceId": "7542356c94be395186f49cce02a27021",
    "spanId": "8a3f58664923dbca",
    "traceFlags": 1,
    "message": "ReferenceError: Cannot access 'stats' before initialization\n    at filteredProviders.reduce.activeCPU (/app/apps/api/dist/server.js:551416:13)\n    at Array.reduce (<anonymous>)\n    at /app/apps/api/dist/server.js:551415:41\n    at Generator.next (<anonymous>)\n    at fulfilled (/app/apps/api/dist/server.js:551379:58)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)"
}

Stacktrace:

ReferenceError: Cannot access 'stats' before initialization
    at filteredProviders.reduce.activeCPU (/app/apps/api/dist/server.js:551416:13)
    at Array.reduce (<anonymous>)
    at /app/apps/api/dist/server.js:551415:41
    at Generator.next (<anonymous>)
    at fulfilled (/app/apps/api/dist/server.js:551379:58)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

@stalniy stalniy requested a review from a team as a code owner January 21, 2025 11:22
@stalniy stalniy merged commit e2bc02d into main Jan 21, 2025
5 checks passed
@stalniy stalniy deleted the fix/network-capacity branch January 21, 2025 11:52
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.

2 participants