Subject: [core] Observer with Get and Fetch

From: Jim Schaad <[email-masked]>
Date: Fri, 30 Aug 2019 12:26:28 -0700

I have been starting to do some playing with Pub-Sub servers and in the
process I ran into a question about how observe and fetch are supposed to be
working together.

If you observe a resource with GET, then the resource itself can make a
simple decision about sending an observer notification if the same value is
re-published into it.  This can be done based on things like max age and its
own internal state.  In the case of doing an observer with a FETCH, this
problem expands to be a bit larger.  A resource can be updated with a
different value, but if the fetch criteria is applied then there may not be
a difference in the resource that would be returned beyond things like
MAX-AGE and ETAG.  Should the updated resource always be returned even if it
does not appear to have a value change?  The same rules as for a single
resource can be applied if there is no change in the content of the
resource.

I was not able to find any good guidance in either the observe or fetch
RFCs.  There is a discussion about using some filtering criteria in RFC 7641
(observe), section 4.3.1 gives text that corresponds to what I said above
but there is no equivalent to that text in the FETCH RFC.  The state that
needs to be kept for GET is small, just the last time one sent the
notification relative to the max age of the current one.  This is much more
complicated when looking at fetch as knowing when things are going to expire
may be dependent on each different set of filtering that was provided for
the fetch operation.  Is the best thing to do is to ignore the fact that the
content would be the same and always return a notification if the content
was changed?

The specific thing I was looking at was doing a fetch on the
"has-published-item" property of a topic on the pub-sub server which is
"refreshed" every time that new content is published in the data item (or it
expires). But one really only generally would only care about changes in the
state.

Jim