Skip to content

NDK subscription returns events with an undefined sig #350

@mostafa-khaldi

Description

@mostafa-khaldi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions