PR #285 Enhancing Steemit Wallet: RPC Node Failover System + Accessibility Improvements (PR #285)

in Steem Dev2 days ago

Hello community and fellow developers ,

I'm excited to share another contribution to the Steemit Wallet codebase. PR #285 is now open and all tests are passing:
🔗 https://github.com/steemit/wallet/pull/285

This PR introduces two focused, production-ready improvements aimed at increasing reliability, developer flexibility, and accessibility compliance.


d6384d33-c227-48f6-b6bb-a0e75a68079d.png
Thanks to ChatGpt for the Image

1. Configurable Steem RPC Node Failover

Resilience and user choice are critical for a decentralized application. This update adds a robust, per-request RPC node selection system:

  • Predefined failover nodes: Added six Steem RPC endpoints to .env.example with comma-separated configuration support:
    api.steem.fans, api2.justyy.com, api.steemit.com, api.moecki.online, steem.senior.workers.dev, steemd.steemworld.org

  • Per-request node override: Refactored withFailover in server.ts to use AsyncLocalStorage, enabling the server to honor a preferred node via the X-Steem-RPC header—without altering existing method signatures. Remaining nodes act as automatic fallbacks.

  • Validation layer: Exported withRpcOverride and applyRpcOverride helper (src/lib/api/with-rpc-override.ts) to validate incoming header values against NEXT_PUBLIC_RPC_NODES before applying any override.

  • API route integration: Updated all twelve query API routes to wrap SteemService calls with applyRpcOverride, ensuring user-selected nodes are honoured on a per-request basis.

  • Client-side persistence: Added a new RPC node store (src/lib/rpc-node.ts) using the same module-level + useSyncExternalStore pattern as the theme store. Selections persist to localStorage and sync seamlessly across browser tabs.

  • Header propagation: Updated apiClient to automatically attach the X-Steem-RPC header on all query fetches.

  • UI selector: Added an RPC Node selector component in the SidePanel (visible only when multiple nodes are configured). Displays hostname labels and visually highlights the currently active node.

This system empowers users and developers to route traffic through trusted or low-latency nodes while maintaining graceful degradation during outages.


2. Accessibility Fixes for Modals and Navigation Drawer

Accessibility is non-negotiable. This PR resolves Radix UI console warnings and improves screen reader support:

  • Modal descriptions: Added sr-only DialogDescription elements to the transfer, power-down, and delegate modal branches. These modals previously had titles but no descriptions, triggering Radix UI warnings about missing accessible descriptions.

  • Navigation drawer handling: Added aria-describedby={undefined} to SheetContent in SidePanel, explicitly indicating that this navigation drawer intentionally has no description—preventing false accessibility warnings.

These changes ensure the wallet meets modern ARIA standards without altering visual design or user flow.


Testing & Validation

✅ All unit and integration tests pass
✅ RPC node selection persists across reloads and syncs between tabs
X-Steem-RPC header is correctly sent and respected server-side
✅ Radix UI warnings eliminated from console
✅ No visual or functional regressions in modal or drawer behavior


Part of an Ongoing Contribution Series

This PR continues a series of security and stability improvements I've been contributing to the Steemit Wallet:

Every contribution is focused on hardening the wallet's security posture, improving developer experience, and ensuring a reliable foundation for the Steem ecosystem.


Support Secure Steem Development

If you value proactive security work and feature innovation for the STEEM ecosystem, please consider supporting my witness: blaze.apps

🗳️ Vote Here:
Vote for blaze.apps Witness

Sort:  
Loading...