-
Notifications
You must be signed in to change notification settings - Fork 126
Index single tx signup #5408
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
Index single tx signup #5408
Conversation
aca2614 to
e7e0155
Compare
theoilie
left a comment
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.
glad to see it working on staging 🔥 I'm curious about the case where libs has this change and Discovery doesn't, or vice-versa. it looks like it should just fallback to the 2-step flow and work, but signup is all complicated with these different v1 and v2 paths so worth calling out
| "_entityType": "User", | ||
| "_userId": USER_ID_OFFSET + 3, | ||
| "_action": "Create", | ||
| "_metadata": f'{{"data": {create_user3_json}}}', |
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.
no cid prop?
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.
do we need CID still? for v2 @michellebrier
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.
yes need cid for both v1 and v2
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.
oh yea for that CID table right?
| # fallback to multi tx signup | ||
| pass | ||
|
|
||
| if params.metadata_cid == "v2": |
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.
should be params.metadata now bc of this change f17be75
| if params.metadata_cid == "v2": | ||
| user_record.is_storage_v2 = True | ||
| else: | ||
| elif not user_metadata: # update replica set case |
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.
couple questions:
- whats the old multi tx flow? a CREATE USER event followed by an UPDATE USER event?
- if so, with the single tx flow i assume we want the cid metadata that would normally be in the UPDATE USER event to be persisted in
cid_dataso the client can query it later?- in which case we either need to add special cases for different metadata formats in CREATE USER events to
expect_cid_metadata_jsonandparse_metadatain entity managerutils.py - or
- handle that here and persist to
cid_dataappropriately - feels convoluted trying to handle all possible CREATE USER cases upstream in
entity_manager.pyas we migrate from multi->single tx and also from storage v1->v2 so would prefer the latter, with the custom logic here
- in which case we either need to add special cases for different metadata formats in CREATE USER events to
- what are all the possible metadata values that we want to handle here? (considering old multi tx path, new single tx path, and v2)
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.
- Yea, it's a create user, update for the handle, update for profile picture.
- Yeah sg, updating it to treat this case as a user update and parse.
- This will just be for storage v2 so I think the only cases we will have are v2 single tx and v2 multi tx. We can def clean it up once v2 and libs changes go out.
michellebrier
left a comment
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.
see comments!
michellebrier
left a comment
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.
lgtm!
Description
Currently, signup takes multiple user txs. This change will allow signups from a single create user tx with metadata.
Libs change in progress: 2c1a0c8
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide repro instructions & any configuration.
Added test and tested e2e with libs change on stage