-
Notifications
You must be signed in to change notification settings - Fork 3
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
Get Identity DB ready for prod #394
Conversation
mockgen -package api github.com/xmtp/xmtp-node-go/pkg/proto/mls/api/v1 MlsApi_SubscribeGroupMessagesServer,MlsApi_SubscribeWelcomeMessagesServer > pkg/mls/api/v1/mock.gen.go | ||
mockgen -package mocks -source ./pkg/mlsvalidate/service.go MLSValidationService > pkg/mlsvalidate/mocks/mock.gen.go | ||
# Generate mocks | ||
mockery |
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.
Steven was previously using mockgen to generate mocks. I decided to switch us back to the more standard testify/mock
and mockery
. It's more widely used and more actively maintained. Otherwise very similar, other than some syntax changes.
This probably should have been a separate PR, but a lot of the things that were being mocked were also changing.
@@ -0,0 +1,71 @@ | |||
SET statement_timeout = 0; |
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.
I consolidated all our MLS schema into one big migration after the drops. Just easier to read this way
); | ||
|
||
--bun:split | ||
CREATE INDEX idx_group_messages_group_id_id ON group_messages(group_id, id); |
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.
This index is different from before. We were previously indexing on (group_id, created_at)
and it never got updated when we changed the sort/cursor on queries to be the id
field.
id BYTEA PRIMARY KEY, | ||
created_at BIGINT NOT NULL, | ||
updated_at BIGINT NOT NULL, | ||
inbox_id BYTEA NOT NULL, |
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.
We now store inbox_id
on installations instead of account_address
); | ||
|
||
--bun:split | ||
CREATE INDEX idx_welcome_messages_installation_key_id ON welcome_messages(installation_key, id); |
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.
Also changed to match the sort/cursor field
@@ -118,45 +118,22 @@ func (s *Service) RegisterInstallation(ctx context.Context, req *mlsv1.RegisterI | |||
return nil, err | |||
} | |||
|
|||
if req.IsInboxIdCredential { |
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.
Removed support for legacy credentials, since we no longer even have an account_address
field to store the resulting address.
I've also now tested this with the libxmtp test suite and everything passes |
tl;dr
GetIdentityUpdates
method which is now unusedmockery
for mock generation