CleverTap / clevertap-android-sdk

CleverTap Android SDK
MIT License
80 stars 74 forks source link

Timer template: After timer expiry notification not getting updated #579

Open Dhaval4Proximity opened 8 months ago

Dhaval4Proximity commented 8 months ago

Describe the bug For timer template; some times after timer expires notification doesn't get updated with pt_title_alt & pt_msg_alt and sometimes pt_big_img_alt doesn't gets rendered

To Reproduce Steps to reproduce the behavior:

  1. Config timer template
  2. wait for timer to expire
  3. observe; issue is not reproducible every time; mostly happens with xiaomi devices

Expected behavior After timer expires, notification should get updated with proper data; this is important to maintain UX

Screenshots/Logs

https://github.com/CleverTap/clevertap-android-sdk/assets/102023872/aee1adb9-26c0-420a-8f53-4cba9675c882

https://github.com/CleverTap/clevertap-android-sdk/assets/102023872/e7700eb8-da27-4b4a-ad92-599ad27c7b0e

Environment (please complete the following information):

Additional context Notification payload data

{ "pt_small_icon_clr": "#2c698d", "wzrk_acct_id": "ABC-DEF-GHI", "pt_big_img": "https://www.freemorningimages.com/wp-content/uploads/2023/08/Unprocessed-Good-Morning-Images-With-Coffee-And-Biscuits-2023.jpg", "pt_big_img_alt": "https://www.freemorningimages.com/wp-content/uploads/2023/04/beautiful-lovely-good-morning-images-with-quotes-for-whatsapp.jpg", "wzrk_acts": "[]", "pt_dl1": "https://play.google.com/store/apps/details?id=com.global.xddqsea&hl=en_IN&gl=US&utm_source=ap&utm_medium=push&utm_term=timer&campaign_id=B6T08gJp", "pt_msg": "Pick what you would like", "pt_timer_threshold": "0", "pt_msg_alt": "Wake up! Champ!", "pt_bg": "#4B5166", "pt_msg_clr": "#FFFFFF", "pt_title_clr": "#FFFFFF", "pt_chrono_title_clr": "#828fb3", "pt_title_alt": "Wake Up!", "nm": "Pick what you would like", "nt": "Don't Miss Your Chance!", "pt_id": "pt_timer", "pt_title": "Don't Miss Your Chance!", "wzrk_cid": "hotstar_general_notification", "wzrk_clr": "#2c698d", "wzrk_ttl": "1709552636", "pt_subtitle": "Don't Miss!", "wzrk_bp": "", "wzrk_ck": "101", "wzrk_dl": "hotstar://home?utm_source=ap&utm_medium=push&utm_term=basic&campaign_id=B6T08gJp&trigger_time=2024-03-03T11:43:54Z", "wzrk_pn": "true", "wzrk_st": "Don't Miss!", "pt_timer_end": "1709466240" }

Anush-Shand commented 8 months ago

@Dhaval4Proximity Could you please provide the verbose logs when the issue is reproduced?

Anush-Shand commented 8 months ago

@Dhaval4Proximity Could you also provide the campaign link which sends the above payload?

Anush-Shand commented 7 months ago

@Dhaval4Proximity Closing this due to inactivity. Feel free to reopen if required

Dhaval4Proximity commented 6 months ago

@Dhaval4Proximity Could you please provide the verbose logs when the issue is reproduced?

Hi @Anush-Shand

Please find verbose log while issue occurred

