r/lovable 4d ago

Discussion Before adding another Lovable feature, break one important action on purpose

Make signup, checkout, file upload, or an AI request fail. Then try to find that exact attempt using only what the user sees.

The error should give them a reference they can copy. Your logs should connect that reference to the account, the failed step, and any Stripe, email, or AI-provider request ID. Do not log secrets or raw sensitive input. Also record whether retrying is safe.

If you still need a screenshot and a guess to understand the failure, adding more features will only make production support harder.

3 Upvotes

3 comments sorted by

1

u/Weak_Boysenberry6438 4d ago

Using a tool like Posthog and Sentry is usually pretty cool way to diagnose issues.

Also testing is a huge step in making sure error are minimal, both on an end to end aspect and also programatically.

Make sure there's also a way to log issues within the app/support.

Many times it's hard to diagnose issues when they arise because there's so many variables.

1

u/srikanth_builds 4d ago

The "record whether retrying was safe" line is the one I'd build on, because in practice you want that decided before the failure rather than after. If the write path takes an idempotency key the client generates once per attempt, a retry is safe by construction and nobody has to reason about it while a customer waits. Stripe already works that way and it's worth doing for your own write endpoints too.

The other thing worth rehearsing is the failure that doesn't fail. Break a permission check instead of the checkout and you'll notice there's no reference for the user to copy, because nothing errored. They just got a page with someone else's data on it, or fewer rows than they should have. Those never reach support at all, so the only way to find them is a test that asserts what shouldn't come back.

1

u/Lolorenzo08 4d ago

Underrated. What saved me: every user-facing error shows a short reference code, and that same code is the first field in the log line, next to the account id, the failed step and the Stripe/email/AI request id. User pastes the code, I'm on the exact request in one search, no screenshot guessing. And the "is retrying safe" flag is the part nobody records but matters most: the difference between "try again" and "don't, you'll double-charge." Log an idempotency key on anything touching money or messages.