(feat): add support for Nostr tags #2357
Ticket(s) / Related Merge Requests
Issue: #2357 (closed)
Summary of Changes
This MR adds support for saving/querying Nostr events with tags. This allows for querying replies and mentions.
Note: This only applies to native Nostr posts, querying Minds posts based on tags is still WIP.
Testing Considerations
You can test by posting a reply to a post using a Nostr client, such as branle or astral.ninja. You can mention a public key in a post, which should also work correctly.
Since you can query using the #p
tag now, notifications should also be working. Albeit somewhat limited as we don't proactively push events to clients yet.
You can also test by sending queries manually using a WebSocket client:
An example query for replies to an event might look like:
["REQ","subscription-id",{"kinds":[1],"#e":["5ed1b7fff18700914708ff7d43368ff1563162706d0395cf870b2115c64342d5"]}]
And another query for events mentioning a public key:
["REQ","subscription-id",{"kinds":[1],"#p":["f905df7bb8514849d798f31817b36e408377f377bb9cb8c0a3e670c481fa270e"]}]
Deployment Considerations
We will need to add the e_ref
and p_ref
columns to the nostr_events
table prior to deploying:
ALTER TABLE minds.nostr_events
ADD COLUMN e_ref VARCHAR(64) AFTER tags;
ALTER TABLE minds.nostr_events
ADD COLUMN p_ref VARCHAR(64) AFTER e_ref;
Regression Scope
This should affect the Minds engine, specifically the Nostr endpoints.
Platform Affected (web, mobile, etc)
Web
Developer Testing Completed
Deployed changes to sandbox and tested interacting with the relay using the astral client.
Screenshots / Screen Recording
Does this impact
-
Localization -
Dark/light mode -
Guest mode
Definition of Done Checklist
-
The Acceptance Criteria has been met -
Code is tested: Testing includes unit/spec, E2E/automated and manual testing -
Merge requests description has been filled out