-
Im on drift 2.11.1.
If there is a record already in the table before I watch on this query, everything works great. I have a sync class that writes to the table periodically after an API call and all updates to the records with that ID are published to my watch as expected. However if there is no record that has that ID when the watch is called and my sync inserts a record that does have that ID after the watch was called, I never get an event on that watch. If I call that watch again after the insert it works as expected. Ive even tried this with no where clause on my query, what I assumed was equal to just observing the table. New record inserts never get published down stream. Is it accurate to say that watching only looks at pre-existing records and updates on them? If so, is there a method or listening to inserts as well? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
No, this is not expected behavior - the newly inserted record should be reflected in the stream. Can you check what happens if you do an update on the watched record? Do you see the updated values immediately or is there are similar problem there (with the stream perhaps reporting outdated values)?
If possible, can you try upgrading and see if the problem persists? |
Beta Was this translation helpful? Give feedback.
Haven't smoothed out everything but did make a discovery yesterday that might be of interest to you.
The original implementation has a nested stream within the stream I was concerned with listening to.
Essentially, the first stream calls an asyncExpand and then opens a new stream within to a different repository and marries the data together before emitting.
Removal of this inner stream in favor of just a regular query has seemingly corrected the flow. Not sure what all that means underneath the hood and if thats something you'd be interested in, but thought I'd share.
Im guessing the original dev on this wanted to listen to changes to both tables and couldn't come up with a single query …