HelloZeroNet / ZeroMe

Social network for ZeroNet
GNU General Public License v3.0
165 stars 76 forks source link

Following Bug #99

Open ghost opened 7 years ago

ghost commented 7 years ago

When I click Follow on someone's profile and go back to home page, it shows their posts in the followed users tab. However, refreshing the page will make those posts dissapear until I click Follow again on their profile.

ghost commented 6 years ago

It should be noted that the very first person you follow doesn't have this problem. But all others do.

HelloZeroNet commented 6 years ago

I have tried to reproduce it:

Am I missing something?

What browser are you using? When you click on follow button does the publishing message appears?

ghost commented 6 years ago

That's exactly what I did. The only difference is that the posts do not show up. It happens in all browsers. However, as stated above, the first person I followed after first visiting ZeroMe on a device will show up. All others don't. Also, the users I'm following do show up in the following section of my profile and I do get the publishing message.

This has also happened on multiple devices of mine, so I don't think it's a problem with my device/client.

My profile shows to other people that I'm following people, but going to their profiles, they don't show that I'm following them. These are the people shown on my ZeroMe profile that I'm following. But notice that the only one with a green circle with an X is Glightstar.

image

ghost commented 6 years ago

I looked at my data.json file in my hub (kaffiene hub; \data\1oranGeS2xsKZ4jVsu9SVttzgkYXu4k9v\data\users\12gAes6NzDS9E2q6Q1UXrpUdbPS6nvuBPu) and noticed that I have a lot of duplicates. This is probably due to the fact that I keep clicking to follow people after refresh because every time I refresh, it doesn't show the person as followed.

image

ghost commented 6 years ago

Another thing: After removing all followers from my data.json file, Glightstar still shows up as followed by my computer, but not on my profile.

ghost commented 6 years ago

I have found the problem. I looked at the ZeroMe sql database in an sql browser. In the json table, I searched for my name from ther "cert_user_id" column. If you look below, all sites show the hub as "12h51..." (kaffiene hub) except for "1White24..." (White Hub), which shows the hub as "1White24".

image

Upon further investigation, I see that I have two followers, one of which is Glightstar in the data file under White Hub:

image

So ZeroMe was using the follows from White Hub instead of Kaffiene Hub.

HelloZeroNet commented 6 years ago

Thanks for the investigation. Normally there should be no more than one profile for one user. To avoid this I added a confirmation on new profile creation when the user already have one: https://github.com/HelloZeroNet/ZeroMe/commit/eba38e3466996a973935291d677c80e24765d60d And also added a hub selection to the 3dot menu if more than one profile found for the same user: https://github.com/HelloZeroNet/ZeroMe/commit/614851064efec30d418d161c14b9fe9dbb429764

I hope this solves the problems

0polar commented 6 years ago

http://127.0.0.1:43110/1QHbf72f4vdx3QAxN1LTN9KP19J428Q85R