-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[$250] Web - Attachment - "Worker was terminated" console error when closing a PDF #47810
Comments
Triggered auto assignment to @kevinksullivan ( |
@kevinksullivan FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors |
ProposalPlease re-state the problem that we are trying to solve in this issue."Worker was terminated" console error shows up when closing a PDF view while it is still loading. What is the root cause of that problem?This error occurs because We previously fixed this issue in #31209, but it has reappeared since. The reason is that the previous fix patches the What changes do you think we should make in order to solve the problem?In addition to the Updated diff --git a/node_modules/react-pdf/dist/cjs/Document.js b/node_modules/react-pdf/dist/cjs/Document.js
index 9bb0398..032d898 100644
--- a/node_modules/react-pdf/dist/cjs/Document.js
+++ b/node_modules/react-pdf/dist/cjs/Document.js
@@ -289,6 +289,7 @@ const Document = (0, react_1.forwardRef)(function Document(_a, ref) {
pdfDispatch({ type: 'REJECT', error });
});
return () => {
+ loadingTask._worker.destroy();
loadingTask.destroy();
};
}
diff --git a/node_modules/react-pdf/dist/esm/Document.js b/node_modules/react-pdf/dist/esm/Document.js
index b1c5a81..569769e 100644
--- a/node_modules/react-pdf/dist/esm/Document.js
+++ b/node_modules/react-pdf/dist/esm/Document.js
@@ -261,6 +261,7 @@ const Document = forwardRef(function Document(_a, ref) {
pdfDispatch({ type: 'REJECT', error });
});
return () => {
+ loadingTask._worker.destroy();
loadingTask.destroy();
};
}
|
Job added to Upwork: https://www.upwork.com/jobs/~01a5b10381ea8600ab |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @paultsimura ( |
The proposal by @CyberAndrii looks good to me. 🎀👀🎀 C+ reviewed |
Triggered auto assignment to @thienlnam, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
Ideally we can upgrade this version so we can remove the amount of patches we use. In the previous issue, it looks like we considered that but didn't due to a re-render issue in v7. Has that been solved since then? It's been a year #31209 (comment) |
@thienlnam We're currently using v7.7.3, so most likely we already have a workaround for the re-rendering issue. I agree it would be a good idea to update to the latest version (v9), but it still doesn't have a fix for the 'Worker was terminated' error. I can probably submit a PR for them, and we would be able to upgrade after it's released. |
@thienlnam bumping the version will not only not solve the issue (as @CyberAndrii already mentioned), but it will require additional patches as mentioned by the package author in the migration guide. Therefore, I think we should go with the suggested patch. |
Thanks for the context - agree with patching for this issue since it's not resolved in the latest yet. However, I'm going to create another issue to remove the patches so we reduce the technical debt when we upgrade RN versions - if you'd like to submit an upstream PR for that issue that would be appreciated! |
📣 @paultsimura 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @CyberAndrii You have been assigned to this job! |
@CyberAndrii Here's the issue if you're interested in doing that #48124 |
Thanks! I'll submit a PR for this issue tomorrow and then look into fixing it in the upstream repo. |
Deployed to prod #48196 (comment) |
Regression Test Proposal
Do we agree 👍 or 👎 |
FYI @kevinksullivan – the payment is due tomorrow. |
Paid @paultsimura , offer sent to @CyberAndrii . Let me know when you accept! |
@kevinksullivan Accepted the offer |
all set |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: 9.0.23-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4880362&group_by=cases:section_id&group_id=292107&group_order=asc
Issue reported by:
Action Performed:
Navigate to https://staging.new.expensify.com/
Log in with a new Gmail account
Navigate to FAB - Start chat
Start a 1:1 DM with any account
Upload a small PDF (included)
Upload a large PDF (included)
Open the large PDF
Close the large PDF
Open the small PDF
Close the small PDF
Expected Result:
I should be able to close the PDF without a console error.
Actual Result:
"Worker was terminated" console error when closing a PDF after opening and closing a different, larger PDF. Sometimes I get the console error when closing an image attachment too.
Workaround:
Unknown
Platforms:
Screenshots/Videos
Bug6578472_1724261778978.bandicam_2024-08-21_19-25-00-639.mp4
Bug6578472_1724261778945!Small_PDF.pdf
Bug6578472_1724261778936!Large_PDF.pdf
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @paultsimuraThe text was updated successfully, but these errors were encountered: