fix: come back to the listing page an import stopped in - #155
Merged
Merged
Conversation
oleksandr-nc
force-pushed
the
fix/139/come-back-for-unfinished-pages
branch
from
September 25, 2026 09:49
863c021 to
94b1af5
Compare
A batch that reached its download size in the middle of a folder listing left the rest of that listing out of the import: a directory was dropped from the import tree once its first page had been walked, and the import folder itself was never in the tree at all. The next batch had nothing to come back to and the import reported itself as finished, with the files of the unfinished pages missing and nothing in the log. A directory now stays in the tree, carrying the page to resume at, until its listing is exhausted. A page that cannot be listed any more, an expired token for instance, starts the directory over from its first page, and a listing that fails without one is logged. The files a page skipped because they were already there are counted even when the batch ends on that page. Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com>
The import job downloads 500 MB before it lets the next run continue. On a server where that is too much of a single job, or for a test that wants to see the import resume, the import_batch_size app setting now says how much a batch downloads. Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com>
oleksandr-nc
force-pushed
the
fix/139/come-back-for-unfinished-pages
branch
from
September 25, 2026 10:41
94b1af5 to
9e7905a
Compare
The stubbed drive is imported a second time into another folder, with a batch size of 20 bytes, so that the import runs out in the middle of the second listing page and has to come back to it. The job checks that the page was listed again and that the files behind it arrived. Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com>
oleksandr-nc
force-pushed
the
fix/139/come-back-for-unfinished-pages
branch
from
September 25, 2026 10:47
9e7905a to
b431d4e
Compare
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.
Part of #139, after #142, #143 and #144: the half of it that is about files that never arrive.
What a batch that stops in a folder leaves behind
The import job downloads 500 MB, then hands over to the next run through the
import_treeuser setting. A directory was taken out of that tree as soon as its first listing page had been walked, and the import folder itself was never put in it — only sub-folders were. So when a batch reached its download size on the second or a later page of a listing, nothing remembered that the listing was unfinished: the next batch went through the remembered sub-folders, found nothing left to do, and the import reported itself as finished. The files behind the page it stopped in were never downloaded, nothing was written to the log, and the notification said "N files were imported from OneDrive storage."A drive larger than one batch with at least one sub-folder is enough to hit this, which makes it a good candidate for the reports of imports that silently leave files out.
What changes
The new setting
import_batch_sizesays how much a single run of the import job downloads before it lets the next run continue, 500 MB by default. Servers that cannot afford that in one job can lower it, and the integration test sets it to 20 bytes so that the import has to stop in the middle of a listing page and come back to it.Where it is covered
The stubbed drive of the Graph API test is imported a second time with the small batch size, and the job checks the drive's second listing page was fetched again, that the files behind it arrived, and that the finish notification counts the file the first batch had already brought as one that was already there.