-
Notifications
You must be signed in to change notification settings - Fork 336
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
chore(metrics): Segment dependency cleanup #9092
Conversation
const hmacDigest = crypto | ||
.createHmac('sha256', SERVER_SECRET!) | ||
.update(timestampStr) | ||
.digest('base64') |
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 don't quite understand why we need to use the SEGMENT_FN_KEY
here, and also why need to encrypt once with it and then another time with the SERVER_SECRET
. I changed it to just encrypt once.
Let me know if it's gonna break!
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, that's an interesting one! Required some digging, but now I know what was going on: Segment used to request additional data for an event from the app, see this PR. For this we sent the signed timestamp with each event.
We're not doing this anymore, this file and its references should be removed.
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.
Did not test yet. You've uncovered some long forgotten code there which should be deleted before merging
const hmacDigest = crypto | ||
.createHmac('sha256', SERVER_SECRET!) | ||
.update(timestampStr) | ||
.digest('base64') |
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, that's an interesting one! Required some digging, but now I know what was going on: Segment used to request additional data for an event from the app, see this PR. For this we sent the signed timestamp with each event.
We're not doing this anymore, this file and its references should be removed.
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
Description
Last piece to completely remove Segment dependencies:
client/hooks/useSegmentTrack.ts
→client/hooks/useClientSideTrack.ts
server/graphql/mutations/helpers/sendAccountRemovedToSegment.ts
→server/graphql/mutations/helpers/sendAccountRemovedEvent.ts
server/graphql/mutations/helpers/sendPokerMeetingRevoteToSegment.ts
→server/graphql/mutations/helpers/sendPokerMeetingRevoteEvent.ts
client/utils/safeIdentify.ts
: Replace Segment'sidentify
to Amplitude'sidentify
server/graphql/webhookGraphQLHandler.ts
: I'm not sure why we need theSEGMENT_FN_KEY
here and why we need double encryptions?Final checklist
One Review Required
if the PR introduces only minor changes, does not contain any architectural changes or does not introduce any new patterns and I think one review is sufficient'