New backup implementation that gets export link from notifications API rather than backup (due to notion api change) #44
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.
Fixes #42
Notion appears to have changed the API such that the enqueued backup task no longer returns the file download link upon export completion. Even when exporting manually through the settings page, the export finishes and pops up in the notifications panel, but the download link never appears (the export modal keeps spinning forever).
I have rewritten the backup script to query the notifications panel for the export completed notification. The script finds the correct export notification based on the timestamp of the export.
Caveat emptor: there is no way for the script to know for sure that the export notification corresponds to the request export. The script will just pick up the first new export after the export tasks is queued. So theoretically if another export finishes after the script starts but before the script's export job finishes, the backup workflow will pick up that one instead.