lumehq / lume

Lume is a nostr client for macOS and Windows 11.
https://lume.nu
GNU General Public License v3.0
248 stars 24 forks source link

Better relay management #124

Open TonyGiorgio opened 10 months ago

TonyGiorgio commented 10 months ago

Please pull from the user's nostr relay list. I selected the outbox model but it's not pulling in all of my relays, some that I pay for so I want this reflected. The first load time of my feed was quite poor for 5 or so minutes.

Also, when I go through the relay page to start adding the ones I already have, it cleared the existing list that was already there. I think having to manage my relays when trying out a new nostr client is a bad experience.

reyamir commented 10 months ago

Hi Tony, thank for your valuable feedback, it is main issue still struggle me, I'm working to improve it

reyamir commented 10 months ago

Thank @TonyGiorgio, I've realise a lot of dumb mistake in my code, I actively working to improve it in the next branch. I'm happy invite you trying preview version when it done (expect at this weekend)

TonyGiorgio commented 10 months ago

Thank you!

reyamir commented 10 months ago

Hi @TonyGiorgio I've published v2.2.0 as pre-release version, I will do some more testing and will release it on tomorrow If you have free this the weekend, you can download and test it https://github.com/luminous-devs/lume/releases/tag/v2.2.0

TonyGiorgio commented 10 months ago

Just tried it out. The home page loaded up really fast, nice one!

However, the relay list doesnt show up. I was going to try deleting the data and trying again with a fresh account but noticed there was no delete data button in the app. So not sure why nothing is showing up.

Screenshot 2023-12-03 at 1 37 49 AM
TonyGiorgio commented 10 months ago

Could not another issue, not sure if it has to do with this release. But I just tried to give a random event a clap emoji like and I got a blank screen right after.

Screenshot 2023-12-03 at 1 40 44 AM
reyamir commented 10 months ago

Just tried it out. The home page loaded up really fast, nice one!

However, the relay list doesnt show up. I was going to try deleting the data and trying again with a fresh account but noticed there was no delete data button in the app. So not sure why nothing is showing up.

Screenshot 2023-12-03 at 1 37 49 AM

oh, seem strange bug, it just fetch event kind 10002, I will check it and also add a reload button for this part if you want to clear data, you can go to settings screen -> advanced. Lume local db is mostly use for NDK cache

image
TonyGiorgio commented 10 months ago

Ohh, I saw it said "boost up NDK" and thought it was just something related to that.

Uhm, okay, maybe I have to investigate this then. I'm seeing relay lists different on each client I use and tbh idk if it got wiped at some point or not. I see I have 0 relays on Lume, 0 relays on another client, 1 relay on a different client, and amethyst & primal show me the ~12 I expect. Honestly not sure what's going on.

reyamir commented 10 months ago

oh, I just try to query your relay list, and it not return anything

image

my code

const event = await ndk.fetchEvent(
        {
          kinds: [NDKKind.RelayList],
          authors: [db.account.pubkey],
        },
        { cacheUsage: NDKSubscriptionCacheUsage.ONLY_RELAY }
);

I will update this code for fetch all events with more limit instead of 1

reyamir commented 10 months ago

same with limit 100, I'm querying your relay list on relay.damus.io and relay.nostr.band. I',m not sure why they not return your relay list

I've tested with my account and I also create some account for test. It still work fine

image
TonyGiorgio commented 10 months ago

Weird, okay thank you. Then maybe it's working as intended and something is wrong with my profile. I'll double check tomorrow. Thanks!

reyamir commented 10 months ago

oh thank you for testing new build today, I'm also updating UI for this part, it need to show "Your relay list is empty, please add some" instead of blank space

TonyGiorgio commented 10 months ago
Screenshot 2023-12-03 at 12 53 38 PM

Great! Working well now. I did clear cache and then restart and my relays started showing up after using https://metadata.nostr.com/ and then https://nostrit.com/push to make sure it was broadcasted everywhere. Appreciate the help here and coding this up!

reyamir commented 10 months ago

Yo, I'm happy it working well on your side now