feat: wallet connect/disconnect UX, admin DLQ dashboard, notification…#1028
Merged
pope-h merged 3 commits intoMay 30, 2026
Conversation
… bell WS, rent affordability pre-screener
|
Someone is attempting to deploy a commit to the pope-h's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@ExcelDsigN-tech 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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: Freighter Wallet UI, Admin Dead-Letter Dashboard, Real-Time Notifications, and Rent Pre-Screener | Closes #1001, Closes #1002, Closes #1005, Closes #1006
Overview
This PR delivers four independent but complementary product features. Freighter wallet
integration adds a complete connect and disconnect UX to the navbar, backed by a React context
and a typed utility wrapper, enabling self-custody authentication and transaction signing for
downstream components. An admin dead-letter queue dashboard exposes failed outbox events via
paginated REST endpoints and a filterable frontend table, giving super admins the ability to
inspect, retry, and dismiss records that previously accumulated silently. Real-time in-app
notifications are wired through a JWT-authenticated WebSocket server attached to the existing
Express instance, with a bell component that updates unread counts instantly and falls back to
polling when the socket is unavailable. A client-only rent affordability pre-screener wizard
lets tenants self-assess eligibility in three steps before submitting a formal application,
reducing wasted applications without requiring account creation or any backend calls.
Feature Summary
a truncated public key with a disconnect option when connected
states with the truncated address
isFreighterInstalled, and signTransaction over the @stellar/freighter-api package
the component tree, with connection state persisted in localStorage across navigations
no console errors when the extension is absent
/api/admin/outbox/dead-letter, all gated behind super_admin role enforcement
in a single request
capped at 200 characters, and per-row retry and dismiss actions
connections via JWT query parameter and maintaining a per-user connection map
connection immediately after DB write, with DB persistence independent of delivery success
backoff up to five retries, and local notification state
mark-all-read action; falls back to 30-second polling when the WebSocket is unavailable
listing cards via a listingId query parameter
and back navigation on all wizard steps
Technical Implementation
Freighter Wallet Integration (#1001):
extension object on window before any other call to prevent reference errors in
environments where the extension is absent
written to localStorage under a fixed key so WalletContext can rehydrate on mount
is required as Freighter manages extension-side session state independently
API, and returns the signed XDR for submission by the calling component
it sets connected to true without re-prompting the user
Install Freighter anchor tag pointing to the official extension install URL rather than
triggering the connect flow
Admin Dead-Letter Dashboard (#1002):
middleware guard is applied to the router before any handler is reached, returning 403
for callers without the required role
status = 'dead_lettered', ordered by last_attempted_at descending, with limit and
offset derived from page and pageSize query params defaulting to page 1 and 20 per page
the record is then picked up by the existing outbox processor on its next poll cycle
the same reset in a single transaction
user ID, the record ID, and the UTC timestamp before removing the record from the
dead-letter view
and removes it from the list on success; dismiss fades the row out after modal
confirmation; both revert on API error
the full payload in a pre-formatted block
Real-Time Notification Bell (#1005):
attached to the existing HTTP server instance via the server option of the ws Server
constructor, avoiding a second port
URL, verifies the JWT using the shared auth secret, and closes the connection with code
4001 if verification fails; authenticated connections are stored in a
Map<userId, WebSocket>
in the connection map; if a socket is found and its readyState is OPEN it sends a JSON
message matching the agreed format; the DB write is not conditional on socket availability
query param; on open it sets connected state; on message it parses the payload and
prepends the notification to the local list, incrementing the unread count; on close it
schedules a reconnect using Math.pow(2, attempt) * 1000ms delay up to five attempts
before switching to the 30-second polling fallback
the dropdown lists the ten most recent items; mark-all-read calls the existing read
endpoint and resets the local unread counter to zero
Rent Affordability Pre-Screener (#1006):
(monthlyRent / monthlyNetIncome <= 0.4), mapEmploymentLikelihood returning a band string
per employment status enum, and checkDepositReadiness comparing the user's deposit
percentage against the listing minimum or the generic 20 to 40 percent range
one fail maps to Moderate, two or more fails maps to Low
local state; back navigation decrements the index; the result screen is rendered when
currentStep equals three
deposit step to fetch the listing's minimum deposit requirement from the listings store
if the listing is already cached client-side; no network request is made
explanation, and CTA button; the Strong CTA links to the application form with the
listing ID pre-populated if available
Test Coverage
connect returning public key, connect with extension absent returning a typed error,
disconnect clearing localStorage, isFreighterInstalled returning false when window object
lacks the extension, and signTransaction passing through the signed XDR
disconnect
shape, retry resets status and retry count, bulk retry updates all matching records,
delete writes audit log entry, and all four endpoints return 403 for a caller without
super_admin role
confirmation flow, and error state revert
authenticated connection stored in the map, message delivery to an open socket, and
no delivery attempt when no socket is present for the user
unread count increment, exponential backoff reconnect scheduling across five attempts,
and polling fallback activation after max retries
each employment status mapping to the correct band, deposit pass and fail, and
computeOverallBand for all three result combinations
seeding the deposit step, and correct band rendered on the result screen for Strong,
Moderate, and Low input combinations
Checklists
and signTransaction