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(encoding/form): Timestamp use local time and fix test wrong mock time zone #3257

Merged
merged 2 commits into from
Mar 22, 2024

Conversation

demoManito
Copy link
Member

@demoManito demoManito commented Mar 17, 2024

Description (what this PR does / why we need it):

  1. The mock time zone should not be UTC. The time zone should be fixed when passing parameters.
  2. decode parseMessage should also use the current time zone time

Which issue(s) this PR fixes (resolves / be part of):

fix issue: #3181

Other special notes for the reviewers:

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Mar 17, 2024
@codecov-commenter
Copy link

codecov-commenter commented Mar 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.54%. Comparing base (1ab258e) to head (e7482b4).
Report is 3 commits behind head on main.

❗ Current head e7482b4 differs from pull request most recent head 001de14. Consider uploading reports for the commit 001de14 to get more accurate results

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3257   +/-   ##
=======================================
  Coverage   81.54%   81.54%           
=======================================
  Files          91       91           
  Lines        4167     4167           
=======================================
  Hits         3398     3398           
  Misses        589      589           
  Partials      180      180           

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

@demoManito demoManito changed the title fix(form/test): wrong mock time zone fix(form/test): Timestamp use local time and fix test wrong mock time zone Mar 17, 2024
@demoManito demoManito changed the title fix(form/test): Timestamp use local time and fix test wrong mock time zone fix(encoding/form): Timestamp use local time and fix test wrong mock time zone Mar 17, 2024
@@ -244,7 +244,7 @@ func parseMessage(md protoreflect.MessageDescriptor, value string) (protoreflect
if value == nullStr {
break
}
t, err := time.Parse(time.RFC3339Nano, value)
t, err := time.ParseInLocation(time.RFC3339Nano, value, time.Local)
Copy link
Member Author

Choose a reason for hiding this comment

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

image Synchronize time zone with encoding timestamp

@dosubot dosubot bot added the LGTM label Mar 22, 2024
@shenqidebaozi shenqidebaozi merged commit aeecf3c into main Mar 22, 2024
68 checks passed
@shenqidebaozi shenqidebaozi deleted the fix/encode/timestamp branch March 22, 2024 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LGTM size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants