mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 01:06:00 +03:00
[GH-ISSUE #4436] [feature]: sync strategy for user data when user log in #1629
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#1629
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @shipko on GitHub (Oct 14, 2024).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4436
Is there an existing issue for this?
Summary
The problem lies in this line of the file https://github.com/hoppscotch/hoppscotch/blob/main/packages/hoppscotch-selfhost-web/src/platform/collections/collections.platform.ts#L73-L82 and https://github.com/hoppscotch/hoppscotch/blob/main/packages/hoppscotch-selfhost-desktop/src/platform/collections/collections.platform.ts#L73-L82
Why should this be worked on?
After studying the code, it became clear that priority is given to data from the cloud. User data is simply deleted in this case. This is wrong and may alienate QA engineers due to the risk of losing their own data.
I suggest developing a more correct data synchronization strategy.
@shipko commented on GitHub (Oct 14, 2024):
@jamesgeorge007 @AndrewBastin @balub
I see 2 potential data fusion strategies:
This description applies only to the custom collection. Separately, you can discuss the strategy for updating environment variables.
@AndrewBastin commented on GitHub (Oct 14, 2024):
I wouldn't term it as that mostly, but personal and teams having different concerns. Being able to work offline is a thing exclusive to Personal Workspaces in Hoppscotch and is not a concern for teams, so that implementation is super simple.
I am toying with some ideas for allowing offline mode to work fully, maybe by incorporating Git or some VCS kind of format to enable it, but its a pretty big ordeal for the time being and this issue hasn't come up in discussions often enough to justify time on it for the time being. We welcome PRs and improvement suggestions though.
This requires the browser to be able to provide access to the filesystem, which although is possible with the File System API, the UX around it in browser is not consistent and we are not a big fan of it. We are actually working on getting a File Based Workspace specification which allows workspaces to be checked into Git, and we are planning on offering that as an option in the Desktop apps. I am hoping to complete the specification and present it for an RFC soon, but the progress on it is slow as well.
@takshakmudgal commented on GitHub (Oct 14, 2024):
Hey, I would like to work on this issue.
In order to approach this, I could define a
syncCollectionsfunction that handles the synchronization process for a given collection type. I can thenprioritizes local changes over cloud data,preserve new local collectionsandInclude any new cloud collections not present locally.@shipko commented on GitHub (Oct 15, 2024):
@takshakmudgal I think these are the right principles. Of course there are many pitfalls here, but I think we can discuss them in the process of solving them.
@AndrewBastin can we assign this task?
@AndrewBastin commented on GitHub (Oct 15, 2024):
Yep, I am cool, you don't need to wait for task assignment for working on the PR (we avoid this practice because most people who we assign tickets to usually never respond back with PRs), so feel free to start working on it.
My issue with @takshakmudgal 's proposal is mostly around it not containing enough details about the hard parts, mostly how will we deal with merging data (there are representations of ideas, but if you go through the codebase you can see we don't exactly track timestamps of when things are created, its even not very easy to track stuff with the current structure) along with things like conflict resolution, so I need to either see the code or atleast a clear plans for it before I can fully get behind.
@takshakmudgal commented on GitHub (Oct 18, 2024):
@AndrewBastin I am facing some local setup issues and docker compose issues in my local developement enviroment.
These are the logs when I am trying to run the backend, frontend runs perfectly.