8000 fix(graph): show Drafts from the cache after a send (#538) by hanthor · Pull Request #591 · hyprlab/hylki · GitHub
[go: up one dir, main page]

Skip to content

fix(graph): show Drafts from the cache after a send (#538) - #591

Closed
hanthor wants to merge 1 commit into
hyprlab:mainfrom
tuna-os:fix/issue-538
Closed

hanthor wants to merge 1 commit into
hyprlab:mainfrom
tuna-os:fix/issue-538

Conversation

@hanthor
@hanthor hanthor commented Nov 5, 2026
Copy link
Copy Markdown
Contributor

Refs #538. I could not reproduce this against a Microsoft account, so this is from reading the code and Microsoft's documentation; the log you asked for would confirm it.

The error text is Could not load message: … (the Italian msgid), which only comes from a body fetch, not the send: sendMail succeeds, which is why the mail arrives. Per Microsoft's send mail process, sendMail first creates the message in Drafts and transport moves it to Sent Items later, and without immutable ids its id changes on that move.

  1. When the sent message had a draft origin (most replies, through autosave), on_send dropped that draft and then listed Drafts from the server. That listing can catch the just-sent message still in Drafts and cache it under its Drafts id; a large message with inline images stays there longer.
  2. On send completion the conversation reload merges cached related messages, Drafts included, so that row joins the conversation with no body.
  3. Its body is then fetched by the old id after the move: Microsoft Graph returned 404: The specified object was not found in the store.

The fix lists Drafts from the cache after dropping the origin; graph_drop_draft_origin already removes the old draft's row, so the list still loses it. Switching to Prefer: IdType="ImmutableId" would also fix it, but every cached uid is a hash of the Graph id, so that is a larger change.

A rarer path remains (an autosave still in flight at Send, or the user opening Drafts in that window); closing it needs a choice between remembering just-sent Message-IDs or treating a 404 body fetch as gone.

Checked: worker::graph tests pass and the app builds; the loopback Graph fake cannot drive on_send (it posts to the fixed GRAPH_BASE), so there is no new test.

sendMail leaves the message in Drafts until transport moves it to Sent Items under a new id, so listing Drafts straight after a send could cache it there. The conversation on screen then folded it in and asked for its body by an id already gone, and Graph answered 404. The dropped draft is already out of the cache, so Drafts is now shown from it.
@hyprlab
hyprlab commented Nov 5, 2026
Copy link
Copy Markdown
Owner

Thanks for the fix, this will be merged on the next beta build

@hyprlab
hyprlab commented Nov 5, 2026
Copy link
Copy Markdown
Owner

Agentic reply:

The beta build is in the repo now. If you already have the beta installed, flatpak update picks it up. If not, download and install it first:

flatpak install --user --from https://hylki.hyprlab.co/flatpak/co.hyprlab.Hylki.Beta.flatpakref

RPM, Debian and AppImage betas: Beta channel.

@hyprlab hyprlab closed this Nov 5, 2026
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.

2 participants

0