Skip to content

refactor(date): use Instant for internal representation [WPB-10090] - #5093

Merged
MohamadJaara merged 1 commit into
developfrom
mo/use-instant-for-date-representation
Jul 28, 2026
Merged

refactor(date): use Instant for internal representation [WPB-10090]#5093
MohamadJaara merged 1 commit into
developfrom
mo/use-instant-for-date-representation

Conversation

@MohamadJaara

@MohamadJaara MohamadJaara commented Jul 23, 2026

Copy link
Copy Markdown
Member

https://wearezeta.atlassian.net/browse/WPB-10090

What changed

The app now keeps dates as Instant internally instead of converting them to strings and parsing them again later.

Dates are formatted only when the UI needs text. This also removes the unused String-based date helpers and updates the related tests.

The benchmark stays opt-in, so normal instrumentation runs do not execute it.

Benchmarks

Physical Android device, 800,000 calls per path:

Formatting Runtime: String → Instant Speedup Allocation/op: String → Instant GC count/time: String → Instant
Device date 9.200 s → 6.312 s 1.46× 4,619 B → 2,850 B 16/940 ms → 9/520 ms
Medium date 5.492 s → 1.911 s 2.87× 3,658 B → 1,000 B 12/698 ms → 3/200 ms
Full date 5.521 s → 1.938 s 2.85× 3,714 B → 1,057 B 12/679 ms → 3/197 ms
Message time 2.756 s → 0.376 s 7.32× 1,897 B → 128 B 6/348 ms → 0/0 ms

The typed paths also recorded zero blocking GC events in this run. These are comparison numbers, not performance thresholds.

@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.00000% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.67%. Comparing base (8019696) to head (221ca3f).

Files with missing lines Patch % Lines
...m/wire/android/mapper/MessageDateGroupingMapper.kt 92.85% 0 Missing and 2 partials ⚠️
...e/android/ui/home/conversations/model/UIMessage.kt 33.33% 2 Missing ⚠️
...kotlin/com/wire/android/util/DateAndTimeParsers.kt 88.88% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #5093      +/-   ##
===========================================
- Coverage    49.70%   49.67%   -0.04%     
===========================================
  Files          660      659       -1     
  Lines        24043    23994      -49     
  Branches      3737     3722      -15     
===========================================
- Hits         11950    11918      -32     
+ Misses       10963    10962       -1     
+ Partials      1130     1114      -16     
Files with missing lines Coverage Δ
.../wire/android/mapper/SystemMessageContentMapper.kt 46.98% <100.00%> (-0.32%) ⬇️
...otlin/com/wire/android/ui/WireActivityViewModel.kt 73.69% <100.00%> (+0.20%) ⬆️
.../android/ui/authentication/devices/model/Device.kt 93.33% <100.00%> (+6.66%) ⬆️
...ndroid/ui/home/conversations/AuthorHeaderHelper.kt 85.71% <100.00%> (ø)
...conversations/composer/MessageComposerViewModel.kt 76.53% <ø> (-0.24%) ⬇️
...kotlin/com/wire/android/util/DateAndTimeParsers.kt 72.41% <88.88%> (-0.32%) ⬇️
...m/wire/android/mapper/MessageDateGroupingMapper.kt 90.56% <92.85%> (+7.80%) ⬆️
...e/android/ui/home/conversations/model/UIMessage.kt 40.84% <33.33%> (-0.24%) ⬇️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8019696...221ca3f. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MohamadJaara MohamadJaara changed the title refactor(date): use Instant for internal representation refactor(date): use Instant for internal representation [WPB-10090] Jul 23, 2026
@MohamadJaara
MohamadJaara marked this pull request as ready for review July 23, 2026 19:09
@MohamadJaara
MohamadJaara added this pull request to the merge queue Jul 28, 2026
Merged via the queue into develop with commit 09d82fd Jul 28, 2026
27 of 30 checks passed
@MohamadJaara
MohamadJaara deleted the mo/use-instant-for-date-representation branch July 28, 2026 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants