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

Fixed reentrancy issue in pdf reader #733

Merged
merged 2 commits into from
Jul 31, 2023

Conversation

michalrentka
Copy link
Contributor

There was a RxSwift reentrancy issue in AnnotationsViewController.loadAttributedComment(for:) function. It was caused by calling self.viewModel.process(action: .parseAndCacheComment(key: annotation.key, comment: comment)) during ongoing update which then pushed another update.

@michalrentka michalrentka merged commit c3da010 into zotero:master Jul 31, 2023
1 check passed
@michalrentka michalrentka deleted the reentrancyfix branch July 31, 2023 08:10
@mvasilak
Copy link
Contributor

mvasilak commented Sep 11, 2023

@michalrentka this Reentrancy fix causes a regression, where annotation comments don't appear in the side bar.

The reason is that the returned value here doesn't use the updated state:

return self.viewModel.state.comments[annotation.key]

I suggest we re-introduce the reentrancy for the upcoming release, so that the regression is reversed, and we open an issue to properly tackle the reentrancy afterwards.

@michalrentka
Copy link
Contributor Author

michalrentka commented Sep 11, 2023

@michalrentka this Reentrancy fix causes a regression, where annotation comments don't appear in the side bar.

The reason is that the returned value here doesn't use the updated state:

return self.viewModel.state.comments[annotation.key]

I suggest we re-introduce the reentrancy for the upcoming release, so that the regression is reversed, and we open an issue to properly tackle the reentrancy afterwards.

Thanks for pointing out the issue. I was able to fix it with a rather simple fix so we shouldn't need to do anything else - #763

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants