Urgent.News

One page, thousands of outlets. See who else covered it.

Editions

Tech

The problem with the happy path

I recently had to do a deployment for a client demo. On local everything worked fine. All the tests were passing. All the data was where it was supposed to be. And then I pushed it to production. Suddenly, queries were failing. And I could not figure out why. So I fixed the first query. Re-built it, pushed again. It worked, but another thing broke. Rinse repeat and another thing broke. All the…

Deploying a client demo presented an unexpected challenge. Everything appeared smooth within the local environment, with tests passing and data in its proper place. However, after pushing the changes to production, queries started failing. The cause of these failures remained elusive. The reporter attempted to rectify the issue by focusing on resolving individual queries, rebuilding and re-deploying code.

Each success was followed by another failure. Upon closer inspection, the common denominator among the problematic queries was an error. They were triggered when a function received nil or an empty enumerable. These functions were designed to handle scenarios where data for querying existed. In production, though, the system operated under an empty state, lacking any data.

The reporter had been immersed in designing for when data was readily available, having spent the past week seeding the database and building queries that would pass. Nevertheless, the production environment would start with a blank slate, which the reporter had neglected to account for. Frustration and embarrassment accompanied the realization of this oversight.

The experience served as a reminder of the well-known developer wisdom: a substantial portion of software development efforts are dedicated to discovering and preparing for the "unhappy paths." Even though the exact percentage remains uncertain, the lesson remains valid. To avoid future instances where production queries fail, the reporter has had to adjust their approach to feature development.

Moving forward, it is crucial to explicitly define all potential states a feature may encounter and rigorously test each state. By anticipating failure and proactively planning for the unhappy path, developers can prevent wasting valuable time debugging queries in production.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

The World Clock Time-Zone Landscape: what 162 places reveal about time zones

Time zones look like a tidy grid of whole hours. They aren't. I read the standard UTC offset of all 162 cities, countries and regions on our World Clock straight from the IANA database (via Intl )…

  • Kathmandu, Nepal, is the only city with a 5 hours 45 minutes offset from UTC.
  • 11 locations worldwide do not follow whole hour time zone offsets.
  • Over half of remaining zones keep clocks at non-whole hour intervals.

PawGuard: A platform responsible for instant Abuse reporting and Community for Dogs in danger

This is a submission for Weekend Challenge: Dog Days Edition What I Built PawGuard is a community web platform built to help protect dogs from abuse, severe neglect, and abandonment.

  • PawGuard platform reports abuse instantly via GPS, photos, urgency level
  • Features lost and found pet noticeboard with printable flyers
  • Zero-delay dispatch bypasses authentication for immediate rescuer notification

i18n sin gettext: traducciones en JSON con claves de punto

Quieres que tu app hable español e inglés. Buscas cómo, y el ecosistema te empuja a gettext o Babel: ficheros .po , un paso de compilación a .mo , herramientas de extracción. Potente, sí.

  • dotkey-i18n is a Python-only i18n solution with no dependencies
  • JSON format for translations, easy to edit by anyone
  • Key notation with point, e.g. t(login.submit) navigates JSON

More from Sunday 16 August →