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

Prevent creation of notes with the same ResourceId #16

Open
kirillt opened this issue May 27, 2023 · 1 comment
Open

Prevent creation of notes with the same ResourceId #16

kirillt opened this issue May 27, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@kirillt
Copy link
Member

kirillt commented May 27, 2023

It is pretty easy to create a pair of text documents with the same content, the same content would result in the same ResourceId. We should prevent creation of resources with duplicated id.

There are 2 ways of solving this:

  1. Calculate ResourceId of note being saved, lookup into the index for this id.
    If the id is already existing — forbid saving of the note.
  2. Automatically add nonce to the note.
    This requires changing structure of a note — it can't be plain text anymore,
    we need to add nonce into separate field of it.
@kirillt
Copy link
Member Author

kirillt commented Sep 7, 2023

Or we can just lock save button is the id already exists. User can change the content and unlock the button.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant