Skip to content

Fix default values when no TTL and sentTime is available#1531

Merged
Jeasmine merged 3 commits intomainfrom
fix/hms-notification
Feb 15, 2022
Merged

Fix default values when no TTL and sentTime is available#1531
Jeasmine merged 3 commits intomainfrom
fix/hms-notification

Conversation

@Jeasmine
Copy link
Copy Markdown
Contributor

@Jeasmine Jeasmine commented Feb 10, 2022

Description

One Line Summary

Fix default values when no TTL and sentTime is available

Details

Motivation

HMS Notification with Data Message type is not being displayed because TTL value and Sent Time is coming with 0. Due to TTL check notification is not displayed.
Not rely on getCurrentThreadTimeMillis since it depend on each Thread and is not the same between threads. N

Scope

HMS Notifications

Testing

Unit testing

Add ttl_shouldDisplayNotificationWithNoTTLandSentTime test case

Manual testing

Test notification display with data and message, message type notification, with application in background and swiped away. On Huawei P20 Lite Android 9

Affected code checklist

  • Notifications
    • Display
    • Open
    • Push Processing
    • Confirm Deliveries
  • Outcomes
  • Sessions
  • In-App Messaging
  • REST API requests
  • Public API changes

Checklist

Overview

  • I have filled out all REQUIRED sections above
  • PR does one thing
    • If it is hard to explain how any codes changes are related to each other then it most likely needs to be more than one PR
  • Any Public API changes are explained in the PR details and conform to existing APIs

Testing

  • I have included test coverage for these changes, or explained why they are not needed
  • All automated tests pass, or I explained why that is not possible
  • I have personally tested this on my device, or explained why that is not possible

Final pass

  • Code is as readable as possible.
    • Simplify with less code, followed by splitting up code into well named functions and variables, followed by adding comments to the code.
  • I have reviewed this PR myself, ensuring it meets each checklist item
    • WIP (Work In Progress) is ok, but explain what is still in progress and what you would like feedback on. Start the PR title with "WIP" to indicate this.

This change is Reviewable

* HMS notification TTL and sentTime is coming with no value
* Notification is not being displayed due to missing data
* Add default values
@Jeasmine Jeasmine added the WIP Work In Progress label Feb 10, 2022
* getCurrentThreadTimeMillis retrieves SystemClock.currentThreadTimeMillis()
* CurrentThreadTimeMillis is a value that can vary between threads, is not safe to rely on it
* Test HMS notification with no TTL and sentTime
@Jeasmine Jeasmine force-pushed the fix/hms-notification branch from 08f46f1 to 7315a7f Compare February 10, 2022 21:13
@Jeasmine Jeasmine changed the title WIP - Fix default values when no TTL and sentTime is available Fix default values when no TTL and sentTime is available Feb 10, 2022
@Jeasmine Jeasmine requested a review from a team February 10, 2022 21:13
@Jeasmine Jeasmine removed the WIP Work In Progress label Feb 10, 2022
Copy link
Copy Markdown
Member

@jkasten2 jkasten2 left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 8 of 8 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @Jeasmine)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants