refactor(tasks): debug outputs for task creation

This commit is contained in:
xeruf 2025-01-29 22:59:01 +01:00
parent fd7819e979
commit 220d713675

View file

@ -1120,7 +1120,7 @@ impl TasksRelay {
Some(id) Some(id)
} }
/// Create the task only incorporating context /// Create the task, only adding context tags
fn make_task_unchecked( fn make_task_unchecked(
&mut self, &mut self,
input: &str, input: &str,
@ -1130,8 +1130,7 @@ impl TasksRelay {
if tags.iter().any(|t| t.kind() == TagKind::p()) { if tags.iter().any(|t| t.kind() == TagKind::p()) {
None None
} else { } else {
self.pubkey self.pubkey.map(|p| Tag::public_key(p))
.map(|p| Tag::public_key(p))
}; };
let prio = let prio =
if tags.iter().any(|t| t.kind().to_string() == PRIO) { if tags.iter().any(|t| t.kind().to_string() == PRIO) {
@ -1139,13 +1138,15 @@ impl TasksRelay {
} else { } else {
self.priority.map(|p| to_prio_tag(p)) self.priority.map(|p| to_prio_tag(p))
}; };
self.submit( debug!("Making task {} with Assignee {:?} Prio {:?} Tags {:?}", input, assignee, prio, tags);
let builder =
EventBuilder::new(TASK_KIND, input) EventBuilder::new(TASK_KIND, input)
.tags(self.context_hashtags()) .tags(self.context_hashtags())
.tags(tags) .tags(tags)
.tags(prio) .tags(prio)
.tags(assignee), .tags(assignee);
) debug!("{:?}", builder);
self.submit(builder)
} }
/// Primarily for tests /// Primarily for tests