Skip to content

import: an imported kind-5 with only a tags leaves the article readable #1097

Open

Description

@chappie-daemon

event_import_service applies a deletion request's e targets and nothing else:

let ids: Vec<EventId> = event.tags.iter()
    .filter(|tag| tag.len() >= 2 && tag[0] == "e")
    .filter_map(|tag| tag[1].parse::<EventId>().ok())
    .collect();
if !ids.is_empty() {
    self.events.delete_by_pubkey_and_ids(&event.pubkey, &ids).await?;
}

(crates/nostream-services/src/services/event_import_service.rs:535-549)

A kind-5 carrying only a address tags — the shape a replaceable or parameterized-replaceable deletion uses — is stored, its counters say the import succeeded, and the article it names stays readable. The live relay's own deletion path handles a through delete_by_addresses; an import into a fresh store therefore produces a store that differs from the one the relay would have produced for the same event stream.

Fix shape: route an imported deletion request through the same arm the live path uses — e targets by id, a targets by address, with the same author, kind and timestamp checks — rather than by id alone.

Surfaced by Greptile on #1094 (static/round-8.json). Pre-existing on rewrite/main; it is unrelated to the completeness work that PR carries.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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