The script is for the case where already present policy was updated and we need to force user to acknowledge it again.
Details
- Run yarn script dist/scripts/force-policy-acknowledgment.js
- Check if in all policy_acknowledgments rows with given policy and confirmation date lower than the date when policy was published confirmed column was flipped to 0.
Diff Detail
- Repository
- rCOMM Comm
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
keyserver/src/scripts/force-policy-acknowledgment.js | ||
---|---|---|
9 ↗ | (On Diff #17381) | This is needed for case when there is a gap between publishing policy and running script, if within this time range eg. a new user will signs in, we don't want to force him to do it again. |
keyserver/src/scripts/force-policy-acknowledgment.js | ||
---|---|---|
11 ↗ | (On Diff #17381) | I assume that as in D5309 this one is also intended to be one-time script so I am not going to pursue my idea of iterating over policies array. Nevertheless defining const policy = policyTypes.tosAndPrivacyPolicy (specific policy) and using it in function called forcePolicyAcknowledgment (suggests policies in general) doesn't seem right to me. We should either call this function forceTosAndPrivacyPolicyAcknowledgement or parameterize it with policy. |
keyserver/src/scripts/force-policy-acknowledgment.js | ||
---|---|---|
11 ↗ | (On Diff #17381) |
It's not a one-time script, it will be executed every time a policy will be updated and we will need another confirmation from users (I don't think all policies will be updated at once that's why there is no iterating).
Looking through other scripts in keyserver I think this is the way of parametrization, by setting a const and then running a script. |
Please address nits before landing
keyserver/src/scripts/force-policy-acknowledgment.js | ||
---|---|---|
13–15 | Encourage you to match existing conventions as much as possible. Whenever you're writing something new, try to look for prior examples in the codebase and compare Three nits here:
|
keyserver/src/scripts/force-policy-acknowledgment.js | ||
---|---|---|
11 ↗ | (On Diff #17381) |
In such a case I should not block this revision on refactor. |
keyserver/src/scripts/force-policy-acknowledgment.js | ||
---|---|---|
13–15 | Thanks! Will keep this in mind, my bad for not search trough the codebase deep enough to find patterns we should use. |