remotestorage.js
remotestorage.js copied to clipboard
update local version of containing folder when a new items comes in from remote
When a folder listing is fetched, and we become aware of items that exist remotely but not locally, the entry in node.local.itemsMap is set to false. This is good because it means when you do getListing, you only see items that actually exist in the cache.
However, when such an item is then later fetched, its entry in the containing folder's node.local.itemsMap should be changed from false to true, and we're not currently doing that.
PS: a false entry in the local itemsMap can also indicate a local deletion. The way to distinguish them is that for unfetched items, no node exist, whereas for deleted items a node exists for the item itself with a common version still containing the content that was deleted, and then a local version with body false. This node is then removed when the DELETE request is sent, and after that the updated folder will be fetched with a GET. So there it al works correctly.
Next step:
- [ ] Write failing test
This is marked as blocker, but I think nobody currently understands the actual implications of the wrong behaviour, and yet we really want to release a new stable version with all the bugfixes since 0.11.0. @michielbdejong Do you think we should not release without fixing this? Or can we keep the blocker label, but at least release 0.11.1 to get all the other fixes out?
Yes, congrats on the 0.11.1 release! Ping me when you or someone else has time to pair on this one.
Unfortunately, our Internet connection here on Dominica is not sufficient for remote pairing.
Hey @michielbdejong, I thought I remembered that, on our last call, you said you'd make some unit tests to illustrate the issue, do you think you'll have some time to do that soon?
Yer, that would explain it to the person who wants to fix it then.
Yes, but we'll do that as part of the pairing session. And then immediately fix it while we're at it. Let me know as soon as someone has time.
If you just write a test, someone can pick it up and fix it without pairing. As I said, Internet connection here is not sufficient for remote pairing.
Edit: or it'll have to wait until mid February.
@skddc do you want to pair on this now?
I can pair on this now.