Skip to content

Conversation

@localvar
Copy link
Contributor

@localvar localvar commented Jan 15, 2026

Description

fix bugs:

  • commit1: reusable password cannot be reused
  • commit2: allow_datetime does not work as expect
  • commit7: crash on token notification

Issue(s)

Close/close/Fix/fix/Resolve/resolve:

Checklist

Please check the items in the checklist if applicable.

  • Is the user manual updated?
  • Are the test cases passed and automated?
  • Is there no significant decrease in test coverage?

Copilot AI review requested due to automatic review settings January 15, 2026 10:30
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @localvar, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses two critical bugs: one preventing the correct enforcement of password reuse policies and another causing the ALLOW_DATETIME user login restriction to malfunction due to incorrect time zone handling. Additionally, it enhances the TOTP login test suite to provide more comprehensive coverage and reliability for user authentication mechanisms.

Highlights

  • Password Reuse Policy Fix: Corrected a bug where the password reuse policy was not properly enforced due to an incorrect calculation of password expiration time. The logic now correctly considers the set time of the previous password to determine the expiration of the current one.
  • ALLOW_DATETIME Functionality Fix: Resolved an issue where the ALLOW_DATETIME user login restriction did not work as expected. The time range calculation now correctly uses the server's local time zone, ensuring accurate enforcement of login schedules.
  • Documentation Update: Updated both English and Chinese documentation to clarify that ALLOW_DATETIME and NOT_ALLOW_DATETIME parameters are based on the server's local time zone.
  • TOTP Test Suite Enhancement: Improved the Two-Factor Authentication (TOTP) login test cases to cover a wider range of scenarios, including successful logins with current, previous, and next interval codes, and failures for invalid or expired codes.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request addresses two bugs: one related to reusable passwords and another concerning the allow_datetime feature. The changes in mndUser.c correctly adjust the logic for dropping old passwords from history, ensuring the password reuse policy is effective. The fix in tmsg.c aligns the allow_datetime check with the server's local time, as documented. Additionally, the TOTP login tests have been significantly improved for better coverage and robustness. The changes are well-implemented, but I have a couple of minor suggestions to improve code quality and documentation.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes two bugs related to password reuse and datetime whitelist functionality. The first bug prevented reusable passwords from being reused correctly due to incorrect expire time calculation. The second bug caused allow_datetime to not work as expected because it wasn't respecting the server's local timezone.

Changes:

  • Fixed password reuse logic by correcting expire time calculation in dropOldPasswords function
  • Fixed datetime whitelist validation by converting UTC timestamps to local time before calculating week seconds
  • Updated documentation to clarify that datetime restrictions are based on server's local timezone
  • Enhanced test coverage for TOTP login functionality with comprehensive interval testing

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
source/dnode/mnode/impl/src/mndUser.c Fixed password reuse bug by using the correct password's setTime as expire time and added dropOldPasswords call in mndUserDupObj
source/common/src/msg/tmsg.c Fixed allow_datetime bug by converting timestamps to local time before calculating week seconds
docs/zh/14-reference/03-taos-sql/60-user.md Updated Chinese documentation to clarify that datetime restrictions use server's local timezone
docs/en/14-reference/03-taos-sql/60-user.md Updated English documentation to clarify that datetime restrictions use server's local timezone
test/cases/24-Users/test_user_totp.py Enhanced test coverage with comprehensive TOTP interval testing and removed obsolete test setup

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@localvar localvar changed the title fix: fix two bugs fix: fix three bugs Jan 19, 2026
@guanshengliang guanshengliang merged commit 6a2a648 into main Jan 19, 2026
20 of 22 checks passed
@localvar localvar deleted the fix/fix-bugs branch January 19, 2026 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants