[Bug] `on_refresh_success` is not called after the last matching feature flag is deleted
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 52/100
Hướng nghiên cứu
Start with the AzureAppConfigurationProvider.refresh() flow and the load() configuration shown in the report, then review related issue #49108 first. Reproduce the two-deletion sequence with feature_flag_refresh_enabled and on_refresh_success enabled. Done means the callback is invoked after the final matching feature flag is deleted without leaving stale provider state.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
- Package Name: azure-appconfiguration-provider
- Package Version: 2.5.0, 2.5.1
- Operating System: macOS
- Python Version: 3.14
Describe the bug
When feature flag refresh is enabled, AzureAppConfigurationProvider.refresh() does not invoke on_refresh_success after the last feature flag matching the configured selector is deleted from Azure.
To Reproduce
Steps to reproduce the behavior:
- Create two feature flags:
test_1andtest_2. - Load configuration with
feature_flag_enabled=True,feature_flag_refresh_enabled=Trueandon_refresh_success=callbackset. - Delete
test_1. - Wait for the refresh interval and call
refresh(). - Verify the callback is invoked.
- Delete the remaining
test_2. - Wait again and call
refresh(). - Observe that the callback is not invoked.
Actual behavior
- Deleting
test_1: refresh detects the change and calls the callback. - Deleting the last flag
test_2: refresh does not call the callback.
Expected behavior
refresh() should invoke on_refresh_success after the last matching feature flag is deleted.
Screenshots
Additional context
from azure.appconfiguration.provider import load
from azure.appconfiguration.provider._models import SettingSelector
CONNECTION_STRING = "..."
REFRESH_INTERVAL = 5
def callback():
print("callback called")
config = load(
connection_string=CONNECTION_STRING,
feature_flag_enabled=True,
feature_flag_refresh_enabled=True,
feature_flag_selectors=[SettingSelector(key_filter="*", label_filter="my_custom_label")],
on_refresh_success=callback,
refresh_interval=REFRESH_INTERVAL,
)
print(config["feature_management"]["feature_flags"])
# [
# {'conditions': {'client_filters': []},
# 'description': None,
# 'display_name': None,
# 'enabled': False,
# 'id': 'test_1',
# 'telemetry': {'metadata': {'ETag': 'hgRX_0yhNXOSl1vtyakBlTrNeEmL2GIBoxnnsw5gsmA'}}},
# {'conditions': {'client_filters': []},
# 'description': None,
# 'display_name': None,
# 'enabled': False,
# 'id': 'test_2',
# 'telemetry': {'metadata': {'ETag': 'uIOfSyJmWUw2XL5_AQf9eX0RS-MILlR6Xev59r_fdao'}}}
# ]
# Delete the "test_1" feature flag from Azure. After REFRESH_INTERVAL has elapsed, call refresh().
config.refresh()
# Expected and actual:
# The callback is called and "callback called" is printed.
# Delete the last remaining feature flag, "test_2", from Azure. After REFRESH_INTERVAL has elapsed, call refresh().
config.refresh()
# Expected:
# The callback is called and "callback called" is printed.
# Actual:
# The callback is not called and "callback called" is not printed.
This issue is related to #49108 .
I think #49108 should be fixed first. Calling the refresh callback after the last feature flag is deleted is not very useful while the provider itself still keeps the stale feature flag in its state.
- Ngôn ngữ chính
- Python
- Star
- 5.6k
- Fork
- 3.4k
- Merge trung bình
- 2 ngày 7 giờ
- Pull request đã merge (30 ngày)
- 181
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Azure/azure-sdk-for-python
-
[Teams Chatbot]: Clarify Python dev-feed publication from a branch versus PyPI releaseCó thể đã có người làm @jianingwang123 đã nhận 11 ngày trước. Đang mởcustomer-reported question
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Azure/azure-sdk-for-python#49548 · 1 bình luận · 2 reaction · 2 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Client customer-reported Hosted Agents needs-team-attention question Service Attention
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Azure/azure-sdk-for-python#49477 · 6 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
azure-ai-evaluation: a content-harm score of 0 (no harm) is parsed as NaN in _parse_content_harm_response (numeric branch uses 0 < x instead of 0 <= x)Có thể đã có người làm @pujitha24 đã nhận 27 ngày trước. Đang mởEvaluation Service Attention
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Azure/azure-sdk-for-python#49190 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Update CODEOWNERSĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
Azure/azure-sdk-for-python#49183 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
azure-ai-evaluation: PromptyEvaluatorBase falls back to the first digit anywhere in the judge's reply, and the threshold turns a stray digit into a wrong pass/fail (15 evaluators)Có thể đã có người làm @wasim-builds đã nhận 21 ngày trước. Đang mởEvaluation Service Attention
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Azure/azure-sdk-for-python#49153 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Azure/azure-sdk-for-python
Issue tương tự
-
README.zh-CN/ja/es still hard-code 501 test counts after README.md went count-freeCó thể đã có người làm @Aaqibhafeezkhan đã nhận hôm nay. Đang mởbeginner documentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
BistaDinesh03/critique#164 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug IO
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
MrNeRF/LichtFeld-Studio#3824 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug confirmed issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
open-webui/open-webui#33200 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Lychee link check failedĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
-
The changelog workflow excludes otelbot but not dependabot, so every Dependabot pull request fails the changelog checkCó thể đã có người làm @ocelotl đã nhận hôm nay. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
open-telemetry/opentelemetry-python#5825 ·
Maintainer thường phản hồi trong vòng 2 ngày