Skip to content

Refactor graph storage limits and update @robosystems/client to 0.2.45#116

Merged
jfrench9 merged 2 commits intomainfrom
refactor/graph-storage-limits
Apr 6, 2026
Merged

Refactor graph storage limits and update @robosystems/client to 0.2.45#116
jfrench9 merged 2 commits intomainfrom
refactor/graph-storage-limits

Conversation

@jfrench9
Copy link
Copy Markdown
Member

@jfrench9 jfrench9 commented Apr 6, 2026

Summary

This PR refactors how graph storage limits are handled across the application by removing redundant storage usage tracking from the UsageContent component and shifting to instance-based storage limits provided through the service offerings context. It also bumps @robosystems/client to version 0.2.45 for improved functionality and compatibility.

Changes

Package Update

  • Updated @robosystems/client from previous version to 0.2.45 in both package.json and package-lock.json, which likely provides the new instance storage limit API that this refactor depends on.

UsageContent Component (src/app/(app)/usage/content.tsx)

  • Significant simplification — removed storage usage handling logic (~30 lines removed), stripping out what was previously a manual storage usage calculation/display concern from this component.
  • The component now delegates storage limit concerns to other parts of the system, reducing its responsibility and complexity.

Service Offerings Context (src/lib/core/contexts/service-offerings-context.tsx)

  • Refactored to use instance storage limit instead of the previous graph-tier-based storage limit approach.
  • Simplified the context logic, reducing coupling between service offerings and graph tier definitions.

Tests (src/lib/core/lib/__tests__/graph-tiers.test.ts)

  • Removed 12 lines of tests related to graph tier storage limits that are no longer relevant after this refactor.

Key UI/UX Improvements

  • No visible UI regressions expected — storage limits are now sourced from instance-level configuration rather than being computed from graph tiers, which should provide more accurate and consistent limit information to users.
  • The usage page should continue to display relevant usage data, just without the now-unnecessary storage usage section.

Breaking Changes

  • Potentially breaking if any downstream code or components relied on storage usage data previously exposed by UsageContent or the old graph-tier-based storage limits from the service offerings context.
  • The @robosystems/client bump to 0.2.45 may introduce API changes — consumers of this package should verify compatibility.

Testing Notes for Reviewers

  1. Usage Page: Navigate to the /usage page and verify it renders correctly without errors. Confirm that the removal of storage usage display is intentional and that no blank/broken sections appear.
  2. Service Offerings Context: Verify that components consuming the service offerings context still receive correct storage limit values — these should now reflect instance-level limits.
  3. Regression Testing: Check any features that previously depended on graph-tier storage limits (e.g., upgrade prompts, limit warnings, storage progress bars) to ensure they still function correctly with the new instance storage limit source.
  4. Deleted Tests: Confirm the removed test cases in graph-tiers.test.ts are truly obsolete and that no untested logic gaps remain. Run the full test suite to verify no failures.

Browser Compatibility Considerations

  • No browser-specific changes introduced. All modifications are data-flow and logic refactors with no new DOM APIs, CSS features, or browser-dependent behavior.
  • Standard testing across Chrome, Firefox, Safari, and Edge is sufficient.

🤖 Generated with Claude Code

Branch Info:

  • Source: refactor/graph-storage-limits
  • Target: main
  • Type: feature

Co-Authored-By: Claude noreply@anthropic.com

jfrench9 added 2 commits April 5, 2026 19:46
…update service offerings context to use instance storage limit. Adjust related tests to reflect changes in graph tier limits.
…age-lock.json for improved functionality and compatibility.
@jfrench9
Copy link
Copy Markdown
Member Author

jfrench9 commented Apr 6, 2026

@claude please review this PR

@claude
Copy link
Copy Markdown

claude bot commented Apr 6, 2026

Claude finished @jfrench9's task in 1m 20s —— View job


PR Review

  • Gather context
  • Read changed files
  • Analyze diff
  • Post review feedback

Overall this is a clean, well-scoped refactor. The code reduction (~61 lines deleted) is real simplification, not just deletion. A few observations below.

src/app/(app)/usage/content.tsx

Positive: Removing the isRepo-conditional splice logic (lines 111–140 old) was the right call. That pattern was fragile — inserting into an array at a positional index and then destructuring based on a flag. The new flat Promise.allSettled with named destructuring is much clearer.

Observation — storage display still works via getGraphLimits: The UI Storage Usage card at line 392 now uses data.graphLimits.storage (populated from getGraphLimits), which means storage info is now fetched as part of the limits call rather than a separate endpoint. This is a clean consolidation — confirm that getGraphLimits returns the storage sub-object for all graph types.

Minor — stale mock: getStorageUsage is still exported in src/__mocks__/@robosystems/client.js:117 but is no longer used anywhere. Not a bug, but worth cleaning up to avoid confusion.

src/lib/core/contexts/service-offerings-context.tsx

The instanceStorageLimitGb field appears to be unused downstream. After searching the codebase, instanceStorageLimitGb is only referenced in this context file — no component reads it from offerings.graphPlans[tier].instanceStorageLimitGb. If this is intentional (future use), a brief comment would help; if it was meant to replace the storage display logic in content.tsx, the wiring is missing.

Fix this →

Removed limits.maxNodes / limits.maxRelationships: Confirmed these fields were not consumed anywhere in the codebase, so removal is safe.

src/lib/core/lib/__tests__/graph-tiers.test.ts

Removing the limits field from the mock GraphTier objects is correct if the GraphTier type no longer includes it. However, there are no new tests covering instanceStorageLimitGb behavior in the service offerings context. Given that this is a core shared library, a test verifying that instanceStorageLimitGb is correctly mapped from tier.instance_storage_limit_gb in the context transformation would add confidence.

Summary

Assessment
content.tsx refactor ✅ Clean simplification
service-offerings-context.tsx ⚠️ instanceStorageLimitGb added but not yet consumed
Removed limits (maxNodes/maxRelationships) ✅ Confirmed no consumers
Deleted tests ✅ Appropriate, but missing new coverage for instanceStorageLimitGb mapping
Stale mock ⚠️ Minor cleanup opportunity in src/__mocks__/@robosystems/client.js:117

The PR is in good shape. The main question to answer before merging: is instanceStorageLimitGb intentionally added for future use, or should it already be wired to a consuming component?

@jfrench9 jfrench9 merged commit ec55183 into main Apr 6, 2026
7 checks passed
@jfrench9 jfrench9 deleted the refactor/graph-storage-limits branch April 6, 2026 01:15
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