Skip to content

Commit 51027f4

Browse files
committed
fix: collab origin for observer notifications
1 parent 0925271 commit 51027f4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

collab-database/src/database.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1715,6 +1715,11 @@ impl DatabaseBody {
17151715
notifier: Option<DatabaseNotify>,
17161716
) -> Option<Self> {
17171717
let txn = collab.context.transact();
1718+
let origin = if notifier.is_some() {
1719+
collab.origin().clone()
1720+
} else {
1721+
CollabOrigin::Empty
1722+
};
17181723
let root: MapRef = collab.data.get_with_txn(&txn, DATABASE)?;
17191724
let database_id = root.get_with_txn(&txn, DATABASE_ID)?;
17201725
let fields: MapRef = root.get_with_txn(&txn, FIELDS)?; // { DATABASE: { FIELDS: {:} } }
@@ -1723,7 +1728,7 @@ impl DatabaseBody {
17231728

17241729
let fields = FieldMap::new(fields, notifier.as_ref().map(|n| n.field_change_tx.clone()));
17251730
let views = DatabaseViews::new(
1726-
CollabOrigin::Empty,
1731+
origin,
17271732
views,
17281733
notifier.as_ref().map(|n| n.view_change_tx.clone()),
17291734
);

0 commit comments

Comments
 (0)