ryer.io

Tackling a Client-Server Communication Glitch

TL;DR

  • Faced challenges with a client API call not reaching the server.
  • Verified client makes the correct request, but not logged at the server.
  • Suspected a caching or promise resolution issue; no 304 HTTP status codes.
  • Plan to clean caches, rebuild the app, and double-check middleware logs.

Today was a ride through unexpected technical and personal challenges! I informed our product owner about a delay on a task due to some disruptions. Back to coding, I found my client appeared to make requests correctly, yet they weren’t reaching the server. This puzzled me since the server was logging other calls fine.

To solve this:

  1. I setup simple server middleware to track requests through request.url logging.
  2. Verified logs to find no client request made it to the server.
  3. Problem pinpointed to client-side; employed tests, saw failures due to unapplied mocks.
  4. Isolated the client-side issue within the getWeeklyCohortContent method; promise resolution was suspect.

Decisions moving forward:

  • Clear caches, rebuild the application, and observe the outputs.
  • Examined the absence of HTTP 304 codes, indicating the lack of network-level caching.
  • Consider the deterministic key used for client requests to find potential overlaps or inefficiencies.

The day reminded me how easily an undetected small glitch can distract and consume time, compounded by real-world interruptions!