-
Notifications
You must be signed in to change notification settings - Fork 45
use delta queries for calendar events #2154
Conversation
Hacks the beta version call into the events api when iterating through items, allowing us to run delta-based queries for calendar events.
// Note that the delta item body is skeletal compared to the actual event struct. Lucky | ||
// for us, we only need the item ID. As a result, even though we hacked the version, the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you check that items don't get skipped accidentally due to us selecting the bare minimum fields? Tbh, I'm not sure if this is a feature or a "bug" in how Graph works, but using $select
can sometimes cause a delta endpoint to skip returning results if they don't match what's in the $select
. For example, not having isRead
in the select for emails will cause emails where the isRead
flag has been changed to be skipped because it doesn't update the mod time. This will take some playing around and is probably easiest to do with GraphExplorer/postman
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, good call out. I'll do some manual testing. This might be especially interesting in this case, because the delta body for an event are only able to contain the id, startTime, and endTime. Hopefully the delta will catch changes on unrepresented properties, like renames and etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, two findings.
- everything works. Changes to name, desc, attendees, etc, are all picked up by the delta.
- we're not allowed to select values in the first place (see the error below). If anything, we're lucky that the client is tossing the use of options for us.
"error": {
"code": "ErrorInvalidUrlQuery",
"message": "The following parameters are not supported with change tracking over the 'SyncEvents' resource: '$orderby, $filter, $select, $expand, $search'."
}
// for us, we only need the item ID. As a result, even though we hacked the version, the | ||
// response body parses properly into the v1.0 structs and complies with our wanted interfaces. | ||
// Likewise, the NextLink and DeltaLink odata tags carry our hack forward, so the rest of the code | ||
// works as intended (until, at least, we want to _not_ call the beta anymore). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Aviator status
This PR was merged using Aviator. |
PR failed to merge with reason: some CI status(es) failed. |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Description
Hacks the beta version call into the events api
when iterating through items, allowing us to run
delta-based queries for calendar events.
Does this PR need a docs update or release note?
Type of change
Issue(s)
Test Plan