FredrikNoren / ungit

The easiest way to use git. On any platform. Anywhere.
MIT License
10.43k stars 636 forks source link

Saved repo paths not showing up on remote sessions unless manually adding again. #628

Open wkjid10t opened 8 years ago

wkjid10t commented 8 years ago

When running ungit server. Using a tablet (Nexus 7 & Chrome), the saved repo paths are not showing up. Only after manually adding the repo path on the device (Nexus 7) does it consistently show up in the saved repo path section.

Procedure: 1) Run ungit on machine with repo/source with IP 2) Locate repo path. 3) Using the plus sign/icon, add the repo/path to the saved repo/paths. 4) Using a networked device or machine, open the existing ungit session (IP:8448). 5) Notice that the saved repo from step 3 does not appear. 6) Repeat step 2 and 3 7) Notice that the repo is now consistently available.

After closing the session or even killing the ungit session and restarting, the saved sessions are now persistent on remote sessions.

wkjid10t commented 8 years ago

Scanned through some of the code and it seems that the repoList is being stored to localStorage. Which is probably the issue. So a new device/session would not contain the list of repo's that have been previously created based on the running ungit server.

A possible fix would be to have some sort of storage on the ungit server/host machine that contains the observableArray (repoList) in JSON format. Then whenever a session opens, the app can load the repo list from that host storage. OR alternatively give the user an option to load the existing repolist if he/she wanted to.

wkjid10t commented 8 years ago

Sorry for the triple back-to-back. But a redundant solution might also be to write a plugin that would allow for the capability or an option to have the host/server provide the client with the repolist.

jung-kim commented 8 years ago

Frankly, I do like that we are managing repo list in the client side via local storage as each "client", perhaps a browser, can have it's own list of repos and manage it.

We can add repo list to a .ungitrc config file and serve up strored json from there to each clients. But delete operation on repo list is little confusing once we do this. We can remove deleted repo from in-memory copy of the repo list in the server but every restart it would be back to original list. (minor inconvenience)

I guess what I'm saying is that I personally don't see a strong reason to serve same list of repos per server to all clients, at least for my use cases.

Maybe we can do a mix of both?

Ajedi32 commented 8 years ago

It seems to me that in most cases you would want all clients to share the same list of repos, unless of course there are multiple users accessing the same ungit server (which AFAIK isn't a use case we really support at the moment anyway). Is there any situation where you wouldn't want all clients to have the same list of repos?

I guess ungit doesn't have any persistent server-side storage system implemented yet though? (Other than the git repos themselves, of course.) I'd suggest either (ab)using git config to store this information, or just storing it on the disk somewhere in JSON format or something then serving that to the client.

wkjid10t commented 8 years ago

I was using my Nexus 7 to mess with having a tablet/touch interface to use ungit. It seemed like a pretty good idea, since I wouldn't have to switch windows to a browser to select ungit. It's a minor inconvenience, that I had to manually add the repo location again.

Personally it makes sense to me to have the "server" provide the list of repo's instead of having each "client" manually add their own.

Or maybe just provide some option for the client to load the "server" repolist, OR stick to their own list.