Urgent.News

What's breaking now, across hundreds of outlets.

Tech

How to Manage API Changes Without Breaking Frontend Applications

Most frontend outages caused by APIs are not dramatic. Nobody deletes the database. Someone renames user_name to username, ships it on a Friday, and every customer on an older mobile build sees a blank profile screen. The backend tests passed. The frontend tests passed. The problem lived in the gap between them: the contract. We learned most of what follows the hard way, while building an HRMS…

API changes can break frontend applications without notice. Often, a backend team renames a field, ships it on a Friday, and users on older mobile builds see blank screens. Backend and frontend tests pass, but the gap between them contains the problem. The key is managing changes carefully.

Some changes are less obvious than expected. For example, changing a non-nullable field to nullable can cause issues. A user.avatarUrl field changing from string to string | null may lead to null startsWith() errors on the frontend. TypeScript doesn't catch this, and the fix is to add a guard and fallback.

Adding new enum values can also be problematic. Adding "refunded" to order status, for instance, may crash a frontend without a default branch in an exhaustive switch statement. Behavioural changes, like changing default sort, page size, or date format, are also hard to detect, requiring tests and communication to catch them.

The main issue is that backend and frontend teams deploy independently, old clients persist, and hand-written types don't always match the real response. To address these challenges, split changes into three releases: expand the new shape alongside the old one, migrate every client to the new shape, and then remove the old shape once usage drops to zero.

Frontends should also be tolerant, ignoring unknown fields and handling unexpected values gracefully. This ensures that when a frontend receives new data it doesn't expect, it degrades gracefully and alerts developers to the issue.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

ruflo's default MCP bridge exposed terminal execution to the network

ruflo's default MCP bridge exposed terminal execution to the network ruflo is an agent meta-harness with a Model Context Protocol bridge.

  • Ruflo's default Docker Compose deployment exposed unauthenticated endpoints
  • CVE-2026-59726 allowed remote code execution in versions before 3.16.3
  • Upgrading to version 3.16.3 or later remediated the vulnerability

Updating a public counter every 5 minutes on a free plan

ARLTS has a public "impact board" at arlts.org/impact: how many people have visited, and how many were active today, this week, and this month. The numbers come from our analytics tool (PostHog).

  • ARLTS public "impact board" now updates every 5 minutes
  • Modification of cloud function reduces load by requesting only two lightest questions
  • Visitor numbers displayed within 11 minutes, improvement from hourly updates

A website chat that only answers from what you approve

Most website chatbots fail in a boring way. They answer confidently, and they answer wrong. If a visitor asks "Do you serve Whitefield on weekends?" and the bot makes something up, you have created a…

  • BPAI's chatbot only responds with business owner-approved information
  • Visitors can ask questions in their own words, AI provides approved answers
  • Human team members can take over when AI lacks specific information

More from Friday 27 November →