Skip to content

Add check for noteId length#797

Merged
SISheogorath merged 1 commit intohackmdio:masterfrom
SISheogorath:fix/LZErrorLog
Apr 11, 2018
Merged

Add check for noteId length#797
SISheogorath merged 1 commit intohackmdio:masterfrom
SISheogorath:fix/LZErrorLog

Conversation

@SISheogorath
Copy link
Copy Markdown
Contributor

As we know the length of an UUID we can check if the base64 string
of the provided UUID is long enough for a legacy base64 encoded
nodeId and stop processing it in legacy mode, if it's not the case.

This should make the ugly warning way less common.

/cc @dekonnection

@SISheogorath SISheogorath added the enhancement Wants to improvide an existing feature label Apr 9, 2018
@SISheogorath SISheogorath added this to the 1.1.x Release milestone Apr 10, 2018
Comment thread lib/models/note.js Outdated
},
// parse note id by LZString is deprecated, here for compability
parseNoteIdByLZString: function (_callback) {
// Calculate mainimal string length for an UUID that is encoded
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

typo here I think?
mainimal -> minimal

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed. Thanks :)

As we know the length of an UUID we can check if the base64 string
of the provided UUID is long enough for a legacy base64 encoded nodeId
and stop processing it in legacy mode, if it's not the case.

This should make the ugly warning way less common.

Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
@SISheogorath SISheogorath merged commit 1012111 into hackmdio:master Apr 11, 2018
@SISheogorath SISheogorath deleted the fix/LZErrorLog branch April 11, 2018 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Wants to improvide an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants