Skip to content

Clarification on caching all items and fetching only changed items #55

@jrvarma

Description

@jrvarma

I am trying to use Etebase's Local Cache to recreate the Etesync 1.0 sync functionality where the local cache could be updated with only changed items.

My plan is as follows:

At end of day

  • Use item_mgr.cache_save(item) to save the item to cache. Presumably, I would have to put this in a loop (for item in items:) to save all items to local storage.
  • Also store items.stoken to local storage.

Come back next day

  • Run a item_mgr.cache_load(cache_blob) loop to load all items.
  • Fetch new items with items = item_mgr.list(FetchOptions().stoken(stoken))

What I do not understand is how to merge the cache and the new/updated items. One possibility is to convert items into a python dict with uid as key and do something like
updated_items_dict = cached_items_dict.update(new_items_dict)

Would appreciate any help on how to go about doing this.

Also the python source code contains a function cache_save_with_content. Is this of any use in this context? I can understand python code but not rust

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions