hasStaleBackingPdf

Whether the server holds a different PDF for this document than the one that was downloaded.

Instant syncs annotations, not the pages they sit on. When a client elsewhere adds, removes, rotates or reorders pages, the file already on this device keeps the pages it was downloaded with, while annotations for the changed document keep syncing, so they can end up on the wrong pages.

The server reports the PDF it currently holds every time this document authenticates, and once more when a download finishes, so this is evaluated at both of those points. It is false before the first of them, and when the value recorded at download time is missing or unreadable.

While this is true, the way to get the current document is to call removeLocalStorageForDocument and download it again. That discards local changes that have not synced yet.

Note that removeLocalStorage() on this descriptor is not enough. It removes the annotations for this layer and leaves the PDF file in place, so the download that follows keeps serving the pages this document already has.

The comparison is against the one PDF in the document's package, which every layer of that document shares, while Document Engine resolves the PDF per layer. So on a document whose layers point at different PDFs, because page operations were applied to one of them, the package can hold what at most one layer needs. The others keep reporting true, correctly, and downloading again only changes which layer is satisfied. Instant stores one PDF per document, so there is no local state that could satisfy both.