Skip to content

Conversation

@everdimension
Copy link
Member

No description provided.

@github-actions
Copy link

github-actions bot commented Dec 10, 2024

📦 build.zip [updated at Apr 25, 5:59:44 PM UTC]

@everdimension everdimension force-pushed the feature/reset-password-glowup branch 2 times, most recently from b6e3d67 to 40a057b Compare December 10, 2024 11:29
@zerts
Copy link
Collaborator

zerts commented Dec 17, 2024

New change password flow allows to create a password without warnings/checks for password strength. May be it is worth adding there too

@everdimension everdimension force-pushed the feature/reset-password-glowup branch 2 times, most recently from 185e2db to 252f660 Compare April 10, 2025 15:32
@everdimension everdimension requested a review from zerts April 10, 2025 17:20
...props
}: React.InputHTMLAttributes<HTMLInputElement> & { customValidity: string }) {
const ref = useRef<HTMLInputElement>(null);
useLayoutEffect(() => {
Copy link
Collaborator

@zerts zerts Apr 11, 2025

Choose a reason for hiding this comment

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

Can we just use useCustomValidity?

Copy link
Member Author

Choose a reason for hiding this comment

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

We can, but the point is to test the abstraction at a component level :)

newPassword,
});
},
onSuccess: async () => {
Copy link
Collaborator

@zerts zerts Apr 11, 2025

Choose a reason for hiding this comment

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

do we need async here?

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess not!

</VStack>
</VStack>
</label>
<label style={{ all: 'unset' }}>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we refactor all Unstyled*** components with this?
Not for this task, just interesting :)

this.notificationWindow = notificationWindow;
this.wallet = new Wallet(TEMPORARY_ID, null, this.notificationWindow);
this.on('authenticated', () => {
// TODO: Call Account.writeCurrentUser() here, too?
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we do anything with this TODO?

@everdimension everdimension requested a review from zerts April 21, 2025 20:11
newCredentials: SessionCredentials;
}) {
const { mnemonic: encryptedMnemonic } = this.getFirstWallet();
invariant(encryptedMnemonic, 'Must be a Mnemonic WalletContainer');
Copy link
Contributor

@vyorkin vyorkin Apr 21, 2025

Choose a reason for hiding this comment

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

the message just don't make sense to me... we have smth similar in static async restoreWalletContainer, however not that important :)

@everdimension everdimension force-pushed the feature/reset-password-glowup branch from ebc9f36 to 5a0732f Compare April 25, 2025 17:29
@everdimension everdimension force-pushed the feature/reset-password-glowup branch from 5a0732f to 9248c0c Compare April 25, 2025 17:32
return super.getState();
}

setState(...args: Parameters<Store<T>['setState']>) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we specify setState as async here?

Copy link
Member Author

Choose a reason for hiding this comment

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

It wouldn't change the type though

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes! But will make it a bit more obvious :)

);
}
}
super.setState(...args);
Copy link
Collaborator

Choose a reason for hiding this comment

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

As I can see here, we have both sync and async state updates. Can this cause the racecondition when sync updates will be called in one order, but async saves will be executed in another order which will cause incorrect state after store reload?

user: PublicUser;
password: string;
}>): Promise<PublicUser | null> {
invariant(!this.account.isWriteLocked, 'Atomic operation in progress');
Copy link
Collaborator

Choose a reason for hiding this comment

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

shouldn't logout also be blocked while updating is in progress?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also it looks like we should lock all Account-write operations while update is in progress

newCredentials: SessionCredentials;
}) {
await this.ready();
console.log('reading', { id, credentials, state: this.getState() });
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks dangerous to expose credentials :)

private async encryptAndSave(
id: string,
encryptionKey: string,
credentials: Credentials,
Copy link
Collaborator

Choose a reason for hiding this comment

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

do we need to pass all Credentials here?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, but it makes it more consistent with the other signatures. I think it's more proper to pass credentials, it's easier to abstract them this way

await this.encryptAndSave(id, credentials, record);
}

async createBackup(id: string) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

what do you think about calling this param userId to make to purpose more clear?

name: 'internal_error',
message: 'Atomic wallet update failed. Restore from backup failed.',
});
throw new InternalBackupError(getError(error), { didRestore: false });
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need this param for this Error? It looks like we only use it with didRestore: false

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.

4 participants