SShortSingh.
Back to feed

WebSocket Auto-Reconnect Can Still Lose Messages Sent During Outages

0
·6 views

A developer's WebSocket client appears to reconnect correctly after brief drops, yet messages sent during the gap never reach the user. The article explains that reconnecting does not guarantee catching up on missed data. It also shows that if a server restarts, all clients reconnecting at once can create a retry storm, which the author addresses with exponential backoff and full jitter. The code distinguishes clean closes (code 1000) from abrupt drops (code 1006) so intentional shutdowns are not reconnected. The author argues that a smooth connection status indicator can mask the remaining problem of missed messages.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Claude Code transcript share and /feedback fail with 403 even after fresh login

Claude Code users report that after accepting the share prompt they see "Couldn't share transcript," and the /feedback command returns HTTP 403 even after logging in again. No verified fix currently exists, according to the report. Because the 403 persists after a fresh login, the issue appears to stem from an account or permission state on Anthropic's side rather than local authentication. The problem is tracked as GitHub issue anthropics/claude-code#101651, which remained open with no staff reply as of mid-November 2026. The suggested workaround is to copy the conversation text manually and share it that way.

0
ProgrammingDEV Community ·

OCR vs. ICR: How Developers Can Extract Passport Data for Verification Apps

Developers building onboarding or identity verification tools often need to pull information from passports rather than having users type it in. The article compares Optical Character Recognition (OCR), which reads printed text such as passport numbers, names, and expiry dates, with Intelligent Character Recognition (ICR), which uses machine learning to handle handwriting and irregular characters. It explains that OCR is the main technology for modern machine-readable passports, including the Machine Readable Zone, while ICR suits workflows involving handwritten fields. A typical pipeline covers image capture, preprocessing, text recognition, and MRZ validation using format rules and check digits. The author notes that these steps do not by themselves prove a passport is authentic, and recommends evaluating supported document types, validation options, and privacy practices.

0
ProgrammingDEV Community ·

Deleting ~/.cache can silently wipe saved API keys, IDE history and clipboard data

A developer found that deleting the ~/.cache directory made Langflow unable to decrypt a saved OpenAI key, because its encryption key was stored there and was regenerated on restart. Many widely recommended cache cleanups therefore carry hidden costs. The author examined several tools and found that JetBrains local history, Clipboard Indicator's pinned clips, cliphist, Deno's localStorage and ibus-libpinyin's learned typing data are all stored in the cache directory. Some of these tools have already moved or changed this behavior, and most offer settings to relocate the data, though those settings are not enabled by default. The piece advises checking what lives in ~/.cache before deleting it.

0
ProgrammingDEV Community ·

Hybrid API Access Goes Live on DigitalOcean with Key and x402 Payment Testing

The author deployed a FastAPI service to a DigitalOcean Droplet behind Nginx, using Gunicorn with Uvicorn workers, systemd, and Certbot for HTTPS at api.data4agents.dev. Human users authenticate with an X-API-Key checked against PostgreSQL, and that path returned a 200 response with the expected JSON in testing. Requests without a key receive an HTTP 402 challenge, which autonomous agents can satisfy by paying in USDC on Base. The server then verifies and settles the payment through the Coinbase facilitator before returning data along with a PAYMENT-RESPONSE header. To test the agent flow, the author wrote a Python script that handles the 402-pay-retry loop using EIP-712 signed payment authorizations.