Webnative SDK: show progress of sync after calling publish()

Use case: adding multiple files to the file system from TiddlyWiki on Fission and showing the progress of the sync so the user knows when all of the data has been synced. When adding X files, display a progress bar showing how many of X have been successfully synced.

The docs suggest that for a large data set it is better to add all the individual files and call publish once. However am I missing something or does this mean there is only a single callback on completion that can be used to display feedback to the user?

If uploading say 10 files, it would be preferable to at least show a progress bar showing “x/10 uploaded”. However, it seems this is only possible if I call publish for every file separately. Is this correct or am I missing something? If this is the only way, what would be the potential drawbacks of this approach?

Good question!

Mostly, publish is more like sync / persistence. It’s either saved or not saved.

Before publish, the data is all there, client side, it’s just not necessarily long term persisted.

I think you can “upload” individual files to local storage, and then publish – will talk to team about best way to do this, thank you for the feedback and questions.

Thank you @boris .

Just to add that for an end user in this example, there is an expectation that if the UI shows that the file was saved, it will immediately be available on other devices. So it would be misleading to show that the files are saved until they have been synced.

Also on a related note should be considered the use case of needing to show a progress bar when uploading a singe larger file, showing how far along the sync of that file is.

Yep, I understand.

This like adding files to Dropbox on your desktop. The files are there for you, locally, immediately…but they aren’t available to all other devices until they have actually uploaded.

As one example, Dropbox mostly just does this in the background.

The main thing we need to do is not surprise users about whether or not their data is safe. Lots of UX level stuff to think through here.

We’ve had a very similar use-case like yours in the dashboard. If you go to Fission Dashboard , you’ll see in the “Apps” section, there’s a big file chooser/dropper area. It shows a progress bar for uploading multiple files.

The way it’s implemented is just adding lots of files, and calling .publish at the end. It turns out that it works quite well in practice, I think. In my experience the majority of the time will be spent in the fs.write calls, not in the fs.publish one, but please try it out yourself :slight_smile:

I generally agree that getting progress on publishes would be nice.

I don’t think that, e.g. when a user tries to upload an app in the dashboard and interrupts it while it’s running the user expects that a part of the progress was made - quite the opposite: I personally expect the action to be transactional, and interrupting it shouldn’t leave it in a broken state.

1 Like

@saqimtiaz I documented this along with a diagram of what’s happening as a roadmap item Webnative Progress on Publish

Further comments and feedback welcome.

1 Like