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

feat: fix duplicate uploaded key #1431

Merged
merged 3 commits into from
Jul 3, 2024
Merged

feat: fix duplicate uploaded key #1431

merged 3 commits into from
Jul 3, 2024

Conversation

domin191013
Copy link
Contributor

@domin191013 domin191013 self-assigned this Jul 1, 2024
@github-actions github-actions bot added package: wallet/backend Wallet backend implementations type: source Source changes labels Jul 1, 2024
@domin191013 domin191013 requested a review from Tymmmy July 2, 2024 05:27
@raducristianpopa
Copy link
Member

raducristianpopa commented Jul 2, 2024

If the users have the same key (by any chance), will they be able to upload the same key?

@Tymmmy
Copy link
Contributor

Tymmmy commented Jul 2, 2024

@rico191013 please take a look at Radu's question and also on the story check the items that you solved.

@@ -91,7 +92,15 @@ export class WalletAddressKeyService implements IWalletAddressKeyService {
walletAddressId
}

await WalletAddressKeys.query().insert(key)
try {
await WalletAddressKeys.query().insert(key)
Copy link
Contributor Author

@domin191013 domin191013 Jul 3, 2024

Choose a reason for hiding this comment

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

@raducristianpopa For the sake of having a unique ID constraint for each key in the DB, every user can have one unique key for uploading, ensuring that others can't upload the same key.

@domin191013 domin191013 merged commit 4c52eee into main Jul 3, 2024
15 checks passed
@domin191013 domin191013 deleted the upload-duplicated-key branch July 3, 2024 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: wallet/backend Wallet backend implementations type: source Source changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dev Keys - Upload same key error
3 participants