-
Notifications
You must be signed in to change notification settings - Fork 6
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
[#175497433] Add Profile unsubscription on feed #86
Conversation
Affected stories
Generated by 🚫 dangerJS |
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.
may we add some tests?
GetSubscriptionsFeed/handler.ts
Outdated
// add new users to the new subscriptions, skipping those that | ||
// unsubscribed from this service | ||
// unsubscribed from this service or deleted its account |
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.
// unsubscribed from this service or deleted its account | |
// unsubscribed from this service or deleted their account |
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.
Fixed in 8857930
GetSubscriptionsFeed/handler.ts
Outdated
// add all users that unsubscribed from this service, skipping those | ||
// that created the profile on the same day as the service will not | ||
// yet know they exist | ||
// yet know they exist or deleted its account |
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.
// yet know they exist or deleted its account | |
// yet know they exist or deleted their account |
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.
Fixed in 8857930
GetSubscriptionsFeed/handler.ts
Outdated
if (!serviceUnsubscriptionsSet.has(ps)) { | ||
if ( | ||
!serviceUnsubscriptionsSet.has(ps) && | ||
!profileUnsubscriptionsSet.has(ps) |
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 think this check is useless since you either have a profile subscription OR a profile unsubscription but never both in the same day
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 is true if we mantain 7 delay days between request and effectiveness account's deletion. If we enable instant delete of personal data, it should be possible. What do you think?
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 think it's true in any scenario since when you create the (un)subscription record in the same day, you delete any previous (un)subscription here: https://github.com/pagopa/io-functions-app/blob/master/UpdateSubscriptionsFeedActivity/index.ts#L102
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.
Deal
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.
Fixed in 8857930
Ok, it seems that no tests have been written for this API. Let's integrate them! |
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
const today = new Date(); | ||
const tomorrow = new Date(today); | ||
tomorrow.setDate(tomorrow.getDate() + 1); | ||
|
||
const yesterday = new Date(today); | ||
yesterday.setDate(yesterday.getDate() - 1); | ||
const aServiceId = "MyServiceId" as ServiceId; | ||
|
||
const yesterdayUTC = dateFmt.format(yesterday, "YYYY-MM-DD"); |
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.
<3
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've noticed this: https://date-fns.org/v1.28.5/docs/startOfYesterday maybe can help
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.
Done 👍 047a2f4
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.
well done!
const today = new Date(); | ||
const tomorrow = new Date(today); | ||
tomorrow.setDate(tomorrow.getDate() + 1); | ||
|
||
const yesterday = new Date(today); | ||
yesterday.setDate(yesterday.getDate() - 1); | ||
const aServiceId = "MyServiceId" as ServiceId; | ||
|
||
const yesterdayUTC = dateFmt.format(yesterday, "YYYY-MM-DD"); |
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've noticed this: https://date-fns.org/v1.28.5/docs/startOfYesterday maybe can help
This PR adds retrieve for records with partitionKey
P-{date}-U
onSubscriptionFeedByDay
while serving informations about subscription feed. These kind of records are written, when users request to delete its own data and in that case, the event must be notified to subscription feed.