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

fix: [cherrypick][V12.3.0] Redesign Signature Message date values #27305

Merged

Conversation

digiwand
Copy link
Contributor

@digiwand digiwand commented Sep 20, 2024

Description

Cherry-pick #27249 for v12.3.0

Fix date values:

  • Formerly, conversations were converting values as if they were milliseconds. However, these values come from Solidity where these timestamps are unix timestamps in seconds.
  • Support -1 (no expiration) value
  • Display "expiry" as a date instead of a unix timestamp

This PR fixes the conversion.

Open in GitHub Codespaces

Fixes: #27137

  1. Go to test-dapp
  2. Request Permit or another TypedSign request
  3. Observe deadlines and dates

  • I've followed MetaMask Contributor Docs and MetaMask Extension Coding
    Standards
    .

  • I've completed the PR template to the best of my ability

  • I’ve included tests if applicable

  • I’ve documented my code using JSDoc format if applicable

  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).

  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Fix date values:
- Formerly, conversations were converting values as if they were
milliseconds. However, these values come from Solidity where these
timestamps are unix timestamps in seconds.
- Support -1 (no expiration) value
- Display "expiry" as a date instead of a unix timestamp

This PR fixes the conversion.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/27249?quickstart=1)

Fixes: #27137

1. Go to test-dapp
2. Request Permit or another TypedSign request
3. Observe deadlines and dates

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

<img width="320"
src="https://github.com/user-attachments/assets/855fc4a5-5a1b-4575-bfda-40b5b6688fe3">

<img width="320"
src="https://github.com/user-attachments/assets/0bc90b15-daa7-4537-9cd1-8727000899b2">

<img width="320"
src="https://github.com/user-attachments/assets/e1beb4f9-2b41-4ef9-8190-8264d88c9ab0">

<img width="320"
src="https://github.com/user-attachments/assets/edb4d259-29a3-4558-8858-e5b619c0ce18">

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
@digiwand digiwand requested review from a team as code owners September 20, 2024 13:10
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label Sep 20, 2024
@metamaskbot
Copy link
Collaborator

Builds ready [06e2114]
Page Load Metrics (1788 ± 89 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint29022631710373179
domContentLoaded15572162175117182
load15952289178818589
domInteractive156536136

@digiwand digiwand added the release-12.3.0 Issue or pull request that will be included in release 12.3.0 label Sep 20, 2024
Copy link

codecov bot commented Sep 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.14%. Comparing base (439f7d6) to head (74c7dc0).
Report is 17 commits behind head on Version-v12.3.0.

Additional details and impacted files
@@                 Coverage Diff                 @@
##           Version-v12.3.0   #27305      +/-   ##
===================================================
- Coverage            70.24%   70.14%   -0.11%     
===================================================
  Files                 1426     1432       +6     
  Lines                50239    50430     +191     
  Branches             13954    13992      +38     
===================================================
+ Hits                 35289    35370      +81     
- Misses               14950    15060     +110     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@danjm danjm merged commit e5a2159 into Version-v12.3.0 Sep 23, 2024
70 checks passed
@danjm danjm deleted the cherry-pick-12.3.0-fix-redesign-sign-date-displays branch September 23, 2024 14:00
@github-actions github-actions bot locked and limited conversation to collaborators Sep 23, 2024
@digiwand digiwand linked an issue Sep 24, 2024 that may be closed by this pull request
18 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
INVALID-PR-TEMPLATE PR's body doesn't match template release-12.3.0 Issue or pull request that will be included in release 12.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cherry-pick PRs for 12.3.0 (including formal 12.4.0 PRs)
5 participants