ndk icon indicating copy to clipboard operation
ndk copied to clipboard

NDK subscription returns events with an undefined sig

Open mostafa-khaldi opened this issue 2 months ago • 0 comments

This issue started while ago, as I subscribe for events, most of the returned ones are without signature, I even forced the params on the subscription options to not skip verification nor validation, see below my code

   let sub = ndk.subscribe(
      filter_,
      {
        groupable: false,
        skipVerification: false,
        skipValidation: false,
        relayUrls: relayUrls.length > 0 ? relayUrls : userRelays,
      },
      {
        onEvent(event) {
          if (events.length <= maxEvents) {
            pubkeys.push(event.pubkey);
            events.push(event);
            if (maxEvents === 1) {
              sub.removeAllListeners();
              sub.stop();
              resolve({
                data: sortEvents(removeEventsDuplicants(events)),
                pubkeys: [...new Set(pubkeys)],
              });
            }
            startTimer();
          }
        },
        onEose() {
          if (events.length === 0) startTimer();
        },
      }
    );

And this is one of the returned events, actually all the batch looks like this

Image

These events can’t be republished nor reposted, as the relays rejects them for this cause. is there a trick to avoid this or this is a bug in the NDK itself?

EDIT: I also sometimes get events with an undefined ids.

mostafa-khaldi avatar Oct 29 '25 03:10 mostafa-khaldi