Skip to content

471 472 473 474 frontend fixes#487

Merged
Dev-AdeTutu merged 5 commits into
Dev-AdeTutu:mainfrom
Able-faz-system:471-472-473-474-frontend-fixes
Jun 28, 2026
Merged

471 472 473 474 frontend fixes#487
Dev-AdeTutu merged 5 commits into
Dev-AdeTutu:mainfrom
Able-faz-system:471-472-473-474-frontend-fixes

Conversation

@Able-faz-system

Copy link
Copy Markdown
Contributor

Summary

Fix four frontend security and UX issues across payment store, wallet connection, payment history, and collaborator management.

Changes

Issue #471: Handle 502 RPC errors in history page

File: frontend/src/app/history/page.tsx

  • Added null/undefined checks before destructuring payments from response
  • Reset records and pagination state on error
  • Display user-friendly error message instead of crashing
  • Why: When Stellar RPC is unavailable, the API returns 502 with error object. Without response validation, destructuring fails with TypeError: Cannot destructure property 'payments' of undefined

Issue #472: Guard against Freighter extension not being installed

File: frontend/src/store/walletStore.ts

  • Added window.freighter presence check before calling wallet API
  • Throw descriptive error for missing extension
  • Existing error handler catches and displays user-friendly message
  • Why: Prevents ReferenceError crash when calling kit.openModal() on systems without Freighter installed

Issue #473: CollaboratorTable refreshes data after add/remove

File: frontend/src/components/CollaboratorTable.tsx

  • Implemented missing handleAddSubmit() and handleRemove() functions
  • Added onRefresh callback prop to reload collaborator list after mutations
  • Added toast notifications for success/error feedback
  • Removed stale data by refetching from parent component after operations
  • Why: Without refetching, removed collaborators remained visible in the table until manual page refresh

Issue #474: Remove persist middleware from paymentStore

File: frontend/src/store/paymentStore.ts

  • Removed zustand/middleware persist import
  • Removed persist wrapper from store creation
  • Store now only maintains state in memory (cleared on session end)
  • Why: Sensitive meterId was persisting to localStorage indefinitely, allowing a subsequent user on a shared device to see the previous user's meter ID pre-filled in the payment form

Testing Checklist

  • History page displays error message gracefully when RPC is unavailable
  • Payment form no longer pre-fills meter ID on new sessions
  • Wallet connect shows error when Freighter is not installed
  • Adding collaborator triggers list refresh and shows success toast
  • Removing collaborator triggers list refresh and shows success toast

Closes

Closes #471
Closes #472
Closes #473
Closes #474

- Added null/undefined checks before destructuring response data
- Clear error state and reset records/pagination on error
- Prevents TypeError when API returns error responses
…t being installed

- Added check for window.freighter before calling wallet API
- Prevents ReferenceError when extension is not present
- Shows user-friendly error message when wallet is not installed
…er add/remove

- Implemented missing handleAddSubmit and handleRemove functions
- Added onRefresh callback to reload collaborator list after mutations
- Added toast notifications for user feedback on add/remove operations
- Accepts both onAdd and onRemove callbacks from parent component
…ntStore

- Removed zustand persist middleware to prevent meterId leaking to localStorage
- Sensitive meter ID data no longer persists across sessions
- Prevents unauthorized access to previous user's meter ID on shared devices
@drips-wave

drips-wave Bot commented Jun 28, 2026

Copy link
Copy Markdown

@Able-faz-system Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Dev-AdeTutu Dev-AdeTutu merged commit c6ef7ab into Dev-AdeTutu:main Jun 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment