Production Audit Report

Deep audit of pages, data, workflows, integrations & security

4

Critical

6

High

12

Fixed

5

Open

CRIT-001
Critical
Data
Fixed

Hardcoded Mock Listing Data

📍 pages/Booking.jsx

Booking page used a hardcoded mock listing instead of fetching real listing data from the database.

✅ Fix Applied: Now fetches real Listing entity by listing_id from reservation.
CRIT-002
Critical
Security
Fixed

Raw Card Data Sent to Backend

📍 functions/stripe.js — createPaymentMethod

The createPaymentMethod action accepted raw card numbers (number, exp_month, exp_year, cvc) via API. This is a PCI-DSS violation.

✅ Fix Applied: Action now only accepts pre-tokenized paymentMethod IDs from Stripe.js. Raw card fields removed.
CRIT-003
Critical
Integration
Fixed

Double Platform Fee (13% applied twice)

📍 components/payments/StripeCheckout.jsx + functions/stripe.js

Frontend already adds 13% to total, then backend adds 13% again on top via apply_platform_fee=true, resulting in ~27% overcharge.

✅ Fix Applied: Set apply_platform_fee=false in frontend since fee is already included in the displayed total.
CRIT-004
Critical
Action
Fixed

Request Body Read After Auth (Consumed Stream)

📍 functions/processBookingWorkflow.js

req.json() was called AFTER base44.auth.me() which internally reads the request body, causing body to be empty/consumed.

✅ Fix Applied: Body is now parsed first before any auth calls.
HIGH-001
High
Data
Fixed

No Balance Deduction on Send Money

📍 pages/Wallet.jsx

handleSendMoney created a transaction record but never deducted from the sender wallet or credited the recipient wallet.

✅ Fix Applied: Now updates both sender and recipient wallet balances atomically with proper validation.
HIGH-002
High
Data
Fixed

No Input Validation on Send Money

📍 pages/Wallet.jsx

No checks for: amount > 0, amount <= balance, self-transfer, valid recipient.

✅ Fix Applied: Added validation for all edge cases including self-transfer and insufficient balance.
HIGH-003
High
Data
Fixed

Fetching ALL Reservations to Find One

📍 pages/Booking.jsx — Reservation.list()

Used Reservation.list() (returns all records) then .find() client-side. Extremely slow at scale, loads unnecessary data.

✅ Fix Applied: Replaced with Reservation.filter({ id: reservationId }) for direct lookup.
HIGH-004
High
Page
Fixed

Hardcoded Listing Title, Address & Image

📍 pages/Bookings.jsx

Bookings list displayed "Amazing stay in south beach" and "2301 collins ave" hardcoded for ALL reservations.

✅ Fix Applied: Now fetches and displays real listing data per reservation.
HIGH-005
High
Performance
Fixed

3-Second Polling Loop (N×2 queries each tick)

📍 pages/Messages.jsx

setInterval every 3 seconds fires 2 DB queries per tick (sent + received). At 100 active users = ~4000 queries/minute.

✅ Fix Applied: Replaced with real-time base44 entity subscription.
HIGH-006
High
Action
Fixed

15-Minute setTimeout Memory Leak

📍 pages/Messages.jsx — sendFriendRequest()

setTimeout(..., 900000) holds a closure in memory for 15 minutes, never cleaned up if component unmounts.

✅ Fix Applied: Removed setTimeout, replaced with direct non-blocking function invocation.
MED-001
Medium
Page
Fixed

Payment Allowed Before Terms Accepted

📍 pages/Booking.jsx

StripeCheckout rendered and usable even when agreedToTerms=false. User could pay without agreeing.

✅ Fix Applied: Added disabled prop on StripeCheckout and visible warning when terms not accepted.
MED-002
Medium
Data
Fixed

Zero Nights Causes $0 Booking

📍 pages/Booking.jsx — calculatePricing()

If check_in and check_out are the same day, differenceInDays returns 0, making total = $0.

✅ Fix Applied: Applied Math.max(1, nights) to ensure minimum 1 night charge.
MED-003
Medium
Automation
Open

Zero Automations Configured

📍 App-wide

No scheduled automations exist for: checkout reminders, review requests, booking expiry, payment retries, or inactive user cleanup.

🔧 Recommended Fix: Recommend creating automations for: daily checkout reminder, post-checkout review request, 24h unpaid reservation expiry.
MED-004
Medium
Security
Open

Add Funds Buttons Do Nothing

📍 pages/Wallet.jsx — Add Funds tab

$50/$100/$200 preset buttons and custom amount field have no onClick handlers — dead UI.

🔧 Recommended Fix: Connect to Stripe payment intent flow for wallet top-up.
MED-005
Medium
Security
Open

Hardcoded Mock Card "4242"

📍 pages/Wallet.jsx — Payment tab

Payment Methods tab shows a hardcoded "Visa ending in 4242" placeholder — not real data.

🔧 Recommended Fix: Connect to Stripe listPaymentMethods to show real saved cards.
LOW-001
Low
Page
Open

Edit Dates/Guests Buttons Are Non-Functional

📍 pages/Booking.jsx

"Edit" buttons next to Dates and Guests in the booking summary do nothing.

🔧 Recommended Fix: Implement date/guest edit flow or remove buttons to avoid confusion.
LOW-002
Low
Performance
Open

Loads ALL Users (200) on Every Post Render

📍 pages/SocialProfile.jsx

Post enrichment fetches up to 200 real users + 200 synths on every loadPosts call.

🔧 Recommended Fix: Cache user map in component state; only fetch users not already in cache.
LifeShare

Install LifeShare

Add it to your device for a faster, app-like experience.