internxt / drive-desktop

https://internxt.com/drive
GNU Affero General Public License v3.0
168 stars 21 forks source link

[PB-635]: In memory items for faster feedback #317

Closed PixoDev closed 1 year ago

PixoDev commented 1 year ago

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.

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 15 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication