Fix SPO incremental sync skipping sites with unchanged timestamps#3995
Fix SPO incremental sync skipping sites with unchanged timestamps#3995kmitul wants to merge 3 commits into
Conversation
|
Hey, we really appreciate this contribution! In the meantime, and just throwing this out there, we have built a SharePoint Online Connector that can fetch SPO data (although not into an index), that might or might not fit into what you're building - https://www.elastic.co/docs/reference/kibana/connectors-kibana/sharepoint-online-action-type - and we've been very actively iterating on that side of connectors so it might be a bit easier to incorporate feedback if this does end up fitting your use case. |
|
Haven't dug deep into this. But my big concern here is that if we add this, we'll significantly reduce the performance of incremental syncs, by looking at the sites AND site drives of sites that have seen no changes, every time we run an incremental sync. @kmitul have you experimented any to see what the performance impact is? We have several production customers who have been users of this connector for years, who haven't indicated that they're not seeing their deletions/modifications propagate, which is making me nervous that this is an uncommon situation we'd be solving, with a very common performance hit. |
Closes #3994
In
get_docs_incrementally, thesites()call usedcheck_timestamp=True, filtering out sites whoselastModifiedDateTimehadn't changed. When a site was skipped, its drive delta links were never consumed — silently dropping drive item deletions and modifications.This is the same class of bug already fixed for
site_drives:The fix applies the same pattern one level up:
check_timestamp=Falseforsites()in incremental sync.Checklists
Pre-Review Checklist
Changes Requiring Extra Attention
N/A — one-line change to a boolean flag, no new dependencies or security implications.
Release Note
SharePoint Online incremental sync could silently skip entire sites when their
lastModifiedDateTimewas unchanged, causing drive item deletions and modifications to be missed. Fixed by ensuring all sites are iterated during incremental sync, consistent with the existing behavior for site drives.