Fetch isRead attribute in email delta queries (#1867)

## Description

Updating the isRead flag in M365 does not cause the mod time of the item to be updated. This means delta queries will not return items marked as [un]read when isRead is not one of the attributes requested in the $select clause.

Explicitly fetch isRead so that we get those items. Further changes will be required to ensure the mod time of the item is something that will not cause kopia-assisted dedupe to skip the item when only the isRead attribute has been changed.

## Does this PR need a docs update or release note?

- [ ]  Yes, it's included
- [ ] 🕐 Yes, but in a later PR
- [x]  No 

## Type of change

<!--- Please check the type of change your PR introduces: --->
- [ ] 🌻 Feature
- [x] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Test
- [ ] 💻 CI/Deployment
- [ ] 🐹 Trivial/Minor

## Issue(s)

* closes #1866 

## Test Plan

<!-- How will this be tested prior to merging.-->
- [x] 💪 Manual
- [x]  Unit test
- [ ] 💚 E2E
This commit is contained in:
ashmrtn 2022-12-19 15:12:25 -08:00 committed by GitHub
parent 20bfaee8db
commit fbbf6aa84c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -66,6 +66,7 @@ var (
"subject": 4, "subject": 4,
"webLink": 5, "webLink": 5,
"id": 6, "id": 6,
"isRead": 7,
} }
fieldsForContacts = map[string]int{ fieldsForContacts = map[string]int{

View File

@ -421,7 +421,7 @@ func FetchMessageIDsFromDirectory(
deltaURL string deltaURL string
) )
options, err := optionsForFolderMessagesDelta([]string{"id"}) options, err := optionsForFolderMessagesDelta([]string{"isRead"})
if err != nil { if err != nil {
return nil, deltaURL, errors.Wrap(err, "getting query options") return nil, deltaURL, errors.Wrap(err, "getting query options")
} }