Skip to content

Implementation of successful upload check #377

@ehsan6sha

Description

@ehsan6sha

Right now when an asset is sent to be uploaded, it assumes the upload is completed. It needs to check and ensure upload is done and retry if not.

inprogress_cidlist = []
when app starts:
fula.checkFailedActions(false, 15) => If not false => failedCids = fula.listFailedActions() => inprogress_cidlist.push(failedCids) :just make sure we do not double add a cid and it is unique inside inprogress_cidlist

when we upload: (The part after 5 second delay should still wait for more time if the procedure in "Now during the app" is running at the same time so a shared flag is needed)
if writeFile is true => show file as in progress => get the rootCid of latest uploaded file in that batch => after 5 seconds delay to give it some time to upload: fula.listFailedActions([rootCid]) => If not false => inprogress_cidlist .push(root_cid) :just make sure we do not double add a cid and it is unique inside inprogress_cidlist

Now during the app: (This should be skipped on the cycle when the upload is running at the same time so a shared flag is needed)
If inprogress_cidlist.length>0 => activate a timer every 30 sec => {fula.connectionCheck => if true => checkFailedActions(true, 15) => if true => inprogress_cidlist=await fula.listFailedActions()}

In checkFailedActions age avalin input true bashe khodesh ham check mikone va ham upload. dovomin parametresham timeoute
listFailedActions ham age input dashte bashe ke faghat oona ro check mikone va age bi inut bashe hameye failed ha ro barmigardoone


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions