Skip to content
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

Channels-1034 Set google Api version for Push #1883

Merged
merged 4 commits into from
Mar 5, 2024

Conversation

Sneha-Uppalapati
Copy link
Contributor

Channels-1034 - This PR sets google API version for Push

Testing

Include any additional information about the testing you have completed to
ensure your changes behave as expected. For a speedy review, please check
any of the tasks you completed below during your testing.

  • Added unit tests for new functionality
  • Tested end-to-end using the local server
  • [Segmenters] Tested in the staging environment

Comment on lines +127 to +130
/**
* Controls the notification payload format
*/
googleApiVersion?: string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Comment on lines +871 to +872
nock(`https://content.twilio.com`).get(`/v1/Content/${contentSid}`).reply(200, defaultTemplate)
nock(notifyReqUrl).post('', notifyReqBody.toString()).reply(201, externalId)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh. I've never heard of nock. That seems relevant to Cesar's work as well.

@joe-ayoub-segment
Copy link
Contributor

Hi @Sneha-Uppalapati , @alfrimpong and @cogwizzle - please let me know when this is ready for review + deploy.

@Sneha-Uppalapati
Copy link
Contributor Author

Hi @joe-ayoub-segment thank you for checking. Yes, we've successfully verified the changes in stage and ready for review + deploy.

description: 'Controls the notification payload format',
type: 'string',
required: false,
choices: ['legacy', 'v1'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Sneha-Uppalapati, each choice needs to have a label and value. This field won't worth correctly otherwise.

choices: [
  {label: 'legacy', value: 'legacy'},
  {label: 'v1', value: 'v1'}
]

@@ -172,6 +167,27 @@ export class PushSender extends TwilioMessageSender<PushPayload> {
}
}

