Refactor date-timezone conversion to fix DB incompatibilities with Log utility#30
Open
chasegiunta wants to merge 1 commit intodoublesecretagency:v2-devfrom
Open
Refactor date-timezone conversion to fix DB incompatibilities with Log utility#30chasegiunta wants to merge 1 commit intodoublesecretagency:v2-devfrom
chasegiunta wants to merge 1 commit intodoublesecretagency:v2-devfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While evaluating this plugin, notification logs weren't showing up for me at all locally. Narrowed it down to the
CONVERT_TZSQL function being the culprit (maybe an incompatibility with MariaDB / MySQL versions?). After a lengthy discussion with our robotic AI overlords, I was able to accomplish the same timezone conversion using PHP and was able to see my logs!AI generated summary below:
This pull request updates the way log records are filtered by date in the
NotificationLogutility. Instead of relying on SQL timezone conversion, it now uses PHP'sDateTimeandDateTimeZoneclasses to compute the start and end of the selected day in the system timezone, ensuring more accurate and reliable date filtering.Improvements to date filtering and timezone handling:
DateTimeZoneand updated logic to use PHP'sDateTimeandDateTimeZonefor determining the start and end of the selected day in the system timezone (src/utilities/NotificationLog.php).BETWEENcondition ondateCreatedusing the computed start and end of day, replacing the previous SQLCONVERT_TZapproach (src/utilities/NotificationLog.php).