Opened 16 months ago
Closed 15 months ago
#18503 closed bug (fixed)
Mail: "Open drafts" doesn't work
Reported by: | humdinger | Owned by: | nobody |
---|---|---|---|
Priority: | normal | Milestone: | R1/beta5 |
Component: | Applications/Mail | Version: | R1/Development |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
This is hrev57135, 64bit.
The "Open drafts" query from Mail's menu and the Deskbar's tray icon doesn't find any draft mails. The query predicate is MAIL:draft==1
. When changed to MAIL:draft==*
it works...
Before submitting this trivial patch, any reason this (supposedly) worked in the past and not any more?
Change History (7)
comment:1 by , 16 months ago
comment:2 by , 15 months ago
I can't seem to reproduce this. After a few false starts, I deleted and recreated the attribute index, and now things seem to work fine.
However, it appears that the index's initial creation is broken. Mail drafts created after the index is created show up in queries; ones which are created beforehand are not. Running "reindex" appears to have no effect whatsoever.
comment:3 by , 15 months ago
Ah, I was missing "-r" flag for "reindex". That makes things work again. So, are you sure your indexes are all there and correct?
comment:4 by , 15 months ago
Nice detective work, Holmes. :)
Indeed, an "lsindex -v" reveals:
MAIL:draft B_STRING_TYPE 2048 2023-08-25 08:54 2023-08-25 08:54 0 0
When removing MAIL:draft and re-creating it with "mkindex -t int MAIL:draft" the query MAIL:draft=="1" returns my newly created draft mail. The "Open draft" menu in Mail works too.
Leaves the question, where is the MAIL:draft index created with type B_STRING_TYPE instead of B_INT32_TYPE?
comment:5 by , 15 months ago
Apparently here: https://xref.landonf.org/source/xref/haiku/build/scripts/build_haiku_image#304
It appears mail_daemon creates these and other mail indexes on startup if they don't exist. Probably we should just delete them from here so they're only created in one place?
comment:6 by , 15 months ago
comment:7 by , 15 months ago
Milestone: | Unscheduled → R1/beta5 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Seeing the discussion in the previous ticket about copying/editing files before starting those servers, I just went with fixing the script in hrev57240.
A change was proposed at https://review.haiku-os.org/c/haiku/+/6775.
However, on further inspection, it appears the draft attribute is set to 1. That should work fine; the fact that it doesn't likely indicates some bug in query parsing or evaluation which should be fixed.