SShortSingh.

Related stories

0
ProgrammingDEV Community ·

How a subtle memory leak in UIViewRepresentable can silently retain your Coordinator

A developer discovered a memory leak in SwiftUI's UIViewRepresentable when assigning an instance method reference directly to a UIKit view's closure property. Passing context.coordinator.handleTap to a button's onTap closure causes the closure to strongly retain the Coordinator object, preventing it from being deallocated. Because UIViewRepresentable is a struct, the usual [weak self] Swift pattern does not apply, requiring developers to instead weakly capture the Coordinator explicitly using [weak coordinator = context.coordinator]. The recommended fix involves both a weak capture in the closure and implementing dismantleUIView to nil out the callback when SwiftUI tears down the view. This distinction is important because the Coordinator, not the struct wrapper, is the reference-type object managing UIKit-style lifetime and callback behavior.

0
ProgrammingDEV Community ·

Gemini Skips Web Searches Without Warning Users, Tests and Leaks Reveal

Google's Gemini AI assistant frequently answers questions requiring live data — such as weather or current prices — using outdated training data instead of searching the web. A backend routing system decides on a per-query basis whether to grant Gemini access to its web-search tool, often withholding it without any indication to the user. A widely shared test on Reddit demonstrated the issue clearly: asking for the weather in English triggered a web search, while the identical query in Finnish blocked it entirely, pointing to a routing decision rather than a model limitation. The problem is documented in Google's own support forums and corroborated by a leaked Gemini system prompt, with user complaints persisting through multiple app updates as of August 2026. Google has not issued an official explanation, leaving users with no way to know when an answer reflects live information versus stale training data.

0
ProgrammingDEV Community ·

Developer launches PrepOCR, a free batch image preprocessor to improve OCR accuracy

A developer has released PrepOCR, a free image preprocessing tool designed to improve OCR accuracy by cleaning up images before they are fed into recognition pipelines. The tool supports tilt correction, contrast enhancement, and binarization with a configurable threshold, addressing common issues like skewed scans and noisy backgrounds. Users can upload multiple images, select preprocessing settings, and receive a ZIP file of optimized outputs. The backend is built with Scala and http4s, and uses parallel processing to handle batch conversions more efficiently. The creator describes it as an MVP built to meet a personal need and is actively seeking user feedback and feature requests.

0
ProgrammingDEV Community ·

Node.js Guide: How to Safely Handle Token Revocation and Account Deletion

A technical guide published on DEV Community outlines a three-step approach to managing account shutdowns in Node.js-based customer support systems. The article distinguishes between two distinct problems: revoking stolen refresh tokens as an immediate security response, and deleting accounts as a separate data-lifecycle process. The author warns that treating both actions as a single delete operation can create a race condition where an attacker retains session access while critical investigation data gets destroyed. The recommended approach prioritizes identity stability by keeping a permanent user ID, recording profile state transitions before any destructive action, and revoking all sessions broadly when a compromise is confirmed. Account deletion should only proceed after recovery windows, legal holds, and audit requirements have been fully satisfied.

The smallest edge AI device for local LLMs · ShortSingh