Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrations restart when an exception is thrown in the Confluence Migrator Pro code #101

Closed
raphj opened this issue Mar 18, 2024 · 0 comments
Assignees
Milestone

Comments

@raphj
Copy link
Contributor

raphj commented Mar 18, 2024

When the code that handles the migration job throws (because of a bug), migrations are not marked as "executed", and the job ends.

When visited, migrations that don't have a job and are not marked as executed are started (in MigrationSheet).

But when an exception is thrown there, the page is refreshed, thus restarting the migration... which will probably stumble on the same exception, thus restarting again.

I suggest converting the "executed" boolean flag to a number that describes the current state:

  • 0: not executed
  • 1: executed
  • 2: executing
  • 3: canceled
  • 4: errored

and only start a migration if executed = 0. I would do it differently from the start, but only slightly and this way is backward compatible with existing migration pages.

3 (Canceled) is useful to fix #45

2 and no job means the job died, so this is an error.

@raphj raphj self-assigned this Mar 18, 2024
@raphj raphj added this to the 1.13.3 milestone Mar 29, 2024
@raphj raphj closed this as completed Mar 29, 2024
raphj added a commit that referenced this issue Mar 29, 2024
…ator Pro code #101

Green "Migration complete" message shown when clicking on cancel #45
raphj added a commit that referenced this issue Mar 29, 2024
…ator Pro code #101

* Make sure one can refresh the migration page
raphj added a commit that referenced this issue Apr 3, 2024
…ator Pro code #101

* Correctly show the state in the migrations LiveData table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

1 participant