Skip to content

missing general functionality for updating events based on d tag #88

@anasfik

Description

@anasfik

Hey @UTXOnly

When a certain event is created whatever its kind, whenever it contains a d tag like this event:

{
	"content": "...",
	"created_at": 1735485203,
	"id": "...",
	"kind": 1,
	"pubkey": "userPubkey",
	"sig": "...",
	"tags": [
		[
			"d",
			"uniqueId"
		]
	]
}

Updating functionality should happen to that event if a newer modified event was sent to the relay with the same kind (in this case 1), d tag id (in this case uniqueId), by the same user pubkey (in this case userPubkey) and if its created_at is greater than existent one(s), of course after the id and sig is validated as well.

As example, if we try to load posts with:

[
	"REQ",
	"quer",
	{
		"kinds": [
			1
		]
	}
]

let's say they will get us posts with these event contents:

  • "hello world 1"
  • "hello world 2"
  • "hello world 3"

Then let's say we updated the fist one's event content, when we request again it should return:

  • "hello world 1 (updated)"
  • "hello world 2"
  • "hello world 3"

An event changes should be based on its content, tags (addition/removal) and tags values

Would be nice to have:

it would be better I say if we can even retrieve all event updates/changes on a specific request, like if we want to get previous changes of an event, we would do:

[
	"REQ",
	"querrr",
	{
		"#d": [
			"uniqueId"
		],
		"limit": 50
	}
]

an it should list them, so basically what I say here is that the Postgres database should store all events, but only returns the only the newest one by id until we ask it to get them all.

Thank you and we appreciate it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions