Skip to content

Relays are not returning filtered EVENT messages #192

@tcheeric

Description

@tcheeric

Hello Nick @avlo , I will need your help here:

When I submit a REQuest to the relay, I only get an EOSE message back, without the matching event(s).
The expectation is to get the EVENT and EOSE json messages in the result list.

Here is a test case to demonstrate it:

ApiEventTest.testCreateReqMessage

  @Test
  public void testCreateReqMessage() {
    System.out.println("testCreateReqMessage");

    Identity identity = Identity.generateRandomIdentity();
    var nip01 = new NIP01<TextNoteEvent>(identity);
    BaseMessage message = nip01.createTextNoteEvent("Hello simplified nostr-java!").signAndSend(RELAYS);

    Filters filters = Filters.builder()
            .kinds(List.of(Kind.TEXT_NOTE))
            .authors(List.of(identity.getPublicKey()))
            .build();

    List<String> result = nip01.send(filters, UUID.randomUUID().toString());

    // Expected are the corresponding EVENT and EOSE messages
    assertEquals(2, result.size(), result.toString());
  }

testCreateReqMessage

org.opentest4j.AssertionFailedError: [["EOSE","790ba679-9d89-4db8-8018-18a10a184d3b"]] ==>
Expected :2
Actual :1

at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
at org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:150)
at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:560)
at nostr.test.event.ApiEventTest.testCreateReqMessage(ApiEventTest.java:79)
...

Can you please have a look?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions