mingo-app / mingo

Found a bug? have a FR ?
60 stars 2 forks source link

Very strange behavior when switching between connections in one project #553

Closed Vallefor closed 1 year ago

Vallefor commented 1 year ago

Describe the bug I have 1 project and two conntctions (prod and dev) thet using ssh-tunel. Every connections have no passwords and have the same connection uri. The only difference between them is SSH-tunel (different IPs but the same key)

When I start mingo and choose prod connection and then switch to dev I will see all data from the first connection (prod). To switch to dev I need to close all tabs restart mingo and choose dev connection.

To reproduce it:

  1. Create project
  2. Create first connection with ssh tunel and connection uri like this: mongodb://localhost:27017/test-db
  3. Create second connection with ssh tunel and connection uri like this: mongodb://localhost:27017/test-db
  4. Create collections with the same name on each DB.
  5. Add some different data in each collection
  6. Choose project and open collection from first connection.
  7. Switch to collecteon from second connection - you will see the same data

Desktop (please complete the following information):

tothradoslav commented 1 year ago

Thank you for this. So far I have not been able to reproduce your issue with the steps you provided. But i'm still trying...

Could you please let me know what you mean by "switch to collection from second connection"? I mean, where exactly do you click to "switch"?

Does this also happen when you open the collection in first connection in one tab and the other in another tab?

Vallefor commented 1 year ago

I record a video with demonstration. I think it should be more clearly now :) Let me know if you need somethig more!

https://user-images.githubusercontent.com/1270687/230879571-e8b8b844-35bc-49f0-a579-db526c7556fb.mp4

Also I am ALMOST sure the root of this bug. As you can see it lsof says mingo opens two connection to same server.

~ sudo lsof -i -P | grep mingo | grep ":22"
mingo     346024 vallefor   45u  IPv4 3850730      0t0  TCP manjaro:58824->static.103.7.181.135.clients.your-server.de:22 (ESTABLISHED)
mingo     346024 vallefor   49u  IPv4 3848913      0t0  TCP manjaro:55622->static.103.7.181.135.clients.your-server.de:22 (ESTABLISHED)
tothradoslav commented 1 year ago

this is great, thanks, will investigate and let you know!

tothradoslav commented 1 year ago

This may actually be related to #555, which we have already patched for testing purposes, but I only created a osx build. Which linux build are you using so that i could build the one for you to test it, too. Thank you

tothradoslav commented 1 year ago

Try here:

https://github.com/mingo-app/mingo/releases/tag/v1.12.1-rc1

Vallefor commented 1 year ago

I have checked AppImage v1.12.1-rc1. The bug still there :(

Vallefor commented 1 year ago

And yes, the bug is very similar that described in https://github.com/mingo-app/mingo/issues/555. With one exception - all my connections are remote.

tothradoslav commented 1 year ago

@Vallefor sorry, I forgot to mention, that you will have to remove these connections that have the issue and add them pack into Mingo. I understand that this is a very bad UX, but the UUIDs we used for were not safe enough in some cases. Please try to remove those two connections, then add them back again and try it (on 1.12.1 please).

Please let me know. Thank you and sorry again :(

Vallefor commented 1 year ago

@tothradoslav Ok. I deleted project (with name "bug" in my case). Then created it and create connections from scratch. Bug still there :cry: And lsof shows that mingo opens tunnel for only one server.

tothradoslav commented 1 year ago

sorry for my late response, we are trying to figure out the problem and will let you know. thanks!

tothradoslav commented 1 year ago

@Vallefor I just realized, that since you are using RC version, you have access to devtools inside Mingo. Could you please help me with the following?

  1. restart mingo
  2. open devtools (Option + Command + i on a mac, not sure about linux)
  3. in console, there should be some notes of "Reusing existing tunnel" or "Creating new tunnel", could you send me those? (nothing private, it's a md5 of ssh config)

Could you send these to me? Or a screenshot of console logs if nothing private is shown (should not be)

Thank you

Vallefor commented 1 year ago

@tothradoslav Sure.

I have restarted Mingo. I have opened dev tools (ctrl + shift + i). Switched multiple times with prod/dev.

I have two log strings with "tunnel" word: Creating new tunnel 601b24da0429569e124edcd79f5003cd Creating new tunnel 6b3dc60005e5d44d04e1b56375f276b2

2023-04-17_17-55

Vallefor commented 1 year ago

@tothradoslav Btw, I can give you access to my PC via Teamviewer or other software if it helps to determine the reason of the problem.

tothradoslav commented 1 year ago

This would be pretty helpfull. If you can send me an email to info@mingo.io, we could work on that from there. Thank you!

tothradoslav commented 1 year ago

Hi, any news on this? I'd like to solve this really weird issue :)

Vallefor commented 1 year ago

Hi. I have installed 1.12.1 version today and noticed that the bug is gone. But I remember that at 1.12.1-rc bug was reproducible. Strange but we can close this issue. Thanks for your work!

tothradoslav commented 1 year ago

Thanks, I will keep it open to be able to include this in our release notes.

tothradoslav commented 1 year ago

https://github.com/mingo-app/mingo/releases/tag/v1.13.1