Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#38: New update_one method #42

Merged
merged 2 commits into from
Sep 7, 2023
Merged

#38: New update_one method #42

merged 2 commits into from
Sep 7, 2023

Conversation

kirillt
Copy link
Member

@kirillt kirillt commented Aug 31, 2023

New update_one method enables library users to update a single entry in the index.

This is useful for scenarios where we performed some action on a resource and want to quickly adjust app model with the index. More details in the issue:

The usage in an app should be like this:

  1. App has the index. It is allowed to be slightly outdated.
  2. User deletes or edits a resource. New resource by the same path has different content.
  3. Full updating using update_all would spend some time and user could be annoyed by necessity to wait before they can move to next resource in their selection. That's why we call update_one and pass path of the edited resource.
  4. We receive update from the index and handle it uniformly to any external updates.
  5. Since we used this update_one method, the index still can be outdated, same as in step 1. That's fine because the app model and the index are in sync.
  6. When the user is done with their selection, we can call update_all and catch up with external updates to the filesystem.

@@ -16,7 +16,7 @@ jobs:
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double-check that Pdfium works. Nightly was introduced when we were fixing it.

@kirillt kirillt merged commit 82ba6ac into main Sep 7, 2023
1 check passed
@kirillt kirillt deleted the 38-update-one branch September 30, 2023 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant