Hi @kominami - my apologies for not responding to your earlier post on this.
Before 0.19, certain contexts would get deleted when new flows were deployed. We didn't want to change that behaviour for users who didn't enable the persistent context feature. Internally, that meant the new Memory context store was given the
delete() function to enable this - and why it only gets called if no stores have been enabled.
I've been review our design notes to see where we ended up on the
delete() function more generally. It is very important to note the design notes are working documents and not necessarily final design documents. In this case, the design note shows the intended API design was to have the
delete() function as the only way to remove context.
However, during the implementation and testing phase, a concern was raised that if NR was started with a different flow configuration, it wouldn't know about the 'old' nodes/flows, so it wouldn't be able to delete there contexts. This would leave things lying around that weren't needed. This is why the
clean() function was added. This gets called with a list of the known nodes/flows and allows the context store to clean out anything that's no longer needed. By introducing this function, the
delete() function became largely redundant - other than as a special case for the Memory store. But looking at it now, we failed to properly reflect that in the design.
So what does that all mean...
I don't think you need to implement
delete and I think we should remove it from the spec for the store interface. But I also want to make sure I'm not forgetting about some future plans for the store that would require the delete function.