Skip to content

fix: sort chats by activity and preserve read state after crashes - #497

Merged
ahmad-ajmal merged 1 commit into
V1.4.4from
ahmad/ui-bug-fixes
Oct 21, 2026
Merged

ahmad-ajmal merged 1 commit into
V1.4.4from
ahmad/ui-bug-fixes

Conversation

@ahmad-ajmal

@ahmad-ajmal ahmad-ajmal commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

What

  • Sort ordinary chats by latest activity while keeping Main pinned first; remove the saved manual chat order that could override activity sorting.
  • Persist read receipts in SQLite, acknowledge them after commit, and restore them on reconnect so a Chrome crash does not bring back read notifications.
  • Validate message/session ownership, reject older receipts, clear receipts with chat history, and import existing local markers. Read status is shared by the single-user CraftBot backend; localStorage remains a cache.

Why

Older active chats stayed below newer chats, and an actual Chrome force-quit followed by Restore reproduced a green unread dot returning for a reply that had already been read.

How to test

  • python -m pytest tests/test_chat_read_receipts.py tests/test_chat_storage_sessions.py tests/test_browser_ui_buffers.py tests/test_ws_lanes.py -q — 25 passed.
  • Frontend npx tsc --noEmit and npm run build — passed.
  • Ruff on the changed Python files and git diff --check — passed.
  • python -m compileall -q app agent_core agents decorators skills — passed.
  • Actual Chrome retest: read A, leave B unread, return to Main, force-terminate Chrome and its children, reopen the same profile, and click Restore. A stayed read, B stayed unread, and Main/B/A/C ordering remained intact.

Full-tree Ruff reports four pre-existing errors in app/agent_app/test_data_safety.py, app/credentials/vault.py, and craftos_integrations/providers/supabase/client.py. Changed-file Ruff is clean. ESLint is unavailable because the frontend has no configuration.

@ahmad-ajmal
ahmad-ajmal marked this pull request as ready for review October 21, 2026 17:02
@ahmad-ajmal
ahmad-ajmal merged commit bda889e into V1.4.4 Oct 21, 2026
@CraftOS-dev
CraftOS-dev deleted the ahmad/ui-bug-fixes branch October 26, 2026 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant