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

Update SystemClock.kt #208

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Musharaf13
Copy link

Updated the SDK to ensure that timestamps are always sent in English, regardless of the user's device language settings. This resolves an issue where the API fails if an Arabic timestamp is sent due to the user's device being set to Arabic.

Description

Updated the SDK to ensure that timestamps are always sent in English, regardless of the user's device language settings. This resolves an issue where the API fails if an Arabic timestamp is sent due to the user's device being set to Arabic.

Check List

Are you changing anything with the public API?
No, this change is internal and does not affect the public API.
Are your changes backwards compatible with previous SDK Versions?
Yes, the change maintains compatibility with previous SDK versions.
Have you tested this change on a real device?
Yes, the changes have been tested on a real device to ensure proper functionality.
Have you added unit test coverage for your changes?
Unit tests have been added to verify that the timestamp is always sent in English.
Have you verified that your changes are compatible with all Android versions the SDK currently supports?
Yes, the changes have been verified to work across all supported Android versions.

Changelog / Code Overview

Modified: The SystemClock implementation now explicitly uses Locale.ENGLISH in the SimpleDateFormat instance to ensure timestamps are consistently formatted in English.
Reason: The API fails when Arabic-formatted timestamps are sent, as the system defaults to the device's language settings. This update ensures consistent API behavior regardless of the user's locale.
Supporting Material:

Test Plan

Tested the updated SystemClock implementation by simulating device language settings in Arabic and verifying that the timestamp is sent in English.
Verified that the API accepts the updated timestamp format without errors.
Confirmed the change works across different Android versions and devices.

Related Issues/Tickets

it is updated to always send timesampt in English since api fails if user's device langauge is arabic and arabic timestamp is sent
@Musharaf13 Musharaf13 requested a review from a team as a code owner January 24, 2025 07:23
Copy link
Contributor

@evan-masseau evan-masseau left a comment

Choose a reason for hiding this comment

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

Thank you for bringing this to our attention and applying a fix!

@dan-peluso
Copy link
Contributor

Going to try and get a unit test in for this today. Thanks for opening this!

@dan-peluso
Copy link
Contributor

I didn't have push permissions in your fork so I made a new PR with a unit test

#210

@Musharaf13

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.

3 participants