Skip to content

Daylight saving time fix#48363

Merged
mrm9084 merged 11 commits intoAzure:mainfrom
mrm9084:DaylightSavingTimeFix
Mar 18, 2026
Merged

Daylight saving time fix#48363
mrm9084 merged 11 commits intoAzure:mainfrom
mrm9084:DaylightSavingTimeFix

Conversation

@mrm9084
Copy link
Copy Markdown
Member

@mrm9084 mrm9084 commented Mar 10, 2026

Description

Fixes an issue where timezone info doesn't work around Daylight Savings time for the recurring time filter.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

Copilot AI review requested due to automatic review settings March 10, 2026 23:08
@mrm9084 mrm9084 requested review from a team, nroutray, rujche and saragluna as code owners March 10, 2026 23:08
@github-actions github-actions Bot added the azure-spring All azure-spring related issues label Mar 10, 2026
Copy link
Copy Markdown
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 addresses a Daylight Saving Time (DST) issue in the Spring Cloud Azure Feature Management “recurring time window” logic, aiming to make recurrence validation/evaluation behave consistently across DST transitions.

Changes:

  • Update recurrence validation to use UTC when computing week-based gaps (avoids DST-dependent day lengths).
  • Add DST-focused unit tests for RecurrenceValidator and RecurrenceEvaluator.
  • Add DST-handling logic in weekly recurrence evaluation when comparing fixed-offset start times with region-based “now” times.

Reviewed changes

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

File Description
sdk/spring/spring-cloud-azure-feature-management/src/main/java/com/azure/spring/cloud/feature/management/implementation/timewindow/recurrence/RecurrenceValidator.java Switches “today” computation to UTC to avoid DST affecting duration/gap calculations.
sdk/spring/spring-cloud-azure-feature-management/src/main/java/com/azure/spring/cloud/feature/management/implementation/timewindow/recurrence/RecurrenceEvaluator.java Adds DST-aware zone conversion logic for weekly recurrence computations.
sdk/spring/spring-cloud-azure-feature-management/src/test/java/com/azure/spring/cloud/feature/management/filters/recurrence/RecurrenceValidatorDSTTest.java Introduces DST-related validation tests (currently mostly “no exception” assertions).
sdk/spring/spring-cloud-azure-feature-management/src/test/java/com/azure/spring/cloud/feature/management/filters/recurrence/RecurrenceEvaluatorDSTTest.java Introduces DST-related evaluation tests for fixed-offset vs region-zone comparisons.

Copy link
Copy Markdown
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

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

@rujche rujche added the azure-spring-app-configuration Spring app configuration related issues. label Mar 16, 2026
@rujche rujche moved this from Todo to In Progress in Spring Cloud Azure Mar 16, 2026
@rujche rujche added this to the 2026-04 milestone Mar 16, 2026
Copy link
Copy Markdown
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

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.


You can also share your feedback on Copilot code review. Take the survey.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@avanigupta
Copy link
Copy Markdown
Member

Do other languages have the same issue?

@mrm9084
Copy link
Copy Markdown
Member Author

mrm9084 commented Mar 18, 2026

Do other languages have the same issue?

Not that I know of. I had another PR build fail because of this issue.

@mrm9084 mrm9084 merged commit c57f2d2 into Azure:main Mar 18, 2026
23 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Spring Cloud Azure Mar 18, 2026
@mrm9084 mrm9084 deleted the DaylightSavingTimeFix branch March 18, 2026 21:48
@avanigupta
Copy link
Copy Markdown
Member

Here's what copilot found. Might be worth double checking:

Aspect Java (this PR) .NET JavaScript Python
Interval calculation ChronoUnit.WEEKS.between() (calendar) TimeSpan.TotalSeconds (duration) Date.getTime() (UTC ms) .days (calendar)
DST zone handling ✅ Fixed offset → region zone conversion DateTimeOffset handles implicitly ⚠️ Static offset parameter (no DST) ❌ Naive datetime (no timezone)
Duration validation ✅ UTC conversion ✅ Implicit via DateTimeOffset ⚠️ UTC ms (correct for duration) ❌ No UTC awareness
DST-specific tests ✅ 22 tests (this PR) ❌ None ❌ None ❌ None

