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/import acct when timed out #1832

Merged
merged 2 commits into from
Feb 3, 2025

Conversation

piyalbasu
Copy link
Contributor

Similar to add account, if our session has timed out, make sure to log back in before adding a new account to the mix

@@ -466,6 +469,8 @@ export const popupMessageListener = (request: Request, sessionStore: Store) => {

const currentState = sessionStore.getState();

sessionTimer.startSession();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Small oversight - we were not starting the session timer on account creation

@@ -491,9 +496,6 @@ export const popupMessageListener = (request: Request, sessionStore: Store) => {
keyName: TEMPORARY_STORE_EXTRA_ID,
});
} catch (e) {
captureException(
`Could not login when adding account: ${JSON.stringify(e)}`,
);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

removing this Sentry alert because this will be triggered every time a user enters an incorrect password. This will pollute our Sentry dashboard with non-errors

let activePrivateKey = "";
try {
// await _unlockKeystore({ keyID, password });
await _unlockKeystore({ keyID, password });
Copy link
Contributor Author

Choose a reason for hiding this comment

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

mistakenly left this out - make sure to check the user's password is correct

@@ -555,12 +560,39 @@ export const popupMessageListener = (request: Request, sessionStore: Store) => {
const importAccount = async () => {
const { password, privateKey } = request;
let sourceKeys;

let mnemonicPhrase = await getEncryptedTemporaryData({
Copy link
Contributor Author

@piyalbasu piyalbasu Feb 3, 2025

Choose a reason for hiding this comment

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

these changes are similar to the changes I added here for add account: cb9d65c

We're making sure that if our session has timed out, we log back in with the user's password before continuing.

This is actually a bug that already exists in production, so making sure the UX is better in the new version

@@ -1121,9 +1155,6 @@ export const popupMessageListener = (request: Request, sessionStore: Store) => {
try {
await loginToAllAccounts(password);
} catch (e) {
captureException(
`Could not login when confirming password: ${JSON.stringify(e)}`,
);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

same change as above - don't report to Sentry every time a user enter's an incorrect password

@piyalbasu piyalbasu merged commit 4b1729d into release/5.27.2 Feb 3, 2025
3 checks passed
@piyalbasu piyalbasu deleted the fix/import-acct-when-timed-out branch February 3, 2025 22:21
piyalbasu added a commit that referenced this pull request Feb 4, 2025
* Feature/memory security improvement 5.27.2 (#1827)

* add temporary store extra data

* add tests for switching accounts

* reset session length

* upgrade jest and add unit tests

* rm unused selectors

* fix sendpayment test

* rm npm package and add unit tests

* add better error handling and Sentry capture

* rm console.log

* make sure to login before adding new stellar address

* add a test for imported S key payment

* Fix/import acct when timed out (#1832)

* make sure to login to all accounts before importing by private key if session has timed out

* update comment

* login before showing mnemonic phrase (#1834)

* login before showing mnemonic phrase

* add more Sentry error capture
aristidesstaffieri pushed a commit that referenced this pull request Feb 21, 2025
* Feature/memory security improvement 5.27.2 (#1827)

* add temporary store extra data

* add tests for switching accounts

* reset session length

* upgrade jest and add unit tests

* rm unused selectors

* fix sendpayment test

* rm npm package and add unit tests

* add better error handling and Sentry capture

* rm console.log

* make sure to login before adding new stellar address

* add a test for imported S key payment

* Fix/import acct when timed out (#1832)

* make sure to login to all accounts before importing by private key if session has timed out

* update comment

* login before showing mnemonic phrase (#1834)

* login before showing mnemonic phrase

* add more Sentry error capture
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.

2 participants