This system allow us to provide a faster feedback in the UI
How
When we perform an operation such a file rename, we first create an in memory renamed file, then we perform the actual HTTP operation, once we receive the HTTP operation result, we either rollback to the previous state if it failed, or we remove the in memory item and replace it with the local db one
Why
If we are going to aim to provide an almost native experience, we need to provide fast feedback to the user, otherwise this won't feel like the user is navigating though the OS filesystem. If we depend on the server latency to provide feedback, and the server is facing some slowness, we are going to pass that slowness to the UI feedback which is not a nice UX
Corner cases
Could be possible that if we perform an optimistic operation such folder creation, the user tries to perform an action under that optimistic folder, since the folder doesn't exist yet, the operation will fail.
This system allow us to provide a faster feedback in the UI
How
When we perform an operation such a file rename, we first create an in memory renamed file, then we perform the actual HTTP operation, once we receive the HTTP operation result, we either rollback to the previous state if it failed, or we remove the in memory item and replace it with the local db one
Why
If we are going to aim to provide an almost native experience, we need to provide fast feedback to the user, otherwise this won't feel like the user is navigating though the OS filesystem. If we depend on the server latency to provide feedback, and the server is facing some slowness, we are going to pass that slowness to the UI feedback which is not a nice UX
Corner cases
Could be possible that if we perform an optimistic operation such folder creation, the user tries to perform an action under that optimistic folder, since the folder doesn't exist yet, the operation will fail.