Open mihaimatei opened 9 months ago
Hi @mihaimatei. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:
@magento give me 2.4-develop instance
- upcoming 2.4.x release@magento I am working on this
Join Magento Community Engineering Slack and ask your questions in #github channel. :warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting. :clock10: You can find the schedule on the Magento Community Calendar page. :telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.
Hi @engcom-Dash. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
Area: XXXXX
label to the ticket, indicating the functional areas it may be related to.2.4-develop
branch@magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure. 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.Hi @mihaimatei
Thanks for reporting and collaboration.
Verified the issue on both magento 2.4 dev instance and 2.4.7-beta2 instance but the issue is not reproducable.
Seeing correct import history execution time for non-en_US locale.
Please refer the screenshots attached.
@magento give me 2.4-develop instance
Hi @mihaimatei. Thank you for your request. I'm working on Magento instance for you.
Hi @mihaimatei, here is your Magento Instance: https://882a5b5e078303041ba6887b682795a9.instances-prod.magento-community.engineering Admin access: https://882a5b5e078303041ba6887b682795a9.instances-prod.magento-community.engineering/admin_87bb Login: 370f93a6 Password: fd04296bb01c
Hi @engcom-Dash , thank you for checking! In your test, I see you changed the General settings locale, and this is why you probably cannot replicate. EDIT: Actually, I see a pretty big difference in your reported times too (~10 times more execution time reported for same file).
In the Steps to reproduce, I've mentioned "Change admin user locale", without touching General settings locale, so they should be left to default (Locale: English US, Timezone: Los Angeles).
Here is the result following my Steps to reproduce, on the provided Magento instance offered by the deployment service:
You can also access this instance and:
@magento give me 2.4-develop instance
Hi @engcom-Dash. Thank you for your request. I'm working on Magento instance for you.
Hi @engcom-Dash, here is your Magento Instance: https://882a5b5e078303041ba6887b682795a9.instances-prod.magento-community.engineering Admin access: https://882a5b5e078303041ba6887b682795a9.instances-prod.magento-community.engineering/admin_8c93 Login: 29ff8dd3 Password: 9e11d8f54c7c
Hi @mihaimatei
Thanks for reporting and collaboration.
Verified the issue in magento 2.4 dev instance and the issue is reproducable.
The import history execution time is wrong for other than en_US user locale.
Please refer the attached screenshot.
:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-10929 is successfully created for this GitHub issue.
:white_check_mark: Confirmed by @engcom-Dash. Thank you for verifying the issue.
Issue Available: @engcom-Dash, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
:x: You don't have permission to export this issue.
:x: Cannot export the issue. This GitHub issue is already linked to Jira issue(s): https://jira.corp.adobe.com/browse/AC-10929
Preconditions and environment
Steps to reproduce
Expected result
Import History shows correct execution time of the import when import is run by a user with non-en_US locale (de_CH and ro_RO tested)
Actual result
Import History shows incorrect execution time of the import when import is run by a user with non-en_US locale (de_CH and ro_RO tested)
Additional information
Problem appears in the \Magento\Framework\Stdlib\DateTime\Timezone::date method, in the switch branch of
case (!is_numeric($date))
.Below is a summarised stack trace with relevant dumps which I've performed to track the issue:
IMPORT CSV - en_US locale admin user - CORRECT Execution Time
\Magento\ImportExport\Model\History::setExecutionTime($executionTime = 'Validation')
\Magento\ImportExport\Model\History::setExecutionTime($executionTime = 'In Progress')
\Magento\Framework\Stdlib\DateTime\Timezone::date($date = '2024-01-22 15:42:12')$locale
:en_US
$timezone
:Europe/Berlin
case (!is_numeric($date))
matched1705938132
date('Y-m-d H:i:s', $date)
:'2024-01-22 15:42:12'
\Magento\ImportExport\Helper\Report::getExecutionTime($time = '2024-01-22 15:42:12')
$this->timeZone->getDateTimeFormat(\IntlDateFormatter::SHORT)
):M/d/yy h:mm a
0
$timeDiff->format('%Y-%m-%d %H:%I:%S')
):'00-0-0 00:00:04'
$timeDiff->format('%H:%I:%S')
):'00:00:04'
\Magento\ImportExport\Model\History::setExecutionTime($executionTime = '00:00:04')
IMPORT CSV - de_CH locale admin user - WRONG Execution Time
\Magento\ImportExport\Model\History::setExecutionTime($executionTime = 'Validation')
\Magento\ImportExport\Model\History::setExecutionTime($executionTime = 'In Progress')
\Magento\Framework\Stdlib\DateTime\Timezone::date($date = '2024-01-22 15:59:51')
$locale
:de_CH
$timezone
:Europe/Berlin
case (!is_numeric($date))
matched$date
:1815832740
<---- PROBLEM HEREdate('Y-m-d H:i:s', $date)
:'2027-07-17 13:59:00'
\Magento\ImportExport\Helper\Report::getExecutionTime($time = '2027-07-17 13:59:00')
$this->timeZone->getDateTimeFormat(\IntlDateFormatter::SHORT)
):dd.MM.yy HH:mm
$timeDiff->days
):1271
,$timeDiff->format('%Y-%m-%d %H:%I:%S')
):'03-5-25 22:58:56'
,$timeDiff->format('%H:%I:%S')
):'22:58:56'
\Magento\ImportExport\Model\History::setExecutionTime($executionTime = '22:58:56')
The execution time might not seem important for user triggered csv imports, but when a custom import is built over the import-export module and imports run as scheduled tasks, import history execution time might be of importance to assess the health of the import, hence the severity can be evaluated even as S2.
In case of a custom import built on top of the import-export module, workaround for getting the correct execution time would be to set locale to en_US before triggering the import methods, but this might affect other data handling in the actually imported data.
Release note
No response
Triage and priority