Findings:

  1. JavaScript has a latent DST bug — The timezoneOffset parameter in parseRecurrenceParameter() is static and doesn't update when DST transitions occur. Day-of-week calculations can be wrong for dates where the offset differs from the stored value. This doesn't affect interval counting (which uses UTC milliseconds) but affects which day a time falls on.

  2. Python has a latent DST bug — Uses naive datetime objects with no timezone awareness. The .days property works for calendar day counting, but there's no handling of fixed-offset vs. region-zone scenarios. The Python feature management library's _recurrence_evaluator.py has no DST-awareness whatsoever.

  3. .NET is safeDateTimeOffset inherently stores the offset and all arithmetic is offset-aware. No DST-specific code needed.

Netyyyy added a commit that referenced this pull request Apr 24, 2026
* Fix: Skip App Configuration validation when feature is disabled (#47588)

(cherry picked from commit 0d08d06)

* Collection monitoring (#47648)

* start collection monitoring

* Updating collection monitoring

* Updating State

* Updated docs

* cleaning up refresh

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fixing tests

* New tests

* More new tests

* Update AzureAppConfigDataLoader.java

* Fixing Formatting

* Update AppConfigurationReplicaClient.java

* Code Review comments

* review comments

* code review items

* Format fixing

* fixing tests

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

(cherry picked from commit f6267fc)

* App Configuration Provider - Tag filters (#47985)

* Tag Filter + Updated JavaDocs

* Fixing tests

* Update CHANGELOG.md

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* review comments

* Tag Filter util file + tests

* Update ValidationUtilTest.java

* assertsame

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
(cherry picked from commit e43ce23)

* Load balance bug (#48121)

* Fixes Load Balancing Bug

* fixes

* new version

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/ConnectionManager.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/ConnectionManagerTest.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
(cherry picked from commit c237703)

* fix(spring-messaging-servicebus): evict stale processors from cache (#48062)

* fix(spring-messaging-servicebus): evict stale processors from cache (#48030)

* chore: revert CHANGELOG entry per reviewer feedback

* Update sdk/spring/spring-messaging-azure-servicebus/src/test/java/com/azure/spring/messaging/servicebus/core/DefaultServiceBusNamespaceProcessorFactoryTests.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix: separate try-catch for listener notification and stale processor close

Ensures stale.close() always executes even if listener notification
throws, preventing a potential resource leak.

* refactor: extract buildProcessorName to local variable in stale eviction block

Avoids recomputing buildProcessorName(key) multiple times and ensures
consistent value across debug log, listener callback, and warn logs.

* test: add mock-based tests for running-to-not-running processor transition

- Add testRunningProcessorReturnedFromCache: verifies running processor
  stays in cache without eviction
- Add testProcessorEvictedAfterTransitionToNotRunning: verifies stale
  (non-running) processor is evicted, closed, and replaced
- Update comments on existing stale tests to clarify they test
  never-started processors; reference new mock tests for transition
- Add reflection helper getProcessorMap() for injecting mocks into cache

---------

Co-authored-by: Eldert Grootenboer (from Dev Box) <egrootenboer@microsoft.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

(cherry picked from commit 1c16e17)

* Fix: KeyVaultJcaProvider registered at highest JCA priority breaks mTLS with standard keystores (#48198)

* Initial plan

* Fix: KeyVaultJcaProvider registered at highest priority breaks mTLS with standard keystores

Co-authored-by: rujche <171773178+rujche@users.noreply.github.com>

* Revert spring-cloud-azure-autoconfigure/CHANGELOG.md - keep aligned with other versions

Co-authored-by: rujche <171773178+rujche@users.noreply.github.com>

* Update CHANGELOG issue link to #48183

Co-authored-by: rujche <171773178+rujche@users.noreply.github.com>

* Apply PR review suggestions: remove unused param and use PROVIDER_NAME constant

Co-authored-by: rujche <171773178+rujche@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rujche <171773178+rujche@users.noreply.github.com>

(cherry picked from commit 7f9adaf)

* update changelog

* App Config Spring - Json content type fix (#48448)

* fixing semi colon support

* Update CHANGELOG.md

* bug fix

* review comments

* Apply suggestions from code review

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* remove release notes

* Update JsonConfigurationParser.java

* Update JsonConfigurationParser.java

* Update JsonConfigurationParser.java

* Update JsonConfigurationParser.java

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
(cherry picked from commit c0c405a)

* update changelog

* App Config - Startup retry (#47857)

* Refactor +  Startup Retry

* Update AzureAppConfigDataLoader.java

* Adding Tests

* Updating readme, correct location

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* interval change

* fixes after merge

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update AzureAppConfigDataLoader.java

* review comments

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

(cherry picked from commit 02491f7)

* App Config Spring - Refresh Refactor  (#47877)

* Refactor Refresh

* review fixes

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update StateHolderTest.java

* Update AppConfigurationRefreshUtil.java

* Update AppConfigurationRefreshUtil.java

* Update sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/StateHolder.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update AzureAppConfigBootstrapRegistrar.java

* Update AppConfigurationRefreshUtilTest.java

* Update ConnectionManager.java

* Update AppConfigurationRefreshUtilTest.java

* fixing after merge

* Update AppConfigurationRefreshUtilTest.java

* fixing tests

* fixing merge issue

* Update RecurrenceEvaluator.java

* Update RecurrenceEvaluator.java

* better fix

* new fix

* Update AppConfigurationWatchAutoConfiguration.java

* Update AppConfigurationPullRefresh.java

* Update AppConfigurationPullRefresh.java

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

(cherry picked from commit dcd90d0)

* Fixing Load Balancing shuffle (#48274)

* Fixing Load Balancing shuffle

* Update ConnectionManager.java

* Update ConnectionManager.java

(cherry picked from commit bb97593)

* Bug 47910.count query text block (#47911)

* RED: isCountQuery() should return true for queries in text blocks

* GREEN: isCountQuery() should return true for queries in text blocks

* RED: isSumQuery() should return true for sum query in java text block

* GREEN: isSumQuery() should return true for sum query in java text block

---------

Co-authored-by: Kushagra Thapar <kuthapar@microsoft.com>
(cherry picked from commit d3f381d)

* Fix flaky AddressRepositoryIT tests due to non-deterministic ordering and ambiguous IDs (#48071)

* Initial plan

* Fix flaky AddressRepositoryIT tests - order-sensitive assertions and ambiguous findById

Co-authored-by: kushagraThapar <14034156+kushagraThapar@users.noreply.github.com>

* Remove unused TEST_ADDRESS_TEMP variables from testFindAllByStreetNotNull and testCountByStreetNotNull

Co-authored-by: kushagraThapar <14034156+kushagraThapar@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: kushagraThapar <14034156+kushagraThapar@users.noreply.github.com>
Co-authored-by: Rujun Chen <rujche@microsoft.com>
(cherry picked from commit 6cf1688)

* Startup Bug Fixes (#48278)

* Startup Bug Fixes

* Update README.md

* Update AppConfigurationProperties.java

---------

Co-authored-by: Nishant Routray <nroutray@microsoft.com>

(cherry picked from commit 35d4a6c)

* Daylight saving time fix (#48363)

* Daylight saving time fix

* dst tests

* test updates

* Update RecurrenceEvaluator.java

* test update

* Update RecurrenceValidatorDSTTest.java

* copilot comments

* Apply suggestions from code review

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
(cherry picked from commit c57f2d2)

* update changelog

* update changelog

* update changelog

* fix

* sync eng/pipelines

* sync eng/common

---------

Co-authored-by: Copilot <198982749+copilot@users.noreply.github.com>
Co-authored-by: Matthew Metcalf <mrm9084@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Eldert Grootenboer <eldert@eldert.net>
Co-authored-by: Jason Bodnar <jason.bodnar@blackbaud.com>
Co-authored-by: Kushagra Thapar <kuthapar@microsoft.com>
Co-authored-by: kushagraThapar <14034156+kushagraThapar@users.noreply.github.com>
Co-authored-by: Rujun Chen <rujche@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

azure-spring All azure-spring related issues azure-spring-app-configuration Spring app configuration related issues.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants