Skip to content

show-message does not show deleted_from_source_at #641

Description

@moorbrook

Problem

The messages table has a deleted_from_source_at column. Sync sets this column when a message leaves the mail server.

show-message does not show this column. The text output does not show it. The --json output does not show it.

A draft message keeps the DRAFT label after the user sends it or deletes it. The row stays in the archive. Thus show-message shows Labels: DRAFT for these three different conditions:

  • The draft is open on the mail server.
  • The user sent the draft.
  • The user deleted the draft.

The archive knows the difference. The command does not show it.

Example

Sync marked message 41589 as deleted at 18:19 on 17 Aug 2026. The user sent the message at 18:16. Sync was correct.

show-message 41589 gives this output:

Subject: Re: <subject>
Date:    Mon, 17 Aug 2026 18:11:25 UTC
Labels:  DRAFT

show-message 41589 --json gives these keys:

attachments, bcc, body_html, body_text, cc, conversation_id, from,
has_attachments, id, labels, sent_at, size_estimate, snippet,
source_conversation_id, source_message_id, subject, to

A SQL query gives the correct condition:

SELECT labels, deleted_from_source_at FROM v_messages WHERE id = 41589;
-- ["DRAFT"]  2026-08-17T18:19:46Z

Effect

An operator reads Labels: DRAFT and makes the wrong conclusion. The operator reports that the message is open, or that the user did not send the message.

The risk is high for AI agents. An agent uses show-message as the primary read command. The agent does not query the column, because the command output looks complete.

Suggested solution

  1. Add deleted_from_source_at to the --json output of show-message.
  2. Show a line in the text output when the column has a value. For example:
Labels:  DRAFT
Deleted from source: 2026-08-17T18:19:46Z

Do not show the line when the column is empty. This keeps the usual output unchanged.

Make the same change to search, if the result rows show labels.

Environment

  • msgvault 0.19.3, Homebrew bottle, macOS 15 arm64
  • Gmail source

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions