Skip to content

fix: say when an import stops before it is finished - #156

Merged
oleksandr-nc merged 2 commits into
mainfrom
fix/139/say-when-an-import-stops
Sep 25, 2026
Merged

oleksandr-nc merged 2 commits into
mainfrom
fix/139/say-when-an-import-stops

Conversation

@oleksandr-nc

@oleksandr-nc oleksandr-nc commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Part of #139, after #155: an import that ends before it has seen the whole drive used to end in silence.

What happened

Every batch starts by asking for the drive, to know its size. That answer is not used for anything — the line that read it is commented out — but when the request fails, importFiles() returns the error, the job resets the import flags and stops. No notification is sent, because only a finished import sends one, and the error was never written to the log either. The same held for anything thrown inside the import: the message was put into a string and dropped.

What the user saw was an import that was running and now is not, with nothing anywhere to say why. This is what happened to the second import of the CI job in #144, on a request that came back with an error from Microsoft.

What changes

  • The reason an import stopped goes to the log, and a job that throws is logged with its exception.
  • The user gets a notification: "The import of your OneDrive files stopped before it was finished, check the server logs for details.", with what the import did manage to do as its body — "12 files were imported from OneDrive storage.", and the counts of the files that were skipped or could not be downloaded, the same sentences the finished notification uses.
  • An import the user cancelled in the settings page while a batch was running says nothing at all. Cancelling does not stop the batch, so such an import used to report itself as finished when the batch ran to the end of the drive, and would now have reported itself as stopped when it did not.
  • A Graph API error arrives as a string rather than a response stream, so the reason reaches the log as text instead of an object that happens to have __toString().

What this does not cover

A folder the API refuses to list is dropped from the import, and the import still reports itself as finished. That path needs the finished state to be derived from the import tree, with a bounded number of retries, which is a change of its own.

Where it is covered

The stubbed Graph API answers the drive with a revoked consent once the test asks it to, and the job checks that the import gives up, that the only notification left is this one with the right body, and that the log says why.

@oleksandr-nc
oleksandr-nc force-pushed the fix/139/say-when-an-import-stops branch from 475c71f to a8b9f9a Compare September 25, 2026 08:06
@oleksandr-nc
oleksandr-nc force-pushed the fix/139/come-back-for-unfinished-pages branch 3 times, most recently from 9e7905a to b431d4e Compare September 25, 2026 10:47
Base automatically changed from fix/139/come-back-for-unfinished-pages to main September 25, 2026 10:56
@oleksandr-nc
oleksandr-nc force-pushed the fix/139/say-when-an-import-stops branch from a8b9f9a to 2ca9417 Compare September 25, 2026 10:58
An import that could not read the drive, or whose job threw, reset its flags and
ended: no notification, and nothing in the log either, so the only sign left was
that the import had stopped moving. It now writes the reason to the log and sends
a notification saying the import stopped, with what it had imported so far.

Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com>
The stub answers the drive itself with a revoked consent once the test asks it to,
which is what an import that stops before it is finished looks like from the app.

Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com>
@oleksandr-nc
oleksandr-nc force-pushed the fix/139/say-when-an-import-stops branch from 2ca9417 to e8eacad Compare September 25, 2026 11:52
@oleksandr-nc
oleksandr-nc merged commit e5b81aa into main Sep 25, 2026
25 checks passed
@oleksandr-nc
oleksandr-nc deleted the fix/139/say-when-an-import-stops branch September 25, 2026 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant