SShortSingh.
Back to feed

Dev's 'Smart' Notification Fix Silently Broke Alerts for Multi-Monitor Users

0
·1 views

A developer building ShelfTalk, a real-time social app for book lovers, added a feature to suppress push notifications when users were actively viewing the app tab. The logic relied on the Page Visibility API's document.hidden property, which only returns true when a tab is minimized or fully hidden behind other windows. Users on multi-monitor setups began missing direct messages and group mentions because their ShelfTalk tab remained technically 'visible' on a second screen, even while they worked on a different app on their primary monitor. The developer discovered the flaw only after a user described their dual-screen workflow, revealing that the OS considers any on-screen window as visible regardless of user attention. The bug highlights a key limitation of the Page Visibility API: it tracks window visibility, not actual user focus or attention.

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 ·

OAuth2 Authorization Code Flow Explained Without the Jargon

OAuth2 is an authorization framework that allows apps to access user data on third-party platforms without ever handling the user's password. Instead of credentials, apps receive a scoped access token — comparable to a valet key — granting limited, time-bound permissions on a user's behalf. For most web applications, the Authorization Code Flow is the only grant type developers need to understand, involving a four-step exchange between the browser, backend, user, and identity provider like Google or GitHub. The flow deliberately splits the process so that the sensitive client secret and final token exchange happen server-side, protecting against interception in the browser environment. A short Node.js example illustrates how the temporary authorization code received after user consent is traded server-to-server for the actual access token.

0
ProgrammingDEV Community ·

Manor AI Launches Self-Hosted Goal-Driven AI Workspace to Replace Chat-Based Tools

A team has developed Manor AI, a self-hosted AI platform built around structured, goal-driven Workspaces rather than conventional chat interfaces. Each Workspace is designed as an independent operating unit with defined goals, assigned agents, tasks, approval rules, and verifiable output artifacts. The approach aims to solve limitations of chat-based AI tools when handling long-running or multi-user workflows, where context and accountability are harder to maintain. Manor AI connects conversations, plans, knowledge bases, automations, and review processes within isolated Workspaces to prevent context bleed between unrelated projects. The source code has been published on GitHub under the Manor Sustainable Use License 1.0, which the team clarifies is source-available rather than OSI-certified open source.

0
ProgrammingDEV Community ·

Why Formal Problem Specs Beat Prompt Tricks for AI-Generated Production Code

A lead strategist at Digitalizen argues that most AI-generated code failures in production stem from poorly defined problem specifications, not from model capability gaps. As reasoning models have grown more powerful, classic prompt engineering tactics like persona framing and keyword hacks have become insufficient guardrails. The author proposes 'Problem Engineering,' a structured approach that requires developers to formally define system invariants, data contracts, state mutations, fault topologies, and observability hooks before any code is generated. Without these constraints, large language models default to statistically likely but naive implementations that lack concurrency controls or robust error handling. By eliminating ambiguity upfront, developers can narrow the model's output space and consistently obtain production-ready results.

0
ProgrammingDEV Community ·

Developer's Cost Monitor Silently Failed for a Week Due to a Common Shell Scripting Trap

A developer building an autonomous Claude Code environment discovered their cost-monitoring script had two critical flaws: it initially overcounted API spending by 4–6x due to double-summing cumulative log lines, then went completely silent for a week after being 'hardened' with set -euo pipefail. The strict error-handling flag caused the entire script to exit whenever a single command failed, leaving the status bar blank while significant API costs accumulated unnoticed. The developer argues that monitoring scripts should be designed to 'fail open' — displaying a visible 'no data' indicator rather than terminating silently — so users can distinguish between healthy operation and missing data. This principle emerged from real financial stakes: the developer notes that Claude Code's metered API costs can exceed $3,000 in a single week if left unmonitored. The resulting 212-line bash script now exits with code 0 on errors while displaying a visible placeholder, ensuring the dashboard never goes quiet.

Dev's 'Smart' Notification Fix Silently Broke Alerts for Multi-Monitor Users · ShortSingh