Skip to content

fix: NaN averages, state mutation, TreeView selection, formatBytes, refreshInterval#142

Merged
tyevco merged 1 commit into
mainfrom
fix/code-analysis-round-10
Mar 1, 2026
Merged

fix: NaN averages, state mutation, TreeView selection, formatBytes, refreshInterval#142
tyevco merged 1 commit into
mainfrom
fix/code-analysis-round-10

Conversation

@tyevco

@tyevco tyevco commented Mar 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Code analysis round 7 — fixes 5 bugs with 10 new unit tests:

  • GraphQL DevTools: Fix NaN averageExecutionTime on first operation — this.state.operations was a pre-add snapshot so 0/0 = NaN; now includes current operation in calculation with length guard
  • Auth Permissions Mock: Replace .push() state mutations with immutable spread patterns — getState() returns shallow copy so inner arrays were shared references
  • TreeView: Fix selectedIds={[]} unable to clear selection — selectedIds.length > 0 condition fell back to internal state; now uses !== undefined controlled/uncontrolled pattern
  • formatBytes: Fix sub-byte fractional values (e.g., 0.0001) producing undefined unit — negative Math.floor(Math.log(...)) index clamped with Math.max(0, ...)
  • FeatureFlagManager: Fix refreshInterval: undefined creating tight setInterval loop — explicit ?? 30000 after options spread

Test plan

  • 4 new tests for GraphQL DevTools average execution time (NaN guard, multi-op average, ops without executionTime, slowest/fastest tracking)
  • 2 new tests for TreeView controlled selection clearing
  • 2 new tests for formatBytes sub-byte values
  • 2 new tests for FeatureFlagManager refreshInterval safety
  • Full typecheck passed (27/27 projects)
  • Full test suite passed (27/27 projects)

…ng, formatBytes underflow, refreshInterval guard
@nx-cloud

nx-cloud Bot commented Mar 1, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 0a6eb43

Command Status Duration Result
nx run-many --target=build --projects=tag:scope... ⛔ Cancelled 47m 49s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-01 16:10:34 UTC

@tyevco tyevco merged commit cd0f660 into main Mar 1, 2026
6 of 15 checks passed
@tyevco tyevco deleted the fix/code-analysis-round-10 branch March 1, 2026 15:21
@github-actions

github-actions Bot commented Mar 1, 2026

Copy link
Copy Markdown
Contributor

Bundle Sizes

  • devtools-common: 13.9 KiB
  • devtools-common: 14.6 KiB
  • devtools-importer: 5.0 KiB
  • devtools-importer: 30.2 KiB
  • feature-flags: 22.5 KiB
  • feature-flags: 22.8 KiB
  • i18n: 22.2 KiB
  • i18n: 22.5 KiB
  • logger: 21.2 KiB
  • logger: 21.3 KiB
  • plugin-core: 13.6 KiB
  • plugin-core: 13.8 KiB
  • shared-components: 315.4 KiB
  • shared-components: 324.3 KiB

@github-actions

github-actions Bot commented Mar 1, 2026

Copy link
Copy Markdown
Contributor

PR Validation Summary

Overall Status: FAILED

Check Results:

  • ✅ changes: success
  • ✅ validate-pr: success
  • ❌ lint-shared: failure
  • ✅ test-affected-plugins: success
  • ✅ security-check: success

Changes Detected:

  • Shared Packages: ✅
  • Plugin Packages: ✅
  • Workflows: ❌

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