Urgent.News

What's breaking now, across thousands of outlets.

Tech

Coalescing Identical In-Flight VIN Decode Requests So Duplicate Pastes Share One Upstream Call

A free VIN decode form (or thin proxy) often starts DecodeVinValues as soon as a normalized 17-character VIN is ready. Users -- and impatient front-ends -- paste the same VIN twice, double-click Decode, or remount a component that fires again while the first request is still open. Without coalescing, you pay NHTSA twice for the same pattern and race two identical payloads into the UI. This post…

Coalescing identical in-flight VIN decode requests allows multiple requests for the same VIN to share a single upstream call, avoiding duplicate work and potential quota issues. When a second caller asks for the same normalized VIN while a decode is already pending, the system returns the same promise instead of opening a new call.

This is achieved by maintaining a map from normalized VIN to the in-flight Promise. If a second request arrives for an already pending decode, it simply awaits the shared result. The coalesce function takes the inflight map, raw VIN, and a fetchDecode function as input. It normalizes the VIN, checks if a pending request already exists for that VIN, and if not, creates a new promise, stores it in the map, and deletes it when the promise settles (either successfully or with an error).

This prevents duplicate upstream calls and respects the user's experience by canceling shared waits for input changes.

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

Changing def to async def let one blocking call freeze an entire FastAPI app

Everyone who writes async Python has been told not to block the event loop. What I had never seen measured is how much damage one blocking call actually does, and the part of FastAPI's behaviour that…

  • Blocking calls in async endpoint significantly slow down response time, up to 34,130 milliseconds.
  • CPU-bound tasks can be offloaded to threads or process pools to reduce impact on other endpoints.

Business Impact Governance Framework (BIGF) v2.4

"Talk is cheap. Show me the state machine. If your governance model requires a 15-person meeting to decide who has authority, your architecture is broken.

  • BIGF v2.4 uses deterministic runtime gate for authority evaluation
  • Framework enforces 403 Hard Halt on compliance telemetry failure
  • Interactive browser simulator demonstrates deterministic BIII integrity score

More from Tuesday 13 October →