private getFcmNotificationOverrides(badgeAmount: number) {
// FCM V1 format
if (this.payload.googleApiVersion === 'v1') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just FYI that this.payload.googleApiVersion will resolve to undefined for all customers who already have the Destination configured. While this won't cause a null pointer I want to check that you understand this and that the code is correct for your use-case. Can you confirm that you are OK with this please?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ready for re-review. It is expected to resolve to undefined for existing customers. The code defaults to legacy in that case.

@joe-ayoub-segment
Copy link
Contributor

Hi @Sneha-Uppalapati minor change needed.

@joe-ayoub-segment
Copy link
Contributor

joe-ayoub-segment commented Feb 27, 2024

hi @cogwizzle @alfrimpong - can you please take a look at my comments prior to me deploying?

@joe-ayoub-segment
Copy link
Contributor

removed the Ready for Release label for now.

@Sneha-Uppalapati Sneha-Uppalapati requested a review from a team as a code owner February 27, 2024 17:37
@alfrimpong
Copy link
Contributor

Looks like my git pull from main added a bunch of unrelated commits. Going to fix that up

@alfrimpong alfrimpong changed the base branch from main to mobile-push-fcm-v1 February 27, 2024 17:42
@alfrimpong alfrimpong changed the base branch from mobile-push-fcm-v1 to main February 27, 2024 17:42
@joe-ayoub-segment joe-ayoub-segment merged commit b8439ca into main Mar 5, 2024
9 checks passed
@joe-ayoub-segment joe-ayoub-segment deleted the Channels-1034-googleAPIVersion branch March 5, 2024 13:12
harsh-joshi99 added a commit that referenced this pull request Mar 8, 2024
commit b897052
Author: Harsh Joshi <harsh.joshi@segment.com>
Date:   Fri Mar 8 14:09:59 2024 +0530

    Update error handling in get audience

commit f708118
Author: joe-ayoub-segment <45374896+joe-ayoub-segment@users.noreply.github.com>
Date:   Wed Mar 6 12:15:27 2024 +0000

    Publish

     - @segment/action-destinations@3.251.0

commit 1c3e2b4
Author: joe-ayoub-segment <45374896+joe-ayoub-segment@users.noreply.github.com>
Date:   Wed Mar 6 12:03:17 2024 +0000

    fixing broken field for optimizely data platform

commit f5e6e4f
Author: joe-ayoub-segment <45374896+joe-ayoub-segment@users.noreply.github.com>
Date:   Wed Mar 6 11:56:07 2024 +0000

    fixing breaking field for optimizely data platform

commit f540306
Author: Marín Alcaraz <marin.alcarazcordova@segment.com>
Date:   Tue Mar 5 15:40:11 2024 -0800

    Publish

     - @segment/action-destinations@3.250.0

commit 6a35edd
Author: Marín Alcaraz <marin.alcarazcordova@segment.com>
Date:   Tue Mar 5 15:36:29 2024 -0800

    DV360 - Update Chamber Variable (#1912)

commit ed54b6b
Author: joe-ayoub-segment <45374896+joe-ayoub-segment@users.noreply.github.com>
Date:   Tue Mar 5 13:33:54 2024 +0000

    Publish

     - @segment/actions-shared@1.81.0
     - @segment/browser-destination-runtime@1.30.0
     - @segment/actions-core@3.100.0
     - @segment/action-destinations@3.249.0
     - @segment/destinations-manifest@1.43.0
     - @segment/analytics-browser-actions-1flow@1.13.0
     - @segment/analytics-browser-actions-adobe-target@1.31.0
     - @segment/analytics-browser-actions-algolia-plugins@1.8.0
     - @segment/analytics-browser-actions-amplitude-plugins@1.31.0
     - @segment/analytics-browser-actions-braze-cloud-plugins@1.34.0
     - @segment/analytics-browser-actions-braze@1.34.0
     - @segment/analytics-browser-actions-bucket@1.11.0
     - @segment/analytics-browser-actions-cdpresolution@1.18.0
     - @segment/analytics-browser-actions-commandbar@1.31.0
     - @segment/analytics-browser-actions-devrev@1.18.0
     - @segment/analytics-browser-actions-friendbuy@1.31.0
     - @segment/analytics-browser-actions-fullstory@1.33.0
     - @segment/analytics-browser-actions-google-analytics-4@1.37.0
     - @segment/analytics-browser-actions-google-campaign-manager@1.21.0
     - @segment/analytics-browser-actions-heap@1.31.0
     - @segment/analytics-browser-hubble-web@1.17.0
     - @segment/analytics-browser-actions-hubspot@1.31.0
     - @segment/analytics-browser-actions-intercom@1.31.0
     - @segment/analytics-browser-actions-iterate@1.31.0
     - @segment/analytics-browser-actions-jimo@1.19.0
     - @segment/analytics-browser-actions-koala@1.31.0
     - @segment/analytics-browser-actions-logrocket@1.31.0
     - @segment/analytics-browser-actions-pendo-web-actions@1.20.0
     - @segment/analytics-browser-actions-playerzero@1.31.0
     - @segment/analytics-browser-actions-replaybird@1.12.0
     - @segment/analytics-browser-actions-ripe@1.31.0
     - @segment/analytics-browser-actions-rupt@1.20.0
     - @segment/analytics-browser-actions-screeb@1.31.0
     - @segment/analytics-browser-actions-utils@1.31.0
     - @segment/analytics-browser-actions-snap-plugins@1.12.0
     - @segment/analytics-browser-actions-sprig@1.31.0
     - @segment/analytics-browser-actions-stackadapt@1.31.0
     - @segment/analytics-browser-actions-survicate@1.7.0
     - @segment/analytics-browser-actions-tiktok-pixel@1.28.0
     - @segment/analytics-browser-actions-upollo@1.31.0
     - @segment/analytics-browser-actions-userpilot@1.31.0
     - @segment/analytics-browser-actions-vwo@1.32.0
     - @segment/analytics-browser-actions-wiseops@1.31.0

commit 8793063
Author: Joe Ayoub <45374896+joe-ayoub-segment@users.noreply.github.com>
Date:   Tue Mar 5 13:30:12 2024 +0000

    Registering kevel-audience

commit 82a80b9
Author: Joe Ayoub <45374896+joe-ayoub-segment@users.noreply.github.com>
Date:   Tue Mar 5 13:19:12 2024 +0000

    Optimizely data platform changes (#1906)

    * changes to ODP Destination

    * fixing tests

    * adding campaign_id to email action

    * fixing preset

commit e0a5d6b
Author: Dave <bordoley@gmail.com>
Date:   Tue Mar 5 08:13:34 2024 -0500

    Snap misc fixes (#1900)

    * set the app_id to undefined if empty. Set advertiser_tracking_enabled to 0 if the app_id is defined

    * add comment on advertiser_tracking_enabled field usage

    * tweak app_data and extinfo build

    * update box function to return undefined if the input string is empty or undefined instead of an empty array

    * fix tests

    * fix typo

    * simplify action_source logic

    * update tests to validate advertiser_tracking_enabled and changes to box function

    * cleaner implementation of emptyStringtoUndefined

    * simpler implementation of box

    * remove duplicate util function

    * fix function name

    * log errors as critical

    * add prefix to logger entries

    ---------

    Co-authored-by: David Bordoley <dbordoley@snapchat.com>

commit b8439ca
Author: suppalapati <110847862+Sneha-Uppalapati@users.noreply.github.com>
Date:   Tue Mar 5 05:12:28 2024 -0800

    Channels-1034 Set google Api version for Push (#1883)

    * feat: set googleApiVersion

    * fix: set legacy as default version

    * fix: defaults

    ---------

    Co-authored-by: suppalapati <sneha.uppalapati@segment.com>
    Co-authored-by: alfrimpong <afrimpong@twilio.com>

commit a77f4a7
Author: Joe Ayoub <45374896+joe-ayoub-segment@users.noreply.github.com>
Date:   Tue Mar 5 13:11:18 2024 +0000

    basic SSL config options (#1908)

commit 726d281
Author: Joe Ayoub <45374896+joe-ayoub-segment@users.noreply.github.com>
Date:   Tue Mar 5 11:23:49 2024 +0000

    Adding new kevel-audience Destination (#1910)

    * adding kevel-audience Destination

    * fixing spelling issue

commit ca71fbf
Author: mayur-pitale <109548891+mayur-pitale@users.noreply.github.com>
Date:   Tue Mar 5 01:54:20 2024 -0800

    Added encoding to username & password (#1909)

commit 529e786
Author: hvardhan-unth <117922634+hvardhan-unth@users.noreply.github.com>
Date:   Tue Mar 5 15:10:01 2024 +0530

    [Stratconn 3257] Add batching to segment connections (#1859)

    * Added batching for all the actions of segment destination

    * Added the unit test cases for batching

    * Updated the test case for batch happy path

    * Updated the test case

    * Updated the tag name for batch matrix

    * Added enable batching field

    * Revert the unwanted changes and updated the perform block

    * Revert the unwanted changes

    * Revert the unwanted changes

    * Changes output text for batch execution

    ---------

    Co-authored-by: Harsh Vardhan <harsh.vardhan@segment.com>

commit 53b4441
Author: Varadarajan V <109586712+varadarajan-tw@users.noreply.github.com>
Date:   Tue Mar 5 10:32:49 2024 +0530

    [STRATCONN-3623] - Adds github actions workflow to label PRs (#1905)

    * Adds PR labeler workflow

    * rename token

    * update secret name

    * fix script path

    * change path

    * Delete scripts folder

    * dummy commit

    * update registration regex

    * Add comments on checks

commit 8d3a139
Author: Ankit Gupta <139338151+AnkitSegment@users.noreply.github.com>
Date:   Mon Mar 4 23:39:15 2024 +0530

    [MAIN] [STRATCONN] 3313 add page view field in setConfigurationFields (#1904)

    * send_page_view mapping added

    * updated unit test cases of send_page_view in setConfigurationFields

    * removed unrelevent code

    * removed unrelevent code
harsh-joshi99 added a commit that referenced this pull request Mar 8, 2024
commit 473990d
Author: Harsh Joshi <harsh.joshi@segment.com>
Date:   Fri Mar 8 14:49:37 2024 +0530

    Add test case for error

commit b897052
Author: Harsh Joshi <harsh.joshi@segment.com>
Date:   Fri Mar 8 14:09:59 2024 +0530

    Update error handling in get audience

commit f708118
Author: joe-ayoub-segment <45374896+joe-ayoub-segment@users.noreply.github.com>
Date:   Wed Mar 6 12:15:27 2024 +0000

    Publish

     - @segment/action-destinations@3.251.0

commit 1c3e2b4
Author: joe-ayoub-segment <45374896+joe-ayoub-segment@users.noreply.github.com>
Date:   Wed Mar 6 12:03:17 2024 +0000

    fixing broken field for optimizely data platform

commit f5e6e4f
Author: joe-ayoub-segment <45374896+joe-ayoub-segment@users.noreply.github.com>
Date:   Wed Mar 6 11:56:07 2024 +0000

    fixing breaking field for optimizely data platform

commit f540306
Author: Marín Alcaraz <marin.alcarazcordova@segment.com>
Date:   Tue Mar 5 15:40:11 2024 -0800

    Publish

     - @segment/action-destinations@3.250.0

commit 6a35edd
Author: Marín Alcaraz <marin.alcarazcordova@segment.com>
Date:   Tue Mar 5 15:36:29 2024 -0800

    DV360 - Update Chamber Variable (#1912)

commit ed54b6b
Author: joe-ayoub-segment <45374896+joe-ayoub-segment@users.noreply.github.com>
Date:   Tue Mar 5 13:33:54 2024 +0000

    Publish

     - @segment/actions-shared@1.81.0
     - @segment/browser-destination-runtime@1.30.0
     - @segment/actions-core@3.100.0
     - @segment/action-destinations@3.249.0
     - @segment/destinations-manifest@1.43.0
     - @segment/analytics-browser-actions-1flow@1.13.0
     - @segment/analytics-browser-actions-adobe-target@1.31.0
     - @segment/analytics-browser-actions-algolia-plugins@1.8.0
     - @segment/analytics-browser-actions-amplitude-plugins@1.31.0
     - @segment/analytics-browser-actions-braze-cloud-plugins@1.34.0
     - @segment/analytics-browser-actions-braze@1.34.0
     - @segment/analytics-browser-actions-bucket@1.11.0
     - @segment/analytics-browser-actions-cdpresolution@1.18.0
     - @segment/analytics-browser-actions-commandbar@1.31.0
     - @segment/analytics-browser-actions-devrev@1.18.0
     - @segment/analytics-browser-actions-friendbuy@1.31.0
     - @segment/analytics-browser-actions-fullstory@1.33.0
     - @segment/analytics-browser-actions-google-analytics-4@1.37.0
     - @segment/analytics-browser-actions-google-campaign-manager@1.21.0
     - @segment/analytics-browser-actions-heap@1.31.0
     - @segment/analytics-browser-hubble-web@1.17.0
     - @segment/analytics-browser-actions-hubspot@1.31.0
     - @segment/analytics-browser-actions-intercom@1.31.0
     - @segment/analytics-browser-actions-iterate@1.31.0
     - @segment/analytics-browser-actions-jimo@1.19.0
     - @segment/analytics-browser-actions-koala@1.31.0
     - @segment/analytics-browser-actions-logrocket@1.31.0
     - @segment/analytics-browser-actions-pendo-web-actions@1.20.0
     - @segment/analytics-browser-actions-playerzero@1.31.0
     - @segment/analytics-browser-actions-replaybird@1.12.0
     - @segment/analytics-browser-actions-ripe@1.31.0
     - @segment/analytics-browser-actions-rupt@1.20.0
     - @segment/analytics-browser-actions-screeb@1.31.0
     - @segment/analytics-browser-actions-utils@1.31.0
     - @segment/analytics-browser-actions-snap-plugins@1.12.0
     - @segment/analytics-browser-actions-sprig@1.31.0
     - @segment/analytics-browser-actions-stackadapt@1.31.0
     - @segment/analytics-browser-actions-survicate@1.7.0
     - @segment/analytics-browser-actions-tiktok-pixel@1.28.0
     - @segment/analytics-browser-actions-upollo@1.31.0
     - @segment/analytics-browser-actions-userpilot@1.31.0
     - @segment/analytics-browser-actions-vwo@1.32.0
     - @segment/analytics-browser-actions-wiseops@1.31.0

commit 8793063
Author: Joe Ayoub <45374896+joe-ayoub-segment@users.noreply.github.com>
Date:   Tue Mar 5 13:30:12 2024 +0000

    Registering kevel-audience

commit 82a80b9
Author: Joe Ayoub <45374896+joe-ayoub-segment@users.noreply.github.com>
Date:   Tue Mar 5 13:19:12 2024 +0000

    Optimizely data platform changes (#1906)

    * changes to ODP Destination

    * fixing tests

    * adding campaign_id to email action

    * fixing preset

commit e0a5d6b
Author: Dave <bordoley@gmail.com>
Date:   Tue Mar 5 08:13:34 2024 -0500

    Snap misc fixes (#1900)

    * set the app_id to undefined if empty. Set advertiser_tracking_enabled to 0 if the app_id is defined

    * add comment on advertiser_tracking_enabled field usage

    * tweak app_data and extinfo build

    * update box function to return undefined if the input string is empty or undefined instead of an empty array

    * fix tests

    * fix typo

    * simplify action_source logic

    * update tests to validate advertiser_tracking_enabled and changes to box function

    * cleaner implementation of emptyStringtoUndefined

    * simpler implementation of box

    * remove duplicate util function

    * fix function name

    * log errors as critical

    * add prefix to logger entries

    ---------

    Co-authored-by: David Bordoley <dbordoley@snapchat.com>

commit b8439ca
Author: suppalapati <110847862+Sneha-Uppalapati@users.noreply.github.com>
Date:   Tue Mar 5 05:12:28 2024 -0800

    Channels-1034 Set google Api version for Push (#1883)

    * feat: set googleApiVersion

    * fix: set legacy as default version

    * fix: defaults

    ---------

    Co-authored-by: suppalapati <sneha.uppalapati@segment.com>
    Co-authored-by: alfrimpong <afrimpong@twilio.com>

commit a77f4a7
Author: Joe Ayoub <45374896+joe-ayoub-segment@users.noreply.github.com>
Date:   Tue Mar 5 13:11:18 2024 +0000

    basic SSL config options (#1908)

commit 726d281
Author: Joe Ayoub <45374896+joe-ayoub-segment@users.noreply.github.com>
Date:   Tue Mar 5 11:23:49 2024 +0000

    Adding new kevel-audience Destination (#1910)

    * adding kevel-audience Destination

    * fixing spelling issue

commit ca71fbf
Author: mayur-pitale <109548891+mayur-pitale@users.noreply.github.com>
Date:   Tue Mar 5 01:54:20 2024 -0800

    Added encoding to username & password (#1909)

commit 529e786
Author: hvardhan-unth <117922634+hvardhan-unth@users.noreply.github.com>
Date:   Tue Mar 5 15:10:01 2024 +0530

    [Stratconn 3257] Add batching to segment connections (#1859)

    * Added batching for all the actions of segment destination

    * Added the unit test cases for batching

    * Updated the test case for batch happy path

    * Updated the test case

    * Updated the tag name for batch matrix

    * Added enable batching field

    * Revert the unwanted changes and updated the perform block

    * Revert the unwanted changes

    * Revert the unwanted changes

    * Changes output text for batch execution

    ---------

    Co-authored-by: Harsh Vardhan <harsh.vardhan@segment.com>

commit 53b4441
Author: Varadarajan V <109586712+varadarajan-tw@users.noreply.github.com>
Date:   Tue Mar 5 10:32:49 2024 +0530

    [STRATCONN-3623] - Adds github actions workflow to label PRs (#1905)

    * Adds PR labeler workflow

    * rename token

    * update secret name

    * fix script path

    * change path

    * Delete scripts folder

    * dummy commit

    * update registration regex

    * Add comments on checks

commit 8d3a139
Author: Ankit Gupta <139338151+AnkitSegment@users.noreply.github.com>
Date:   Mon Mar 4 23:39:15 2024 +0530

    [MAIN] [STRATCONN] 3313 add page view field in setConfigurationFields (#1904)

    * send_page_view mapping added

    * updated unit test cases of send_page_view in setConfigurationFields

    * removed unrelevent code

    * removed unrelevent code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants