Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch events with subscription and check relay #371

Open
5 tasks
MSghais opened this issue Dec 15, 2024 · 33 comments
Open
5 tasks

Fetch events with subscription and check relay #371

MSghais opened this issue Dec 15, 2024 · 33 comments
Labels
frontend Web & Mobile & UI/UX good first issue Good for newcomers help wanted Extra attention is needed mobile React native dev ODHack11 ODHack 11 issues LFG

Comments

@MSghais
Copy link
Member

MSghais commented Dec 15, 2024

Description

We when fetchEvent with ndk.fetchEvents, if a relay are not unreachable, it's throw an error and return an empty array.
Create a robust subscription/fetch that's return datas of the reachable relay Nostr, check the nostr-dev-kit

Do this hooks in: packages/afk_nostr_sdk.

Try different more robust implementations that's not throw an error if one of the relay have an issue:

  • ndk.subscribe(), check if relay

  • a hooks that's check if relay is ok before fetch

  • Try to add this Relay with error in the relay.ts:

    'wss://relay.nostr.band',
    'wss://purplepag.es',
    'wss://relay.snort.social',
    'wss://nos.lol'

  • Create a robust hooks with ndk.subscribe, that fetchEvent and not throw error if relay is unreachable

  • Create a store data with zutsand for Notes subscription, so we can render it like a webhook in the UI

Few relays to test, check if one is not working also try with RELAYS undefined or incorrect:

@MSghais MSghais added good first issue Good for newcomers help wanted Extra attention is needed frontend Web & Mobile & UI/UX mobile React native dev ODHack11 ODHack 11 issues LFG labels Dec 15, 2024
@OWK50GA
Copy link

OWK50GA commented Dec 15, 2024

Hi, I'm Wilfrid Okorie, a Frontend Web Developer and I'd like to take this issue

@Emmanex01
Copy link

Can I try solving this issue?
I'm a software developer, I have experience building with Typescript, JavaScript, Cairo. I have built and contributed to projects both on ODHack and off ODHack. If given the opportunity I would deliver as soon as possible.

@Birdmannn
Copy link
Contributor

Omo

@ekumamatthew
Copy link

I’d love to work on this task.

@akintewe
Copy link
Contributor

Hello i was hoping if i can give this a shot again, i understand the task and i would like to work on it carefully. ETA 12 hours

@Jagadeeshftw
Copy link

Can I try solving this issue?

@jahrulezfrancis
Copy link

I’m interested in this issue, I can contribute by creating a robust hook in packages/afk_nostr_sdk for handling ndk.subscribe() and fetchEvents. My approach will focus on improving error tolerance, ensuring data retrieval from reachable relays, and avoiding disruptions when encountering unreachable or misconfigured relays.

To achieve this, I’ll:

Check relay status before fetching data.
Implement fallback mechanisms to handle errors gracefully.
Integrate zustand for state management, enabling seamless data rendering like a webhook in the UI.
Test extensively with the provided relays, including scenarios with undefined or incorrect RELAYS.
ETA: 24 to 36 hours tops

@3th-Enjay
Copy link

I'd like to take this issue.

@Amarjeet325
Copy link

Can I contribute to this one?

@ikemHood
Copy link

Hello @MSghais,

I'm interested in contributing to this issue.

As a developer experienced with Nostr development and state management, I can help create a robust solution for handling relay connectivity and event fetching.

What I would do in this task involves:

Implementing a resilient hooks in packages/afk_nostr_sdk that handles potential relay connection issues
Creating a Zustand store for managing Notes subscriptions
Developing error-handling mechanisms for ndk.fetchEvents() and ndk.subscribe()
Testing the implementation with multiple relays, including edge cases like unreachable or undefined relays

I would be able to complete this within 2 days,

My approach will focus on:

  • Graceful error handling
  • Partial data retrieval from available relays
  • Efficient state management
  • Comprehensive testing of different relay scenarios`

@jaykayudo
Copy link

Can i be assigned this issue?

@greatest0falltime
Copy link

@MSghais, i'd like to work on this issue

@davedumto
Copy link

Hi,
My name is David, and I am a frontend developer skilled in JavaScript, TypeScript, React.js, Next.js, and robust state management using tools like Zustand. I am excited to create a robust hook in packages/afk_nostr_sdk to handle ndk.fetchEvents and ndk.subscribe() without throwing errors when relays are unreachable.

Here’s how I’ll approach the task:
Implement a relay health-check mechanism to ensure only reachable relays fetch events.
Test with the provided relays, including those with errors (relay.ts).
Create a state store using Zustand to manage and render Notes subscriptions in the UI like a webhook.
Ensure the implementation handles incorrect or undefined relays gracefully.
ETA: 3 days.

@OJDIT
Copy link

OJDIT commented Dec 17, 2024

May I be assigned to this?

@Kingsuite
Copy link

Is it okay if I take this? It will be nice to contribute to this awesome project

@emarc99
Copy link

emarc99 commented Dec 17, 2024

I'd love to give this a go.

@Supa-mega
Copy link

Can I tackle this one?

@caxtonacollins
Copy link

I am a Full Stack Developer with two years of professional experience, specializing in web3. I have strong background in blockchain and extensive experience in Next.js/React, TypeScript, Cairo and Rust.

I will like to take care of this.

@danielrobotz
Copy link

am a frontend dev, can I try solving this issue?

@olisaagbafor
Copy link

Can I contribute to this one?

@Nityam573
Copy link

Can I take this issue?

@sonkeydotcom
Copy link

Could I grab this task?

@aidenwong812
Copy link

I’d like to work on this.

@VyuduInc
Copy link

I'd like to handle this task.

@PrathamJha1
Copy link

I’m interested in this one.

@bestselection18
Copy link

Can I tackle this one?

@uzochukwuV
Copy link

May I try my hand at this?

@demola234
Copy link

Could I take a shot at this?

@chiscookeke11
Copy link

I'd love to give this a go.

@TobieTom
Copy link

TobieTom commented Feb 2, 2025

Could I take over this issue? I am currently new but already have experience from a Starknet Jigsaw Puzzle game and would love to add this to my experience on starknet chain

@Akosachinedu
Copy link

Can I take this issue?

i want to be the test automation engineer, can i ?

@Verifieddanny
Copy link

I am a Frontend Developer, i have experience in Typescript and i have read all the requirements in the documentation, and i am happy to contribute to this task. This task is within my capabilities. My ETA is 10 hours

@Elite-tch
Copy link

Can I contribute to this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend Web & Mobile & UI/UX good first issue Good for newcomers help wanted Extra attention is needed mobile React native dev ODHack11 ODHack 11 issues LFG
Projects
None yet
Development

No branches or pull requests