world-scribe-2-desktop icon indicating copy to clipboard operation
world-scribe-2-desktop copied to clipboard

Proposal: Import from Android

Open MarquisLP opened this issue 3 years ago • 0 comments

Overview

The original World Scribe app on Android is still used by a large amount of people. When they transition to World Scribe 2, naturally the first question they will have is: “Can I bring over my work from the Android app?”

We propose adding an “Imports” page that will allow the user to import World folders created in the Android app, as well as monitor the progress of import jobs.

Process Outline

  1. The user copies a World folder from “WorldScribe” on their Android device onto their computer’s local file system.
  2. In World Scribe 2, the user accesses an "Imports" screen where they can select the folder from Step 1 and start a new import job.
  3. When an import job starts, the frontend posts to a new “androidImports” API route. The POST request contains the location of the World folder.
  4. The API server posts an import job object to a Bull queue, allowing the job to run as a background process.
  5. As the Bull queue executes the import operation, it appends message strings to a "log" property inside the import job object. These messages report each stage that has been completed, as well as any errors that were encountered. (e.g. Connection could not be imported because one of the files was missing.) This will allow the job to continue even if there are I/O errors.
  6. On the frontend, the "Imports" page continuously requests the import job's log data, and displays the log messages on the page.
  7. As the import process continues, the converted data will be saved to a new World folder in the user’s “WorldScribe/Worlds” folder. Once it is complete, the user can open the newly-imported World via the “Worlds” page.

Visualizations

World Scribe 2 - Proposal - Import from Android

The “Import Worker” will be a Javascript file that contains all of the logic for converting and saving the given World’s data, as well as writing status information to the respective import job object. It will run asynchronously from the other backend processes.

Below is a simple mockup of the new “Imports” screen.

World Scribe 2 - Proposal - Import from Android - Imports Page

Considerations and Alternatives

To simplify things, we may limit the number of concurrent import jobs to just 1. This would reduce the complexity on the frontend that would have resulted from needing to display and switch between logs for multiple jobs.


Please feel free to share any thoughts, concerns, and/or suggestions you have about this proposal.

MarquisLP avatar Sep 11 '21 16:09 MarquisLP