seandenigris / MSAL-Smalltalk

Microsoft Authentication Library (Pharo) Smalltalk Bindings
MIT License
4 stars 1 forks source link

One Note Incremental Syncing #4

Open seandenigris opened 2 years ago

seandenigris commented 2 years ago

It doesn't seem like there are any options here. I originally wanted to do a HEAD or equivalent on e.g. a page's contentURL, but that returned a 405 error. It seems like I'll have to do fetch as in the "Full Sync" scenario above, but keep the new pages in a separate collection, check for pages with a newer lastModifiedDateTime, and for those:

  1. Merge the metadata as needed. It seems like I need all the fields for this, including e.g. parentSection, to account for moved pages
  2. Fetch the contents to see if they have changed, since there doesn't seem to be a way to see if the content specifically has changed. Hopefully I will be able to batch these request.

While we're figuring out if this will work and fits how MS works, a Sync object seems like the best choice so we can get a view on what operations it would perform before we commit them.

Batching

See https://github.com/seandenigris/MSAL-Smalltalk/issues/5.

Content Syncing

Img Alt - Modification Stamp Unchanged

Apparently, the content HTML is not guaranteed to be exact the same even if the modification stamps are equal. Here is an example where the OCR from a receipt image has been inserted somehow in the alt attribute of the img tag, but the modification stamps are equal.

Screen Shot 2022-11-23 at 9 28 40 PM

oneNoteClientUrl

The section ID in the URL changed even though the section didn't seem to have changed, but the modification timestamp was altered.

Deletions that Aren't

There seem to be about 5% claiming to be deleted i.e. are no longer returned by the API, but are still visible in the client app

Further Research

2022-11-11 - Asked on MS Q&A

seandenigris commented 1 year ago

We can now get the pages and content from the server. Next step is to do the merge.