Skip to content

fix(keychain): cap profile history queries and gate fetches#2490

Merged
broody merged 1 commit intomainfrom
fix/transfer-history-limit
Mar 15, 2026
Merged

fix(keychain): cap profile history queries and gate fetches#2490
broody merged 1 commit intomainfrom
fix/transfer-history-limit

Conversation

@MartianGreed
Copy link
Copy Markdown
Contributor

Summary

  • cap profile transfer/activity history queries to a bounded default (100) instead of unbounded fetches
  • gate history queries to account profile routes only so non-profile flows (like execute) do not load large history payloads
  • add provider tests to lock in the query cap and route-gating behavior

Why

Unbounded transfer history requests can return very large payloads and stall the keychain iframe, leading to execution timeouts in games that submit repeated actions.

Testing

  • pnpm --filter @cartridge/keychain test:ci src/components/provider/data.test.ts
  • pnpm --filter @cartridge/keychain lint src/components/provider/data.tsx src/components/provider/data.test.ts

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 14, 2026

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

Project Deployment Actions Updated (UTC)
controller-example-next Ready Ready Preview Mar 14, 2026 5:33pm
keychain Ready Ready Preview Mar 14, 2026 5:33pm
keychain-storybook Ready Ready Preview Mar 14, 2026 5:33pm

Request Review

@claude
Copy link
Copy Markdown
Contributor

claude bot commented Mar 15, 2026

Claude finished @MartianGreed's task —— View job


Analyzing changes for documentation impact

  • Read changed files to understand the scope
  • Determine if changes are user-facing
  • Check existing documentation
  • Evaluate documentation update need

Analysis Complete

No documentation updates needed.

Reasoning:

This PR implements an internal performance optimization that does not affect user-facing behavior:

  1. Internal implementation details: The changes cap transfer/activity history queries to 100 items and gate fetching to only /account/ routes. These are internal query optimizations within the keychain's data provider component.

  2. No API changes: There are no new public APIs, configuration options, or user-controllable parameters. Users cannot configure the history limit or control when history is fetched.

  3. No behavioral changes: From a user perspective, the inventory and profile pages work exactly the same way. The optimization improves performance by preventing unbounded queries, but this is transparent to users.

  4. Existing docs remain accurate: The inventory documentation describes how to configure tokens and open the inventory modal. None of that functionality changed.

Following the directive "DEFAULT TO NO CHANGES" — this is a performance fix/refactor without user-facing impact.


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