Fixing the BFF Routing Bug That Was Silently Misdirecting All API Calls
Fixing the BFF Routing Bug That Was Silently Misdirecting All API Calls
Release: v0.1.83 | Type: Critical Bug Fix
What happened
In src/app/api/bff/[...path]/route.ts, a helper function called ppPath() was responsible for building the URL paths that the BFF (Backend-for-Frontend) layer uses when calling the AgentOS (letmc.com) REST API.
The function was prepending the following prefix to every outbound API call:
/v1/corporate/peopleportal/letmcletting/{clientName}
This prefix is only correct for file upload endpoints. All other AgentOS API calls — covering landlord data, tenant data, contractor data, buyer data, and messaging — should be routed using:
/{clientName}/...
Because every ppGet and ppPost call in the BFF was going through ppPath(), all non-upload data requests were being sent to invalid URLs on the letmc.com API.
Why it was hard to spot
The upload endpoints in src/lib/letmc/upload.ts were already handling their own path construction independently and correctly — they never relied on ppPath(). This meant uploads worked fine, which could give a false impression that the BFF routing layer was healthy.
The breakage was isolated to the BFF API proxy layer ([...path]/route.ts), not the underlying service files in src/lib/letmc/*, which also construct their own correct paths.
The fix
The ppPath() function has been corrected to return:
// Before (incorrect)
`/v1/corporate/peopleportal/letmcletting/${clientName}${suffix}`
// After (correct)
`/${clientName}${suffix}`
This aligns BFF proxy calls with the path structure expected by the AgentOS API for all standard (non-upload) endpoints.
What is affected
Fixed in this release
All ppGet and ppPost calls routed through the BFF for:
- Landlord routes — property data, financial statements, inspections, etc.
- Tenant routes — tenancy details, maintenance, documents, etc.
- Contractor routes — job details, scheduling, etc.
- Buyer routes — offer status, property details, etc.
- Messaging routes — inbox, conversations, etc.
Unaffected
The following endpoints were already working correctly and are not changed by this fix:
maintenance-requestuploadstenancy-applicationuploadsgeneric/uploaduploads- All service files in
src/lib/letmc/*
Upgrade notes
This fix is included in v0.1.83 and requires no configuration changes. Deployments running v0.1.82 or earlier should upgrade immediately — on affected versions, all portal data views (landlord dashboard, tenant portal, contractor jobs, buyer offers, and messaging) will be returning errors or empty data due to the misdirected API calls.