How to protect routes in Next.js when auth tokens are stored in HttpOnly cookies?

Summary A Next.js app cannot read HttpOnly cookies directly, so the frontend cannot decide whether a user is authenticated. The correct pattern is to let Next.js Middleware or server components validate the session by forwarding the cookies to your backend and letting the backend confirm whether the token is valid. The browser sends cookies automatically, … Read more

curl error message “Object of class stdClass could not be converted to string” when using google computeRoute

Summary This incident stemmed from a type‑mismatch bug in a PHP cURL integration with Google’s computeRoutes API. A developer attempted to pass a stdClass object directly into CURLOPT_POSTFIELDS, which only accepts strings, arrays, or URL‑encoded form data. The result was the runtime error: “Object of class stdClass could not be converted to string.” Root Cause … Read more

PCF Control build error – [pcf-1014] [Error] Manifest validation problem: instance requires property “manifest”

Summary The PCF control build failed with error [pcf-1014] [Error] Manifest validation problem: instance requires property “manifest”. This issue arose due to incorrect configuration in the pcfconfig.json file, specifically the missing or misnamed “manifest” property under the control definition. Root Cause Misconfiguration in pcfconfig.json: The “manifest” property was either missing or incorrectly named under the … Read more

Google Play warning: FOREGROUND_SERVICE permission used for push notifications, app receives notifications even after killed

Summary Google Play flagged our React Native app for misuse of FOREGROUND_SERVICE permissions, despite functional push notifications. The app received notifications post-termination due to a foreground service, violating Play Store policies. Key issue: improper permission declaration and overuse of foreground services. Root Cause Unnecessary FOREGROUND_SERVICE_DATA_SYNC permission included in AndroidManifest.xml. Foreground service misuse: Used for push … Read more

Why is object considered a data type in JavaScript, and why does typeof null return “object”?

Summary This postmortem explains why JavaScript treats object as a data type, and why the infamous typeof null === “object” behavior exists. These behaviors often confuse developers coming from class‑based languages like Java, but they stem from historical design decisions and how JavaScript represents values internally. Root Cause The root causes are twofold: JavaScript’s type … Read more

Deploying Vite + React App on Plesk: “Application Startup File” missing or 404 on refresh

Summary Deploying a Vite + React app on Plesk resulted in a 404 error on route refresh due to missing history fallback configuration. The issue arose from treating the app as static files without proper client-side routing support. Root Cause Missing History Fallback: React Router’s client-side routing requires a fallback to index.html for non-root routes, … Read more

Dagster DockerRunLauncher fails with ConnectionRefusedError on /var/run/docker.sock after host Docker daemon restart – stale bind mount in container

Summary A long‑running Dagster deployment using DockerRunLauncher began failing with ConnectionRefusedError when attempting to talk to the host Docker daemon through /var/run/docker.sock. The host daemon had been restarted, but the Dagster container continued using a stale bind‑mounted socket inode, causing all Docker API calls to fail until the container itself was restarted. Root Cause The … Read more

Distribution center Anylogic

Summary In a recent simulation of a distribution center using AnyLogic, a critical issue arose where trucks were only assigned to a single dock, causing inefficiencies in pallet handling. The root cause was the lack of dynamic dock assignment logic, leading to underutilized resources and delayed shipments. Root Cause Fixed Dock Assignment: Trucks were hardcoded … Read more

Should a C++ logger write method be defined as const?

Summary Making the Logger::Write method const in C++ is debatable but depends on whether the method modifies object state. If it only writes to an external resource (e.g., terminal) without changing internal state, marking it const is correct. However, if it updates internal counters (e.g., message_count), it must use mutable for those fields or avoid … Read more