---------------------------- PROCESS STARTED (14945) for package com.my.apppkg ---------------------------- 19:02:01.231 14945-14945 CleverTap com.my.apppkg I Activity Lifecycle Callback successfully registered 19:02:01.363 14945-14945 CleverTap com.my.apppkg I Account Region not specified in the AndroidManifest - using default region 19:02:01.384 14945-14945 CleverTap:variables com.my.apppkg D init() called 19:02:01.386 14945-14945 CleverTap:variables com.my.apppkg D VarCache loaded cache data: {} 19:02:01.387 14945-14945 CleverTap:variables com.my.apppkg D applyVariableDiffs() called with: diffs = [{}] 19:02:01.387 14945-14945 CleverTap:variables com.my.apppkg D applyVariableDiffs: updated value of merged=[{}] 19:02:01.389 14945-17719 CleverTap com.my.apppkg D ExoPlayer is present 19:02:01.390 14945-14945 CleverTap com.my.apppkg I CleverTap SDK initialized with accountId: DUMMY-ACC-ID accountToken: 054-016 accountRegion: null 19:02:01.391 14945-17719 CleverTap com.my.apppkg D READ_PHONE_STATE permission not asked by the app or not granted by the user 19:02:01.397 14945-17717 CleverTa...ACC-ID-1234 com.my.apppkg D Job scheduled - -1319357128 19:02:01.402 14945-17717 CleverTap com.my.apppkg D READ_PHONE_STATE permission not asked by the app or not granted by the user 19:02:01.406 14945-17717 CleverTap com.my.apppkg I SDK Version Code is 50200 19:02:01.407 14945-17717 CleverTap com.my.apppkg I sdk.pushnotification.CTPushNotificationReceiver is present 19:02:01.408 14945-14945 CleverTap:CTRM com.my.apppkg D received a message from Firebase 19:02:01.409 14945-17717 CleverTap com.my.apppkg I pushnotification.CTNotificationIntentService is present 19:02:01.410 14945-17717 CleverTap com.my.apppkg I InAppNotificationActivity is present 19:02:01.411 14945-17717 CleverTap com.my.apppkg I inbox.CTInboxActivity is present 19:02:01.411 14945-17717 CleverTap com.my.apppkg I geofence.CTGeofenceReceiver not present 19:02:01.411 14945-14945 CleverTa...Provider com.my.apppkg D [PushType:FCM] Found Valid Notification Message 19:02:01.411 14945-14945 CleverTap:CTRM com.my.apppkg D returning from CTRM because message priority is not normal 19:02:01.411 14945-17717 CleverTap com.my.apppkg I geofence.CTLocationUpdateReceiver not present 19:02:01.411 14945-17717 CleverTap com.my.apppkg I geofence.CTGeofenceBootReceiver not present 19:02:01.411 14945-17717 CleverTap com.my.apppkg I pushnotification.amp.CTBackgroundJobService is present 19:02:01.412 14945-17717 CleverTap com.my.apppkg I pushnotification.amp.CTBackgroundIntentService is present 19:02:01.412 14945-17717 CleverTap com.my.apppkg I pushnotification.fcm.FcmMessageListenerService not present 19:02:01.645 14945-17729 CleverTa...Provider com.my.apppkg D [PushType:FCM] Found Valid Notification Message 19:02:01.685 14945-17729 CleverTa...ACC-ID-1234 com.my.apppkg D Handling notification: Bundle[{pt_small_icon_clr=#AA0000, wzrk_acct_id=DUMMY-ACC-ID, pt_big_img=https://media-dir.tempapp.com/notification/food/recepie+a-300x200_NEW.jpg, pt_big_img_alt=https://media-dir.tempapp.com/notification/food/recepie+a-300x200_NEW.jpg, wzrk_acts=[{"l":"RESTART PLAN","dl":"tempapp://subscribe/news-letters/methods?packId\u003dtempappSuperChef.IN.3Month.1299\u0026utm_source\u003dap\u0026utm_medium\u003dpush\u0026utm_campaign\u003dbatch_churned_renewal_combo_pp_in_na_eb_3mSuperChef_drip_nr_d1_na_timer\u0026campaign_id\u003didCampaign\u0026trigger_time\u003d2024-05-10T13:31:56Z","id":"WATCH_NOW"}], pt_chrono_title_clr=#ABCDE0, pt_dl1=tempapp://subscribe/news-letters/methods?packId=tempappSuperChef.IN.3Month.1299&utm_source=ap&utm_medium=push&utm_campaign=batch-receipe_a_timer&utm_term=timer&campaign_id=idCampaign, pt_msg=Don't Miss Out. Renew Now!, pt_timer_threshold=0, pt_msg_alt=Renew Your Subscription Now!, pt_msg_clr=#FFFFFF, pt_title_alt=Hurry Up, Don’t Miss Out, pt_title_clr=#FFFFFF, nm=Don't Miss Out. Renew Now!, nt=Your Plan Expires Tomorrow, pt_bg=#BB5566, pt_id=pt_timer, omr_invoke_time_in_millis=1715347921647, pt_title=Your Plan Expires Tomorrow, wzrk_cid=channel_id, wzrk_clr=#AA0000, wzrk_ttl=1715434317, wzrk_bp=https://media-dir.tempapp.com/notification/food/recepie+a-300x200_NEW.jpg, wzrk_ck=2, wzrk_dl=tempapp://subscribe/news-letters/methods?packId=tempappSuperChef.IN.3Month.1299&utm_source=ap&utm_medium=push&utm_campaign=batch-receipe_a_timer&utm_term=basic&campaign_id=idCampaign&trigger_time=2024-05-10T13:31:56Z, wzrk_pn=true, wzrk_st=, pt_timer_end=1715347980}] 19:02:01.698 14945-17729 CleverTa...ACC-ID-1234 com.my.apppkg D Rendering Push on channel = channel_id 19:02:01.708 14945-17729 CleverTa...ACC-ID-1234 com.my.apppkg D Creating the notification id: 2 from collapse_key: 2 19:02:02.507 14945-17729 CleverTa...ACC-ID-1234 com.my.apppkg D Rendered notification: Notification(channel=channel_id shortcut=null contentView=com.my.apppkg/0x7f0d00f1 vibrate=null sound=null defaults=0x0 flags=0x18 color=0xffAA0000 vis=PRIVATE) 19:02:02.512 14945-17729 CleverTap com.my.apppkg D Recording of Notification Viewed is disabled in the CleverTap Dashboard for notification payload: Bundle[{pt_small_icon_clr=#AA0000, wzrk_acct_id=DUMMY-ACC-ID, pt_big_img=https://media-dir.tempapp.com/notification/food/recepie+a-300x200_NEW.jpg, pt_big_img_alt=https://media-dir.tempapp.com/notification/food/recepie+a-300x200_NEW.jpg, wzrk_acts=[{"l":"RESTART PLAN","dl":"tempapp://subscribe/news-letters/methods?packId\u003dtempappSuperChef.IN.3Month.1299\u0026utm_source\u003dap\u0026utm_medium\u003dpush\u0026utm_campaign\u003dbatch_churned_renewal_combo_pp_in_na_eb_3mSuperChef_drip_nr_d1_na_timer\u0026campaign_id\u003didCampaign\u0026trigger_time\u003d2024-05-10T13:31:56Z","id":"WATCH_NOW"}], pt_chrono_title_clr=#ABCDE0, pt_dl1=tempapp://subscribe/news-letters/methods?packId=tempappSuperChef.IN.3Month.1299&utm_source=ap&utm_medium=push&utm_campaign=batch-receipe_a_timer&utm_term=timer&campaign_id=idCampaign, pt_msg=Don't Miss Out. Renew Now!, pt_timer_threshold=0, pt_msg_alt=Renew Your Subscription Now!, pt_msg_clr=#FFFFFF, pt_title_alt=Hurry Up, Don’t Miss Out, pt_title_clr=#FFFFFF, nm=Don't Miss Out. Renew Now!, nt=Your Plan Expires Tomorrow, pt_bg=#BB5566, pt_id=pt_timer, omr_invoke_time_in_millis=1715347921647, pt_title=Your Plan Expires Tomorrow, default_dl=true, notificationId=2, wzrk_cid=channel_id, wzrk_clr=#AA0000, wzrk_ttl=1715434317, wzrk_bp=https://media-dir.tempapp.com/notification/food/recepie+a-300x200_NEW.jpg, wzrk_ck=2, wzrk_dl=tempapp://subscribe/news-letters/methods?packId=tempappSuperChef.IN.3Month.1299&utm_source=ap&utm_medium=push&utm_campaign=batch-receipe_a_timer&utm_term=timer&campaign_id=idCampaign, wzrk_pn=true, wzrk_st=, pt_timer_end=1715347980}]

Device: One Plus 11 Android OS 14

darshanclevertap commented 6 months ago

@Dhaval4Proximity Opened this again on your request. @CTLalit will reach out to you soon as well

Anush-Shand commented 6 months ago

@Dhaval4Proximity From the above logs, the accountID attached to the log tag is ACC-ID-1234 which is the accountID of the app but the accountID in the notification payload for timer template is DUMMY-ACC-ID This leads to the issue. Please make sure the accountIds match

Dhaval4Proximity commented 6 months ago

@Anush-Shand , Apologies for miscommunication, accountID does matches, we only use one account; I have replaced sensitive data with some dummy data for security.

Anush-Shand commented 2 months ago

@Dhaval4Proximity

Could you please check and confirm if some log similar to this is printed when the issue is reproduced to help us narrow down the root cause? We can connect if required to debug the same

ActivityManager system_server D freezing 5915

Dhaval4Proximity commented 2 months ago

@Anush-Shand

yes, for android 14

ActivityManager system_server D freezing 10893 <package-name> is happening before timer actually ends in case when issue happens

When issue is not happening this^ log happens after timer-end notification is rendered to UI

I have shared debug video regarding this at email thread