Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion application/single_app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
95 changes: 95 additions & 0 deletions docs/explanation/fixes/v0.237.001/RETENTION_POLICY_NOTFOUND_FIX.md
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/explanation/release_notes.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- BEGIN release_notes.md BLOCK -->
# Feature Release

### **(v0.236.011)**
### **(v0.237.001)**

#### New Features

Expand Down
Loading