Home

hasUnread

hasUnread is a boolean indicator used in software to denote that there are unread items within a collection, such as messages in a thread, notifications, or feed entries. It is commonly found in messaging apps, email clients, and notification centers to signal new activity that requires the user’s attention.

In practice, hasUnread can be stored as a field on an object (for example, a Conversation or

If not stored as a dedicated flag, hasUnread can be derived from an unreadCount value. Some systems

User interface implications include displaying a badge or highlighting a thread when hasUnread is true. Some

Common pitfalls include stale flags after moves or deletions, performance concerns in very large threads, and

See also: unread status, unreadCount, read receipt, notification badge.

Folder)
or
computed
on
demand.
A
typical
implementation
checks
for
any
unread
items
for
the
current
user.
For
example,
in
code
you
might
see
a
function
that
returns
true
if
any
related
messages
have
isRead
set
to
false.
Database
patterns
often
implement
this
with
a
query
that
counts
unread
items
by
user
and
thread,
and
sets
hasUnread
to
count
>
0.
prefer
per-user
or
per-device
accuracy,
especially
in
multi-device
contexts,
which
may
require
synchronization
across
clients
or
caches
and
careful
handling
of
read
receipts.
designs
show
a
numeric
unreadCount
instead
of
a
binary
hasUnread,
or
combine
both
for
accessibility
and
clarity.
ambiguous
behavior
across
archived
or
muted
conversations.
Clear
definitions
about
scope
(per-user
vs
global)
and
consistent
update
paths
help
maintain
reliable
hasUnread
state.