[Bug] When the deletePassword method is called in the onModuleDestroy method, the electron closes with an unhandled exception.
Nikolay-Uvarov opened this issue · 0 comments
Nikolay-Uvarov commented
Prerequisites
- Put an X between the brackets on this line if you have done all of the following:
- Reproduced the problem in Safe Mode: https://flight-manual.atom.io/hacking-atom/sections/debugging/#using-safe-mode
- Followed all applicable steps in the debugging guide: https://flight-manual.atom.io/hacking-atom/sections/debugging/
- Checked the FAQs on the message board for common solutions: https://discuss.atom.io/c/faq
- Checked that your issue isn't already filed: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aatom
- Checked that there is not already an Atom package that provides the described functionality: https://atom.io/packages
Description
We use electron and keytar in the node.js project. We start our application and then we close it by calling method
import { app } from 'electron';
....
app.quit();
The credentials are created by:
await setPassword(config.name, accountName, password);
The credentials are deleted in the onModuleDestroy
method after app.quit():
public async onModuleDestroy(): Promise<void> {
const deletePasswordSet = this.accounts.map((account) => {
try {
return deletePassword(config.name, account);
} catch (error) {
this.logger.error(error, error.stack, this.context); // this line of code is not called.
}
});
await Promise.all(deletePasswordSet);
}
And we got this after closing the application:
Sometimes we got the following:
Steps to Reproduce
- Create the electron application.
- Create credentials in the Credential Manager via keytar.
- Close the electron application.
- Delete the credentials from the Credential Manager via keytar.
Expected behavior:
The application closes correctly.
Actual behavior:
The application closes with an unhandled error.
Reproduces how often:
This problem is reproducible on only one machine.
Versions
"keytar": "7.7.0",
"electron": 12.0
Additional Information
Windows 10 (20H2 #19042.867)