Skip to content

Update expires_at column type from table admin_user_expiration in ord… #34462

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

Conversation

SinpietruAdrian
Copy link

@SinpietruAdrian SinpietruAdrian commented Oct 28, 2021

Description

New admin account is disabled after a login attempt is made if the account's expiration date is greater than 2038. This is fixed by updating the expires_at column type from the admin_user_expiration table to datetime.

Fixed Issues

#34463

Manual testing scenarios

Create an admin user with an Expiration Date greater than 2038 and attempt a login to the admin area with this newly created user.

@m2-assistant
Copy link

m2-assistant bot commented Oct 28, 2021

Hi @SinpietruAdrian. Thank you for your contribution
Here are some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names. Allowed build names are:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here

ℹ️ Run only required test builds during development. Run all test builds before sending your pull request for review.

For more details, review the Magento Contributor Guide documentation.

⚠️ According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of Pull Requests 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.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@hostep
Copy link
Contributor

hostep commented Oct 28, 2021

FYI, this is a similar fix as #22718 that solved a similar problem with the year 2037/2038 in coupon codes as described over here

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@SinpietruAdrian
Copy link
Author

@magento run all tests

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@ihor-sviziev
Copy link
Contributor

@SinpietruAdrian @hostep,
Good catch!
It looks like we should migrate all fields with "timestamp" to the "datetime".
What do you think?

@hostep
Copy link
Contributor

hostep commented Oct 28, 2021

@ihor-sviziev: yeah probably, I guess. But should it happen in scope of this PR?
I "only" find 146 occurrences in the entire codebase 😛

@ihor-sviziev
Copy link
Contributor

@hostep, as to me it looks like a quite simple fix. It's better to fix all places at once than fixing all places separately

@sidolov sidolov added the Priority: P2 A defect with this priority could have functionality issues which are not to expectations. label Oct 28, 2021
@hostep
Copy link
Contributor

hostep commented Oct 29, 2021

@ihor-sviziev: I've just briefly discussed this with Adrian (a colleague of mine) during our daily standup, and we decided that it is out of scope of this PR to change all the fields in the entire codebase, because there could be unwanted consequences due to how timezones are handled. In this particular case, the timezone is not that important.

I've opened a new issue to investigate all other usages of those timestamp fields in the codebase: #34478

Is this ok for you guys?

Copy link
Contributor

@ihor-sviziev ihor-sviziev left a comment

Choose a reason for hiding this comment

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

Hi @SinpietruAdrian,
Could you sign the adobe CLA?

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@ihor-sviziev ihor-sviziev added Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests Award: bug fix labels Oct 29, 2021
@m2-assistant
Copy link

m2-assistant bot commented Nov 2, 2021

Hi @SinpietruAdrian, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@SinpietruAdrian
Copy link
Author

I've signed the CLA, closed/reopened the PR but it's still failing. Anything else I should do?

@ihor-sviziev
Copy link
Contributor

Hi @SinpietruAdrian,
Please add your commit author's email to your github account.

@engcom-Bravo engcom-Bravo self-assigned this Jan 4, 2022
@engcom-Bravo
Copy link
Contributor

@SinpietruAdrian Please sign CLA. We could not merge PR without that

@engcom-Lima engcom-Lima self-assigned this Jan 20, 2022
@engcom-Lima
Copy link
Contributor

Hi @SinpietruAdrian ,

Thank you for your contribution!

We are not able to proceed further on this PR as you have not signed the Adobe CLA yet. Hence closing this PR.

Please reopen and update if you wish to continue.

Thank you for your contribution!

@hostep
Copy link
Contributor

hostep commented Sep 13, 2022

Looks like this got fixed by core devs in: 97f85b9 (which is included in Magento 2.4.5)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests Award: bug fix Component: Security Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Release Line: 2.4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New admin account is disabled after a login attempt is made if the account's expiration date is greater than 2038
7 participants