Add uppy state to resume uploads

I’m using Uppy aws s3 multipart upload in electron desktop app. I want to resume uploads after restart/shutdown from wherever we left the upload. So I tried to store the last state (using getState) before closing the app. After restart/shutdown, I tried to set the last state using setFileState method. but I’m getting an error. It says ‘Error: Can’t set state for uppy-id (the file could have been removed)’. So, how can I set the previous state to Uppy and continue the uploads from wherever we left?

The code I used to set the file state and retry the upload:-

//previous uppy-id and state are stored in indexDB, so I'm retrieving it from there and passing like this,
uppy.setFileState(uppy-id, previous-state);

Sample previous state:-

    "source": "C:\\Users\\A1\\1.ogg",
    "id": "uppy-f4a4b3c5/ac1a/4765/87d2/e58741244fd6-1d-1d-1d-1d-audio/ogg-13284166-1637146608964.131",
    "name": "f4a4b3c5-ac1a-4765-87d2-e58741244fd6",
    "extension": "",
    "meta": {
      "itemId": "08452a0b-384c-4a7d-adc8-43d2c0c03eef",
      "caseName": "2022.04.12-1024",
      "filePath": "C:\\Users\\A1\\1.ogg",
      "case_id": 5322,
      "type": "audio/ogg",
      "icf_type": "video",
      "folder_id": 37850,
      "file_name": "1.ogg",
      "name": "f4a4b3c5-ac1a-4765-87d2-e58741244fd6"
    "type": "audio/ogg",
    "data": {},
    "progress": {
      "uploadStarted": 1650006494875,
      "uploadComplete": false,
      "percentage": 36,
      "bytesUploaded": 4764486,
      "bytesTotal": 13284166
    "size": 13284166,
    "isRemote": false,
    "remote": "",
    "missingRequiredMetaFields": [],
    "s3Multipart": {
      "key": "87f30673-83ef-4e3e-8793-00684c383b75",
      "uploadId": "vQELpBBCStg9sIIA2ywEkT9KxVZRbVjhBhk1cHNJxgJW.gauetqBgBXKyX8JcfQVEn4W26BfILkidFqANwRG8HRnw6n0_hyUZ4.5MRM1TIR9bXA6rRXwz7ZXuJc7TAC4"

The best combination for this is @uppy/tus and @uppy/golden-retriever. I would take a look at those because it’s not as simple as just setting state. Note that S3 multipart currently doesn’t work with Golden Retriever.