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(datetime): make sure the epoch is not larger than the maximum supported value #11424

Merged
merged 2 commits into from Aug 11, 2023

Conversation

lafirest
Copy link
Member

@lafirest lafirest commented Aug 10, 2023

A user sets a large timestamp by API to the banned feature, the value of this timestamp is out of the supported range and will crash the list API of the banned feature, and meanwhile, there is no clean_all API in this feature, thus the user can't delete the bad date.

There will be a series PRs to unify the emqx_datetime and emqx_calender

Fixes

Summary

🤖 Generated by Copilot at 526c61c

Export and implement epoch_to_rfc3339 functions in emqx_calendar module and improve emqx_datetime module to handle maximum epoch timestamp. These changes are for better compatibility and validation of date and time formats.

PR Checklist

Please convert it to a draft if any of the following conditions are not met. Reviewers may skip over until all the items are checked:

  • Added tests for the changes
  • Added property-based tests for code which performs user input validation
  • Changed lines covered in coverage report
  • Change log has been added to changes/(ce|ee)/(feat|perf|fix)-<PR-id>.en.md files
  • For internal contributor: there is a jira ticket to track this change
  • Created PR to emqx-docs if documentation update is required, or link to a follow-up jira ticket
  • Schema changes are backward compatible

Checklist for CI (.github/workflows) changes

  • If changed package build workflow, pass this action (manual trigger)
  • Change log has been added to changes/ dir for user-facing artifacts update

@lafirest lafirest marked this pull request as ready for review August 10, 2023 10:52
@lafirest lafirest requested a review from a team as a code owner August 10, 2023 10:52
@lafirest lafirest force-pushed the fix/epoch_maximum_val branch 2 times, most recently from 3983a77 to 77305a9 Compare August 11, 2023 05:53
@lafirest lafirest requested a review from thalesmg August 11, 2023 08:35
@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 5831278886

  • 7 of 7 (100.0%) changed or added relevant lines in 1 file are covered.
  • 27 unchanged lines in 13 files lost coverage.
  • Overall coverage increased (+0.02%) to 81.365%

Files with Coverage Reduction New Missed Lines %
apps/emqx_bridge_gcp_pubsub/src/emqx_bridge_gcp_pubsub_client.erl 1 94.74%
apps/emqx_connector/src/emqx_connector_jwt_worker.erl 1 89.47%
apps/emqx_dashboard/src/emqx_dashboard_monitor.erl 1 66.21%
apps/emqx_gateway_mqttsn/src/emqx_mqttsn_channel.erl 1 73.78%
apps/emqx_gateway/src/emqx_gateway_utils.erl 1 86.49%
apps/emqx/src/emqx_banned.erl 1 89.55%
apps/emqx/src/emqx_connection.erl 1 83.47%
apps/emqx/src/emqx_logger_jsonfmt.erl 1 84.92%
apps/emqx_bridge_gcp_pubsub/src/emqx_bridge_gcp_pubsub_consumer_worker.erl 2 93.31%
apps/emqx_ft/src/emqx_ft_storage_fs.erl 2 83.58%
Totals Coverage Status
Change from base Build 5830810370: 0.02%
Covered Lines: 32231
Relevant Lines: 39613

💛 - Coveralls

@lafirest lafirest merged commit b8d3dcf into emqx:master Aug 11, 2023
127 checks passed
@lafirest lafirest deleted the fix/epoch_maximum_val branch August 11, 2023 12:38
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.

None yet

4 participants