Skip to content

[BUG] Expires_at filter not being used in the pipeline to send messages to the users #401

@kushagra0902

Description

@kushagra0902

Describe the bug
The message pipeline only uses the filer "deleted_at" and not expires_at. This will result in messages that are expired now still being sent to users. This is especially more problematic when we later enable gift-wrapped messages(in nip 42 project).

To Reproduce
Steps to reproduce the behavior:

  1. Generate a secret key using openssl rand -hex 128 and set it in your env
  2. use the script ./scripts/start to start a relay server
  3. send a message with an expiry of say 3 sec and after 3 sec try to retrieve it again.

Expected behavior
A no message or an empty message

System (please complete the following information):

  • OS: ubuntu 24.04
  • Platform: docker

Logs

Connected: ws://127.0.0.1:8008
IN: [
  'OK',
  '7b335ac11548ff49e3ddf7c4d6634e7706ac8ce11abafc60e247abf658ee1e12',
  true,
  ''
]
IN: [
  'EVENT',
  'before',
  {
    id: '7b335ac11548ff49e3ddf7c4d6634e7706ac8ce11abafc60e247abf658ee1e12',
    kind: 1,
    pubkey: '6aea200fe3cac06908496e47baebe68f88fa9cb85a1b7a8fa6f0d0abc426a36f',
    created_at: 1775687029,
    content: 'expiry-check-1775687029515',
    tags: [ [Array] ],
    sig: 'f1f4a115b0f40597065a9992880b635efefd4d35fc151eda6d87e0c393bc1ead6ebe4e633dc28ea07fba1a585d14e3a47bf6133b61eebd879982f60030a22185'
  }
]
IN: [ 'EOSE', 'before' ]
IN: [
  'EVENT',
  'after',
  {
    id: '7b335ac11548ff49e3ddf7c4d6634e7706ac8ce11abafc60e247abf658ee1e12',
    kind: 1,
    pubkey: '6aea200fe3cac06908496e47baebe68f88fa9cb85a1b7a8fa6f0d0abc426a36f',
    created_at: 1775687029,
    content: 'expiry-check-1775687029515',
    tags: [ [Array] ],
    sig: 'f1f4a115b0f40597065a9992880b635efefd4d35fc151eda6d87e0c393bc1ead6ebe4e633dc28ea07fba1a585d14e3a47bf6133b61eebd879982f60030a22185'
  }
]
IN: [ 'EOSE', 'after' ]
Result before expiry: FOUND
Result after expiry: FOUND

These are the result logs from a script that connects to the relay, sends a message with an expiry of 3 seconds and then again queries it.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggood first issueGood for newcomers

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions