skdb
skdb copied to clipboard
Fix: propagate updates when in a transaction
I noticed that if tailing a reactive view built on a table I:
-
do an insert in to the source table, the tail outputs the update instantly
-
do the same insert wrapped in a transaction, it does not update until the condvar times out
Digging in, this seems to be because the context isn't update()d and so the changed dir names do not include the view, so notify never triggers the condvar.
I figure this is the right fix rather than updating at the end. It makes sense that within a txn you would be able to read the effect of a write on downstream views after it has happened.
I agree with the fix. Maybe it might be worth adding a mechanism to make sure the update was called whenever the context was modified?
If we tripped over it here, there might be other places like that.
might be worth adding a mechanism to make sure the update was called whenever the context was modified?
Already on my todo list. This isn't the first time we've been bitten. Are there any situations you can think of where we don't automatically want to update though?
local sequence number test failure looks legitimate, though -- I guess that logic relies on the context not updating within a transaction.
Yeah was relying on the gen sym counter. Now that we call update it will be bumped. I just updated the test expectation so tests should pass now.