File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ impl Doc {
116
116
pub fn observe ( & mut self , py : Python < ' _ > , f : PyObject ) -> PyResult < Py < Subscription > > {
117
117
let sub = self . doc
118
118
. observe_transaction_cleanup ( move |txn, event| {
119
- if event. before_state != event. after_state {
119
+ if !event . delete_set . is_empty ( ) || event. before_state != event. after_state {
120
120
Python :: with_gil ( |py| {
121
121
let event = TransactionEvent :: new ( event, txn) ;
122
122
if let Err ( err) = f. call1 ( py, ( event, ) ) {
Original file line number Diff line number Diff line change @@ -191,3 +191,15 @@ def test_empty_update():
191
191
doc ["text" ]
192
192
# empty updates should not emit an event
193
193
assert not events
194
+
195
+
196
+ def test_not_empty_update ():
197
+ doc = Doc ()
198
+ doc ["text" ] = text = Text ()
199
+ events = []
200
+ sub = doc .observe (partial (callback , events )) # noqa: F841
201
+
202
+ text += "helloo"
203
+ events .clear ()
204
+ del text [5 ]
205
+ assert events
You can’t perform that action at this time.
0 commit comments