Skip to content

Commit

Permalink
fixed sPub behavior
Browse files Browse the repository at this point in the history
it stored the value, now it correctly only publishes it
  • Loading branch information
babymotte committed Oct 13, 2024
1 parent bbabe92 commit e9ca0b8
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions worterbuch/src/worterbuch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,24 +346,7 @@ impl Worterbuch {
client_id: Uuid,
) -> WorterbuchResult<()> {
if let Some(key) = self.lookup_key(client_id, transaction_id) {
check_for_read_only_key(&key, client_id)?;

let path: Vec<RegularKeySegment> = parse_segments(&key)?;

let (changed, ls_subscribers) = self
.store
.insert(&path, value.clone())
.map_err(|e| e.for_pattern(key.to_owned()))?;

log::trace!("Notifying ls subscribers …");
self.notify_ls_subscribers(ls_subscribers).await;
log::trace!("Notifying ls subscribers done.");
log::trace!("Notifying subscribers …");
self.notify_subscribers(&path, &key, &value, changed, false)
.await;
log::trace!("Notifying subscribers done.");

Ok(())
self.publish(key, value).await
} else {
Err(WorterbuchError::NoPubStream(transaction_id))
}
Expand Down

0 comments on commit e9ca0b8

Please sign in to comment.