-
Notifications
You must be signed in to change notification settings - Fork 32
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: skip reserved keys from sync conflict #1065
Conversation
// and do not require actions. Hence skipping from checking conflict resolution. | ||
if (key.startsWith('publickey.') || | ||
key.startsWith('shared_key.') || | ||
key.contains('shared_key') || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's be a bit more precise - we should match on the key looking like either @alice:shared_key@bob
or shared_key.alice@bob
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modified the conditions as key.startsWith(RegExp('shared_key.+@.+|@.+shared_key@.+'))
// and do not require actions. Hence skipping from checking conflict resolution. | ||
if (key.startsWith('publickey.') || | ||
key.startsWith('shared_key.') || | ||
key.startsWith(RegExp('shared_key.+@.+|@.+shared_key@.+')) || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shared_key.+@.+
will match shared_keyyyyyyy@alice
@.+shared_key@.+
will match @ssssssshared_key:phone.wavi@alice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the Regular expression and added unit tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @sitaram-kalluri
…keys during sync conflict checking)
- What I did
- How I did it
startsWith(shared_key)
tocontains(shared_key)
- How to verify it
- Description for the changelog