diff --git a/application/single_app/config.py b/application/single_app/config.py index caf09fc8..12906ce8 100644 --- a/application/single_app/config.py +++ b/application/single_app/config.py @@ -88,7 +88,7 @@ EXECUTOR_TYPE = 'thread' EXECUTOR_MAX_WORKERS = 30 SESSION_TYPE = 'filesystem' -VERSION = "0.236.012" +VERSION = "0.237.001" SECRET_KEY = os.getenv('SECRET_KEY', 'dev-secret-key-change-in-production') diff --git a/docs/explanation/features/v0.236.011/CONTROL_CENTER_APPLICATION_ROLES.md b/docs/explanation/features/v0.237.001/CONTROL_CENTER_APPLICATION_ROLES.md similarity index 99% rename from docs/explanation/features/v0.236.011/CONTROL_CENTER_APPLICATION_ROLES.md rename to docs/explanation/features/v0.237.001/CONTROL_CENTER_APPLICATION_ROLES.md index 29ffc1fc..3d61f752 100644 --- a/docs/explanation/features/v0.236.011/CONTROL_CENTER_APPLICATION_ROLES.md +++ b/docs/explanation/features/v0.237.001/CONTROL_CENTER_APPLICATION_ROLES.md @@ -4,7 +4,7 @@ Added two new application roles for finer-grained access control to the Control Center, enabling organizations to delegate administrative functions while maintaining security boundaries. -**Version Implemented:** 0.236.011 +**Version Implemented:** v0.237.001 ## New Roles diff --git a/docs/explanation/features/v0.236.011/CONVERSATION_DEEP_LINKING.md b/docs/explanation/features/v0.237.001/CONVERSATION_DEEP_LINKING.md similarity index 99% rename from docs/explanation/features/v0.236.011/CONVERSATION_DEEP_LINKING.md rename to docs/explanation/features/v0.237.001/CONVERSATION_DEEP_LINKING.md index d3c6e53e..cebf392b 100644 --- a/docs/explanation/features/v0.236.011/CONVERSATION_DEEP_LINKING.md +++ b/docs/explanation/features/v0.237.001/CONVERSATION_DEEP_LINKING.md @@ -4,7 +4,7 @@ SimpleChat now supports conversation deep linking through URL query parameters. Users can share direct links to specific conversations, and the application will automatically navigate to and load the referenced conversation when the link is accessed. -**Version Implemented:** 0.236.011 +**Version Implemented:** v0.237.001 ## Key Features diff --git a/docs/explanation/features/v0.236.011/PLUGIN_AUTH_TYPE_CONSTRAINTS.md b/docs/explanation/features/v0.237.001/PLUGIN_AUTH_TYPE_CONSTRAINTS.md similarity index 99% rename from docs/explanation/features/v0.236.011/PLUGIN_AUTH_TYPE_CONSTRAINTS.md rename to docs/explanation/features/v0.237.001/PLUGIN_AUTH_TYPE_CONSTRAINTS.md index 093923c6..9d2ea6e6 100644 --- a/docs/explanation/features/v0.236.011/PLUGIN_AUTH_TYPE_CONSTRAINTS.md +++ b/docs/explanation/features/v0.237.001/PLUGIN_AUTH_TYPE_CONSTRAINTS.md @@ -4,7 +4,7 @@ SimpleChat now enforces authentication type constraints per plugin type. Different plugin types may support different authentication methods based on their requirements and the APIs they integrate with. This feature provides a structured way to define and retrieve allowed authentication types for each plugin type. -**Version Implemented:** 0.236.011 +**Version Implemented:** v0.237.001 ## Key Features diff --git a/docs/explanation/features/v0.236.011/PRIVATE_NETWORKING_SUPPORT.md b/docs/explanation/features/v0.237.001/PRIVATE_NETWORKING_SUPPORT.md similarity index 99% rename from docs/explanation/features/v0.236.011/PRIVATE_NETWORKING_SUPPORT.md rename to docs/explanation/features/v0.237.001/PRIVATE_NETWORKING_SUPPORT.md index de2ae92f..5379b73d 100644 --- a/docs/explanation/features/v0.236.011/PRIVATE_NETWORKING_SUPPORT.md +++ b/docs/explanation/features/v0.237.001/PRIVATE_NETWORKING_SUPPORT.md @@ -4,7 +4,7 @@ Comprehensive private networking support for SimpleChat deployments via Azure Developer CLI (AZD) and Bicep infrastructure-as-code. This feature enables secure, isolated deployments with private endpoints, virtual networks, and private DNS zones. -**Version Implemented:** 0.236.011 +**Version Implemented:** v0.237.001 ## Key Features diff --git a/docs/explanation/features/v0.236.011/RETENTION_POLICY_DEFAULTS.md b/docs/explanation/features/v0.237.001/RETENTION_POLICY_DEFAULTS.md similarity index 99% rename from docs/explanation/features/v0.236.011/RETENTION_POLICY_DEFAULTS.md rename to docs/explanation/features/v0.237.001/RETENTION_POLICY_DEFAULTS.md index e3fe426d..cdca4ce5 100644 --- a/docs/explanation/features/v0.236.011/RETENTION_POLICY_DEFAULTS.md +++ b/docs/explanation/features/v0.237.001/RETENTION_POLICY_DEFAULTS.md @@ -1,8 +1,7 @@ # RETENTION_POLICY_DEFAULTS.md **Feature**: Admin-Configurable Default Retention Policies -**Version**: 0.236.011 -**Implemented in**: 0.236.011 +**Version**: v0.237.001 ## Overview and Purpose diff --git a/docs/explanation/features/v0.236.011/USER_AGREEMENT.md b/docs/explanation/features/v0.237.001/USER_AGREEMENT.md similarity index 99% rename from docs/explanation/features/v0.236.011/USER_AGREEMENT.md rename to docs/explanation/features/v0.237.001/USER_AGREEMENT.md index e87589d7..d72d6533 100644 --- a/docs/explanation/features/v0.236.011/USER_AGREEMENT.md +++ b/docs/explanation/features/v0.237.001/USER_AGREEMENT.md @@ -4,7 +4,7 @@ The User Agreement feature allows administrators to configure a global agreement that users must accept before uploading files to workspaces. This provides organizations with a mechanism to ensure users acknowledge terms, policies, or guidelines before contributing documents to the system. -**Version Implemented:** 0.236.011 +**Version Implemented:** v0.237.001 ## Key Features diff --git a/docs/explanation/features/v0.236.011/WEB_SEARCH_AZURE_AI_FOUNDRY.md b/docs/explanation/features/v0.237.001/WEB_SEARCH_AZURE_AI_FOUNDRY.md similarity index 99% rename from docs/explanation/features/v0.236.011/WEB_SEARCH_AZURE_AI_FOUNDRY.md rename to docs/explanation/features/v0.237.001/WEB_SEARCH_AZURE_AI_FOUNDRY.md index 7107017f..2e8e3b7c 100644 --- a/docs/explanation/features/v0.236.011/WEB_SEARCH_AZURE_AI_FOUNDRY.md +++ b/docs/explanation/features/v0.237.001/WEB_SEARCH_AZURE_AI_FOUNDRY.md @@ -4,7 +4,7 @@ SimpleChat now supports web search capability through Azure AI Foundry agents using the Grounding with Bing Search service. This feature enables AI responses to be augmented with real-time web search results, providing users with up-to-date information beyond the model's training data. -**Version Implemented:** 0.236.011 +**Version Implemented:** v0.237.001 ## Key Features diff --git a/docs/explanation/fixes/v0.236.011/AGENT_PAYLOAD_FIELD_LENGTHS_FIX.md b/docs/explanation/fixes/v0.237.001/AGENT_PAYLOAD_FIELD_LENGTHS_FIX.md similarity index 95% rename from docs/explanation/fixes/v0.236.011/AGENT_PAYLOAD_FIELD_LENGTHS_FIX.md rename to docs/explanation/fixes/v0.237.001/AGENT_PAYLOAD_FIELD_LENGTHS_FIX.md index e7f38582..e3119d5c 100644 --- a/docs/explanation/fixes/v0.236.011/AGENT_PAYLOAD_FIELD_LENGTHS_FIX.md +++ b/docs/explanation/fixes/v0.237.001/AGENT_PAYLOAD_FIELD_LENGTHS_FIX.md @@ -1,4 +1,4 @@ -# Agent Payload Field Lengths Fix (Version 0.237.009) +# Agent Payload Field Lengths Fix (Version v0.237.001) ## Header Information - **Fix Title:** Agent payload field length validation diff --git a/docs/explanation/fixes/v0.236.011/AGENT_TEMPLATE_MAX_LENGTHS_FIX.md b/docs/explanation/fixes/v0.237.001/AGENT_TEMPLATE_MAX_LENGTHS_FIX.md similarity index 95% rename from docs/explanation/fixes/v0.236.011/AGENT_TEMPLATE_MAX_LENGTHS_FIX.md rename to docs/explanation/fixes/v0.237.001/AGENT_TEMPLATE_MAX_LENGTHS_FIX.md index 71e1f0de..7748a093 100644 --- a/docs/explanation/fixes/v0.236.011/AGENT_TEMPLATE_MAX_LENGTHS_FIX.md +++ b/docs/explanation/fixes/v0.237.001/AGENT_TEMPLATE_MAX_LENGTHS_FIX.md @@ -1,4 +1,4 @@ -# Agent Template Max Lengths Fix (Version 0.237.010) +# Agent Template Max Lengths Fix (v0.237.001) ## Header Information - **Fix Title:** Agent template max length validation diff --git a/docs/explanation/fixes/v0.236.011/CONTROL_CENTER_DATE_LABELS_FIX.md b/docs/explanation/fixes/v0.237.001/CONTROL_CENTER_DATE_LABELS_FIX.md similarity index 96% rename from docs/explanation/fixes/v0.236.011/CONTROL_CENTER_DATE_LABELS_FIX.md rename to docs/explanation/fixes/v0.237.001/CONTROL_CENTER_DATE_LABELS_FIX.md index a7d1bf34..1add8e46 100644 --- a/docs/explanation/fixes/v0.236.011/CONTROL_CENTER_DATE_LABELS_FIX.md +++ b/docs/explanation/fixes/v0.237.001/CONTROL_CENTER_DATE_LABELS_FIX.md @@ -1,4 +1,4 @@ -# Control Center Date Labels Fix (Version 0.235.074) +# Control Center Date Labels Fix (v0.237.001) ## Header Information - **Fix Title:** Control Center Date Labels Fix diff --git a/docs/explanation/fixes/v0.237.001/RETENTION_POLICY_NOTFOUND_FIX.md b/docs/explanation/fixes/v0.237.001/RETENTION_POLICY_NOTFOUND_FIX.md new file mode 100644 index 00000000..e264920f --- /dev/null +++ b/docs/explanation/fixes/v0.237.001/RETENTION_POLICY_NOTFOUND_FIX.md @@ -0,0 +1,95 @@ +# Retention Policy NotFound Error Fix + +## Issue Description + +The retention policy deletion process was logging errors when attempting to delete conversations or documents that had already been deleted (e.g., by another process or user action between the query and delete operations). + +### Error Observed +``` +DEBUG: [Log] delete_aged_conversations_deletion_error -- {'error': '(NotFound) Entity with the specified id does not exist in the system. +``` + +### Root Cause + +This is a **race condition** scenario where: +1. The retention policy queries for aged conversations/documents +2. Between the query and the delete operation, the item is deleted by another process (user action, concurrent retention execution, etc.) +3. The delete operation fails with `CosmosResourceNotFoundError` (404 NotFound) + +## Fix Applied + +**Version:v0.237.001** + +The fix adds specific handling for `CosmosResourceNotFoundError` in both conversation and document deletion loops: + +### Conversations +- When reading a conversation before archiving: If not found, log debug message and count as already deleted +- When deleting messages: Catch NotFound and continue (message already gone) +- When deleting conversation: Catch NotFound and continue (conversation already gone) + +### Documents +- When deleting document chunks: Catch NotFound and continue +- When deleting document: Catch NotFound and continue +- Outer try/catch also handles NotFound to count as successful deletion + +## Files Modified + +- [functions_retention_policy.py](../../../application/single_app/functions_retention_policy.py) + - `delete_aged_conversations()` - Added CosmosResourceNotFoundError handling + - `delete_aged_documents()` - Added CosmosResourceNotFoundError handling + +## Technical Details + +### Before Fix +```python +# Read would throw exception if item was deleted between query and read +conversation_item = container.read_item( + item=conversation_id, + partition_key=conversation_id +) +# Delete would throw exception if item was deleted +container.delete_item( + item=conversation_id, + partition_key=conversation_id +) +``` + +### After Fix +```python +try: + conversation_item = container.read_item( + item=conversation_id, + partition_key=conversation_id + ) +except CosmosResourceNotFoundError: + # Already deleted - this is fine, count as success + debug_print(f"Conversation {conversation_id} already deleted (not found during read), skipping") + deleted_details.append({...}) + continue + +# ... archiving and message deletion ... + +try: + container.delete_item( + item=conversation_id, + partition_key=conversation_id + ) +except CosmosResourceNotFoundError: + # Already deleted between read and delete - this is fine + debug_print(f"Conversation {conversation_id} already deleted (not found during delete)") +``` + +## Benefits + +1. **No false error logs**: Items that are already deleted no longer generate error entries +2. **Accurate counts**: Already-deleted items are properly counted as successful deletions +3. **Graceful handling**: Race conditions are handled without disrupting the overall retention process +4. **Better debugging**: Debug messages clearly indicate when items were already deleted + +## Testing + +Test by: +1. Enabling retention policy with a short retention period +2. Running the retention policy execution +3. Verify no NotFound errors are logged +4. Verify deletion counts accurately reflect processed items diff --git a/docs/explanation/fixes/v0.236.011/SOVEREIGN_CLOUD_COGNITIVE_SERVICES_SCOPE_FIX.md b/docs/explanation/fixes/v0.237.001/SOVEREIGN_CLOUD_COGNITIVE_SERVICES_SCOPE_FIX.md similarity index 98% rename from docs/explanation/fixes/v0.236.011/SOVEREIGN_CLOUD_COGNITIVE_SERVICES_SCOPE_FIX.md rename to docs/explanation/fixes/v0.237.001/SOVEREIGN_CLOUD_COGNITIVE_SERVICES_SCOPE_FIX.md index f76993ba..4316dfcb 100644 --- a/docs/explanation/fixes/v0.236.011/SOVEREIGN_CLOUD_COGNITIVE_SERVICES_SCOPE_FIX.md +++ b/docs/explanation/fixes/v0.237.001/SOVEREIGN_CLOUD_COGNITIVE_SERVICES_SCOPE_FIX.md @@ -4,7 +4,7 @@ Fixed hardcoded commercial Azure cognitive services scope references in chat streaming and Smart HTTP Plugin that prevented proper authentication in Azure Government (MAG) and custom cloud environments. -**Version Implemented:** 0.236.011 +**Version Implemented:** v0.237.001 **Related Issue:** [#616](https://github.com/microsoft/simplechat/issues/616#issue-3835164022) diff --git a/docs/explanation/fixes/v0.236.011/USER_SEARCH_TOAST_INLINE_MESSAGES_FIX.md b/docs/explanation/fixes/v0.237.001/USER_SEARCH_TOAST_INLINE_MESSAGES_FIX.md similarity index 98% rename from docs/explanation/fixes/v0.236.011/USER_SEARCH_TOAST_INLINE_MESSAGES_FIX.md rename to docs/explanation/fixes/v0.237.001/USER_SEARCH_TOAST_INLINE_MESSAGES_FIX.md index f93a7871..7ba7ed08 100644 --- a/docs/explanation/fixes/v0.236.011/USER_SEARCH_TOAST_INLINE_MESSAGES_FIX.md +++ b/docs/explanation/fixes/v0.237.001/USER_SEARCH_TOAST_INLINE_MESSAGES_FIX.md @@ -4,7 +4,7 @@ Updated the `searchUsers()` function to use inline and toast messages instead of browser alert pop-ups, improving user experience and aligning with modern UI patterns. -**Version Implemented:** 0.236.011 +**Version Implemented:** v0.237.001 **Related PR:** [#608](https://github.com/microsoft/simplechat/pull/608#discussion_r2701900020) diff --git a/docs/explanation/fixes/v0.236.011/WEB_SEARCH_FAILURE_GRACEFUL_HANDLING_FIX.md b/docs/explanation/fixes/v0.237.001/WEB_SEARCH_FAILURE_GRACEFUL_HANDLING_FIX.md similarity index 99% rename from docs/explanation/fixes/v0.236.011/WEB_SEARCH_FAILURE_GRACEFUL_HANDLING_FIX.md rename to docs/explanation/fixes/v0.237.001/WEB_SEARCH_FAILURE_GRACEFUL_HANDLING_FIX.md index 233324c9..ad18d356 100644 --- a/docs/explanation/fixes/v0.236.011/WEB_SEARCH_FAILURE_GRACEFUL_HANDLING_FIX.md +++ b/docs/explanation/fixes/v0.237.001/WEB_SEARCH_FAILURE_GRACEFUL_HANDLING_FIX.md @@ -4,7 +4,7 @@ Fixed an issue where Azure AI Foundry web search agent failures would cause the AI model to answer questions using outdated training data instead of informing the user that the web search failed. -**Version Implemented:** 0.236.014 +**Version Implemented:** v0.237.001 ## Problem diff --git a/docs/explanation/release_notes.md b/docs/explanation/release_notes.md index 2d1e0e94..df88ebcd 100644 --- a/docs/explanation/release_notes.md +++ b/docs/explanation/release_notes.md @@ -1,7 +1,7 @@ # Feature Release -### **(v0.236.011)** +### **(v0.237.001)** #### New Features