-
Notifications
You must be signed in to change notification settings - Fork 4
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
[#172885142] delete user data cli command #53
Conversation
Affected stories
New dependencies added: redisAuthor: Matt Ranney Description: A high performance Redis client. Homepage: https://github.com/NodeRedis/node-redis
redis-clustrAuthor: Unknown Description: Redis cluster client Homepage: https://github.com/gosquared/redis-clustr#readme
|
const deleteSessionTokens = new Promise<Either<Error, true>>(resolve => { | ||
// Remove the specified key. A key is ignored if it does not exist. | ||
// @see https://redis.io/commands/del | ||
this.redisClient.del( |
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.
can you put some logging for every ops ? ie:
getting user sessions... <session1> ... <session2> ...
deleting SESSIONIFO-< token> ì ...
deleting USERMETA-<CF>
...
UserDataDeleteOrchestrator/cli.ts
Outdated
): TaskEither<Error, true> => notImplementedTask("setUserDataProcessingStatus"); | ||
|
||
// after the operation, unblock the user to allow another login | ||
const post = (fiscalCode: FiscalCode): TaskEither<Error, true> => |
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'd rather call these blockUser / unblockUser
Codecov Report
@@ Coverage Diff @@
## master #53 +/- ##
==========================================
- Coverage 88.81% 86.29% -2.53%
==========================================
Files 21 26 +5
Lines 608 868 +260
Branches 37 55 +18
==========================================
+ Hits 540 749 +209
- Misses 67 118 +51
Partials 1 1
Continue to review full report at Codecov.
|
* | ||
* @returns either an Error or the new created record | ||
*/ | ||
const fetchRecordFromDb = ({ |
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.
can you extract this method outside the body of createGetUserDataProcessingActivityHandler
?
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.
naming: fetchRecordFromDb
? -> getUserDataProcessingRequest
@@ -0,0 +1,204 @@ | |||
/** |
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 this Activity ? I'm asking because the orchestrator will be triggered by an upcoming record inserted into user-data-requests collection so the input comes from the orchestrator client function bindings
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.
(it's ok to use a query in the client.ts)
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 basically did it for not have to construct here models and require env keys (as we do already with other activities). I guess we can eventually remove it if we find it unhelpful in future refactoring
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 we should convert this into an utility function only used by the cli (not by the orchestrator)
@@ -140,32 +140,34 @@ const logFailure = (context: Context) => ( | |||
} | |||
}; | |||
|
|||
/** |
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.
can you put these files inside the orchestrator / cli folder? (all top level folders are suposed to be functions and/or activities)
Includes:
How to use
To implement yet
change user data processing status