Open rchrd2 opened 6 years ago
The documentation you linked also shows true
as only value for directory items. However, you're right about the objects, and the documentation is completely missing that information!
The story is that the cached data format hasn't been adapted yet, after the RS protocol changed the data available in listings a while back. It's a rather invasive change, and we both wanted to wait until the old protocol version was outdated enough (which is now the case), as well as refactor the caching and sync code first (which is currently in progress). Here's the original issue about it, incl. more information in the comment history: #721 (TL;DR: metadata is only stored on item nodes in cache, but getListing
does a single request to the directory node)
I think it's high time we tackled this. Let's put it on the agenda for 1.1.0
! Any takers, please self-assign the issue, or announce your working on it as a comment here. Thanks.
(Btw, you can upgrade rs.js to 1.0.2 already
.)
The docs now contain a warning about this: https://remotestoragejs.readthedocs.io/en/latest/js-api/base-client.html#getListing
Thanks for bringing it up, @rchrd2!
The documentation makes me expect a response that has more info than just
true
. http://remotestoragejs.readthedocs.io/en/latest/js-api/base-client.html#list-of-functionsAm I doing something wrong, or is there a bug? This is
"remotestoragejs@1.0.0",
client.getListing('')
response:Actual API response
Update:
The problem goes away when I disable local cache (IndexDB in my case)