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

Sc-14469: Implement trtl CreateContact #997

Closed
wants to merge 3 commits into from
Closed

Sc-14469: Implement trtl CreateContact #997

wants to merge 3 commits into from

Conversation

DanielSollis
Copy link
Contributor

Scope of changes

Implements CreateContact in store/trtl

Type of change

  • bug fix
  • new feature
  • documentation
  • other (describe)

Acceptance criteria

Describe how reviewers can test this change to be sure that it works correctly. Add a checklist if possible

Author checklist

  • I have manually tested the change and/or added automation in the form of unit tests or integration tests
  • I have updated the dependencies list
  • I have recompiled and included new protocol buffers to reflect changes I made
  • I have added new test fixtures as needed to support added tests
  • Check this box if a reviewer can merge this pull request after approval (leave it unchecked if you want to do it yourself)
  • I have moved the associated Shortcut story to "Ready for Review"

Reviewer(s) checklist

  • Any new user-facing content that has been added for this PR has been QA'ed to ensure correct grammar, spelling, and understandability.

Copy link
Collaborator

@pdeziel pdeziel left a comment

Choose a reason for hiding this comment

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

Looks great, I just had a few questions but nothing blocking.

// Normalize the email and convert to bytes
trimmed := strings.TrimSpace(c.Email)
normalized := strings.ToLower(trimmed)
key := []byte(normalized)
Copy link
Collaborator

Choose a reason for hiding this comment

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

One thing that might be helpful would be to add a Key() method to the models.Contact which returns the key. Then we wouldn't have to have this conversion code in multiple places.

Value: data,
Namespace: wire.NamespaceContacts,
}
if reply, err := s.client.Put(ctx, request); err != nil || !reply.Success {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you remind me, when does client.Put return err == nil and reply.Success == true?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants