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

Fix blender save #590

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Fix blender save #590

wants to merge 8 commits into from

Conversation

dfaust
Copy link
Collaborator

@dfaust dfaust commented May 6, 2024

  • FIX: ordering of debounced events when multiple files are modified and renamed (eg. during a safe save performed by Blender)

The debouncer is getting increasingly complicated. It took me a few tries to design this change as defensively as possible. I hope it doesn't break anything.

This PR is based on #569.

Copy link
Member

@0xpr03 0xpr03 left a comment

Choose a reason for hiding this comment

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

I think we will need way more documentation to keep this usable in the future

@@ -455,7 +503,12 @@ impl<T: FileIdCache> DebounceDataInner<T> {
}

if let Some(target_queue) = self.queues.get_mut(&event.paths[0]) {
if !target_queue.was_created() {
if target_queue.was_removed() {
let event = target_queue.events.pop_front().unwrap();
Copy link
Member

Choose a reason for hiding this comment

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

are we fine with that unwrap ?


events_expired.push(event);
} else {
self.queues.get_mut(&path).unwrap().events.push_front(event);
Copy link
Member

Choose a reason for hiding this comment

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

same here for unwrap stuff - want to avoid crashing and rather report an error

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

2 participants