[SPO] Fix bugs when handling drive_items in incremental sync#1827
Merged
[SPO] Fix bugs when handling drive_items in incremental sync#1827
Conversation
vidok
approved these changes
Oct 23, 2023
This was referenced Oct 23, 2023
💚 Backport PR(s) successfully created
The backport PRs will be merged automatically after passing CI. |
seanstory
pushed a commit
that referenced
this pull request
Dec 14, 2023
(cherry picked from commit 5263e67)
Member
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes https://github.com/elastic/enterprise-search-team/issues/6051
This fixed the issue with changed content of a file (driveItem) not being picked up by an incremental sync.
The simple solution is to disable timestamp checks for site_drives and then rely on efficient delta api to get all changes for drive items.
I verified that the drive_item <-> drive_site is the only scenario when change to an object doesn't update its "parent"
lastModifiedDateTimefield. Interestingly, drive item updates would result in timestamp updates for its parent "list" and "site", so we are safe at keeping timestamp checks for sites.For other object types in SPO there were no "unexpected" behaviour when it comes to updating timestamps after edits.
Bonus bug fix
I realized that with
fetch_drive_item_permissionsenabled, the incremental sync will fail at handlingDELETEoperations since we are trying to fetch ACLs for a deleted document - it will result in 404 error. I added a logic to handle that scenario and manually tested that it works.Checklists
Pre-Review Checklist
v7.13.2,v7.14.0,v8.0.0)