SMB2 CHANGE_NOTIFY looks promising, as if it could deliver enough information on subdirectory or subtree updates from the server, so we can keep our listing of remote directory up-to-date by handling the response.
However, it's not a subscription to an event stream, just a one-off command receiving one response, so I suspect that it can be used only as a mere hint to invalidate our cache and reread the directory. When we receive a response, there could be any additional changes before we send another CHANGE_NOTIFY request, and we'll miss the details of these changes.
Is there any way around this problem? Or is rereading directory on learning that it's updated a necessary step?
I want to understand possible solutions on the protocol level (you can imagine I'm using a customized client that I can make do what I want, with some common servers like Windows or smbd3).