PR #290 MERGED: Server-Side History Filtering & Pagination in Steemit Wallet (Next.js)

in Steem Dev2 days ago (edited)

Hello community and fellow developers,

Great news! PR #290 has been merged into the Next.js version of the Steemit Wallet:
🔗 https://github.com/steemit/wallet/pull/290

This milestone delivers production-ready, server-optimized history query pipeline—reducing payload sizes, simplifying client logic, and improving scroll performance for wallet users worldwide.

ChatGPT Image May 22, 2026, 02_27_49 PM.png
Architecture overview: Server handles op-type filtering, batching & cursor pagination - Thanks ChatGPT


On Surface of PR 290

✅ Server-Side Op-Type Filtering (/api/query/history)

  • ops parameter active: Filter history by operation types (transfer, vote, comment, etc.) at the API layer—reducing client payload by up to 70% for focused views.
  • Smart batching: BATCH_SIZE and MAX_BATCHES safeguards prevent resource exhaustion while maintaining responsive infinite scroll.
  • Cursor pagination: nextFrom/exhausted metadata enables efficient, offset-free navigation through account history.
  • Redis resilience: Automatic fallback to cached history during node latency spikes ensures consistent UX.

✅ Streamlined Client Hooks

  • apiClient.getHistory: Now returns pre-filtered, normalized SteemHistoryItem[] with server-provided pagination state.
  • Hooks refactored:
    • use-batch-history.ts
    • use-rewards-history.ts
    • use-activity-history.ts
      All consume server-processed data—eliminating redundant client filtering and reducing re-renders.
  • Cleaner codebase: Legacy client-side filters marked @deprecated; migration path documented in-code.

✅ Centralized Operation Constants (src/lib/steem/history-ops.ts)

export const WALLET_OPS = ['transfer', 'transfer_to_vesting', 'withdraw_vesting', ...];
export const ACTIVITY_OPS = ['comment', 'vote', 'reblog', ...];
export const REWARD_OPS = ['author_reward', 'curation_reward', ...];
  • Single source of truth for op-type filtering across client/server.
  • normalizeHistoryItem() and cache-key utilities ensure consistent data shaping.

✅ Enhanced Security & Coverage

  • Redux DevTools sanitization: Extended to redact sensitive fields (auth_key, posting_key) in history payloads—continuing the security-first approach from PR #282.
  • Test suite expanded: Coverage for server filtering logic, cursor edge cases, Redis fallbacks, and hook integration.

✅ UI Polish

  • Removed unused icons from recent-activity components.
  • Snapshot tests updated; zero visual regressions.

🔄 For Developers: Quick Integration Note

Existing components continue to work unchanged. To leverage server filtering:

// Before: client-side filtering
const { data } = useActivityHistory({ account, types: ['transfer'] });

// After: server-side filtering (more efficient)
const { data, nextFrom, exhausted } = useActivityHistory({ 
  account, 
  ops: ['transfer'], 
  nextFrom, 
  exhausted 
});

No breaking changes—opt-in enhancement only.


✅ Validation Complete

  • [x] All tests passing (Jest + React Testing Library)
  • [x] Server filtering validated against live Steem nodes
  • [x] Cursor pagination edge cases covered
  • [x] Redis fallback behavior verified
  • [x] Redux DevTools sanitization confirmed
  • [x] Zero visual/functional regressions in activity/rewards tabs

📚 Contribution Series Recap

This merge continues a focused series of stability, security, and performance improvements to the Steemit Wallet:

PRStatusFocus
PR #290MERGEDServer-side history filtering, pagination, hook refactor
PR #285🟡 OpenRPC node failover system + accessibility fixes
PR #282✅ MergedRedux DevTools credential masking
PR #274✅ MergedSSR Redux store isolation fix
Issue #275🔍 ResolvedPrivate key exposure audit

Every contribution is designed to harden the wallet's foundation while keeping the developer experience smooth and the user experience fast.


Support Secure Steem Development

If you value proactive engineering, performance optimizations, and security-first contributions to the STEEM ecosystem, please consider supporting my witness: blaze.apps

🗳️ Vote Here:
Vote for blaze.apps Witness

Sort:  
Loading...