Repository navigation
EWS: meeting requests, responses and cancellations are listed with their dates, sender and size - #1573
Conversation
…ith their dates, sender and size The Default shape of SyncFolderItems gives a MeetingRequest, MeetingResponse or MeetingCancellation no DateTimeReceived, DateTimeSent, Size, From, Importance or InternetMessageId (Exchange Server 2019), so a meeting invitation was stored dated 0, from nobody, listed at the end of the Inbox and fetched whole last. The listing now asks for those six properties by name in every shape. The stand-in lists a meeting's message as Exchange does, with them only when asked. Human-reviewed, AI-assisted, nobody's mailbox harmed.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
benandez
left a comment
There was a problem hiding this comment.
Thanks @SetsuaD: clear diagnosis and a careful stand-in. Asking for the six properties by name is the right fix, and read_item already reads them from any item element in the t: namespace, so MeetingRequest/Response/Cancellation read the same as Message. Approving.
Checked
- Head
b75f376294a441aed04881277e55a8c555a110ef. CI is green (run 44017777626, plus Fuzz, CodeQL and CLA; 45 pass, 2 skipped). Merges cleanly with main and, textually, with #1572 and #1575. cargo test -p mailcraft-ews: 227 passed, 0 failed, includingmeeting_messages_come_with_their_times_sender_and_size. Clippy not re-run locally; CI clippy is green.- Read:
crates/ews/src/items.rs(LISTED,SyncFolderItems::element,read_item), the stand-in changes instandin_mail.rs/standin_write.rs, the new test and the fragment. - Request, response and cancellation are each tested in the Full, Lean and Bare shapes. The shape fallback is unchanged. The request only grows, and no new parsing is added.
- Not checked: a live Exchange or Grommunio server; #1572 and #1573 built together.
Question, not blocking: the six LISTED properties are now asked in every shape, so a server that refused one of them in SyncFolderItems would have no shape left to fall back to (Full, Lean, Bare, then the error stands). They are base item properties since Exchange 2007, but Grommunio and SmarterMail are untested. We'll try a Grommunio server before release. If one refuses, a last shape without them would cover it.
Human-reviewed, AI-assisted, nobody's mailbox harmed.



Closes #1457.
What was wrong.
SyncFolderItemsasks for theDefaultshape plus the recipients, categories, preview and flag,and
read_itemtakes the times, size, sender, importance andMessage-IDfrom whatever comes back.Defaultdoesn'tgive the same fields for every kind of item. On an Exchange Server 2019, a
MeetingRequest,MeetingResponseorMeetingCancellation(IPM.Schedule.Meeting.Request,.Resp.*,.Canceled) comes back with its id, subject, readstate, attachments flag and preview, and with no
DateTimeReceived,DateTimeSent,Size,From,ImportanceorInternetMessageId. The answer is stillNoError. So the item was stored as sent and received at 0, from nobody, size 0.That is the record in the report (
"date": 0,"received": 0,"unfetched": true). It was sorted below everything elsein the folder, under the oldest heading, and the background download takes the newest first, so it was the last message
of the account to be fetched whole. Until that fetch filled the date from the MIME, the invitation was listed at the very
end of a large Inbox, with no date and no sender. A plain
Messageisn't hit as hard:Defaultgives itDateTimeSent,FromandSize, but notDateTimeReceivedorImportance.The fix (
crates/ewsonly):items.rs:SyncFolderItems::elementasks foritem:DateTimeReceived,item:DateTimeSent,item:Size,item:Importance,message:Fromandmessage:InternetMessageIdby name, in every shape (Full,Lean,Bare).These are basic item properties in every schema version back to Exchange 2007, so they don't change which shape a
server is read in. Nothing changes in how the answer is read: the item reader already takes any item element, and it
now gets the fields it reads.
Item::element,Messageby default), andState::deliver_meetingdelivers a meeting request, response or cancellation. In theDefaultshape such an itemgets what Exchange gives it, with the times, size, sender, importance and
Message-IDonly when they are asked for.It also knows
item:DateTimeSent,item:Sizeandmessage:InternetMessageId.Tests.
mail_tests.rs:meeting_messages_come_with_their_times_sender_and_sizelists a request, a response and acancellation in the Inbox through the stand-in, in each shape (every property, without the preview, Exchange 2010). It
checks that each comes with its two times, its sender, its importance, its size and its
Message-ID. It fails withoutthe change ("a server with every property: Planning: dated") and passes with it.
cargo xtask cipasses.Checked live on an Exchange Server 2019 (15.2) we run. We put an iCalendar
REQUEST,REPLYandCANCELinto atest mailbox's Inbox. Exchange stored them as
IPM.Schedule.Meeting.Request,IPM.Schedule.Meeting.Resp.TentandIPM.Schedule.Meeting.Canceled.SyncFolderItemsin the shape the listing asked for until now: the three came back ast:MeetingRequest,t:MeetingResponseandt:MeetingCancellationwith no times, size, sender, importance orMessage-ID. With the sixproperties added, all of them were there.
Send/Receive (
mail.listover the control channel). All four were at the top of the Inbox, each with its sender andwith its arrival time from
DateTimeReceived(the cancellation arrived two seconds after it was sent). That includesa fourth request carrying a 2 MB attachment, which was over the limit and so had only the listing to go on.
small Inbox is fetched whole within seconds and the dates then come from the message itself. Its "received" time was
the sent time, which is what the list falls back to when the listing gave none. A large Inbox, or an invitation whose
turn to be fetched hasn't come, shows the gap the report describes.
For you to look at.
comes from the message itself. Reading the folders of Exchange server accounts afresh once would mend them at once; I
left that out.
SyncFolderItems. They are standardfields, but they are asked in every shape. If a server refused one, no shape would get past it, so a report like
that would mean moving that property to
Fullalone.Human-reviewed, AI-assisted, nobody's mailbox harmed.
Summary by CodeRabbit