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
90 changes: 90 additions & 0 deletions .github/instructions/update_release_notes.instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
---
applyTo: '**'
---

# Release Notes Update Instructions

## When to Update Release Notes

After completing a code change (bug fix, new feature, enhancement, or breaking change), always ask the user:

**"Would you like me to update the release notes in `docs/explanation/release_notes.md`?"**

## If the User Confirms Yes

Update the release notes file following these guidelines:

### 1. Location
Release notes are located at: `docs/explanation/release_notes.md`

### 2. Version Placement
- Add new entries under the **current version** from `config.py`
- If the version has changed, create a new version section at the TOP of the file
- Format: `### **(vX.XXX.XXX)**`

### 3. Entry Categories

Organize entries under the appropriate category:

#### New Features
```markdown
#### New Features

* **Feature Name**
* Brief description of what the feature does and its benefits.
* Additional details about functionality or configuration.
* (Ref: relevant files, components, or concepts)
```

#### Bug Fixes
```markdown
#### Bug Fixes

* **Fix Name**
* Description of what was broken and how it was fixed.
* Impact or affected areas.
* (Ref: relevant files, functions, or components)
```

#### User Interface Enhancements
```markdown
#### User Interface Enhancements

* **Enhancement Name**
* Description of UI/UX improvements.
* (Ref: relevant templates, CSS, or JavaScript files)
```

#### Breaking Changes
```markdown
#### Breaking Changes

* **Change Name**
* Description of what changed and why.
* **Migration**: Steps users need to take (if any).
```

### 4. Entry Format Guidelines

- **Bold the title** of each entry
- Use bullet points for details
- Include a `(Ref: ...)` line with relevant file names, functions, or concepts
- Keep descriptions concise but informative
- Focus on user-facing impact, not implementation details

### 5. Example Entry

```markdown
* **Custom Logo Display Fix**
* Fixed issue where custom logos uploaded via Admin Settings would only display on the admin page but not on other pages (chat, sidebar, landing page).
* Root cause was overly aggressive sanitization removing logo URLs from public settings.
* (Ref: logo display, settings sanitization, template conditionals)
```

### 6. Checklist Before Updating

- [ ] Confirm the current version in `config.py`
- [ ] Determine the correct category (New Feature, Bug Fix, Enhancement, Breaking Change)
- [ ] Write a clear, user-focused description
- [ ] Include relevant file/component references
- [ ] Place entry under the correct version section
Comment on lines +1 to +90
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The addition of release notes update instructions is unrelated to the logo display bug fix. While this may be a useful guideline for the project, it should be in a separate PR or the PR description should be updated to mention this is also adding project documentation guidelines. Mixing infrastructure/process changes with bug fixes makes PR review and change tracking more difficult.

Copilot uses AI. Check for mistakes.
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.237.001"
VERSION = "0.237.003"
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Version mismatch: The PR title and description indicate this is version "0.237.002", but the config.py file shows VERSION = "0.237.003". This creates confusion about which version this fix belongs to. Either the PR description should be updated to match v0.237.003, or the config.py version should be v0.237.002 to match the PR description and all documentation files.

Copilot uses AI. Check for mistakes.


SECRET_KEY = os.getenv('SECRET_KEY', 'dev-secret-key-change-in-production')
Expand Down
9 changes: 9 additions & 0 deletions application/single_app/functions_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,15 @@ def sanitize_settings_for_user(full_settings: dict) -> dict:
else:
sanitized[k] = v

# Add boolean flags for logo/favicon existence so templates can check without exposing base64 data
# These fields are stripped by the base64 filter above, but templates need to know if logos exist
if 'custom_logo_base64' in full_settings:
sanitized['custom_logo_base64'] = bool(full_settings.get('custom_logo_base64'))
if 'custom_logo_dark_base64' in full_settings:
sanitized['custom_logo_dark_base64'] = bool(full_settings.get('custom_logo_dark_base64'))
if 'custom_favicon_base64' in full_settings:
sanitized['custom_favicon_base64'] = bool(full_settings.get('custom_favicon_base64'))

return sanitized

def sanitize_settings_for_logging(full_settings: dict) -> dict:
Expand Down
Binary file modified application/single_app/static/images/custom_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified application/single_app/static/images/custom_logo_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified application/single_app/static/images/favicon.ico
Binary file not shown.
36 changes: 36 additions & 0 deletions application/single_app/templates/admin_settings.html

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions application/single_app/templates/control_center.html
Original file line number Diff line number Diff line change
Expand Up @@ -1670,8 +1670,14 @@ <h6 class="fw-bold"><i class="bi bi-hourglass-split me-2"></i>Retention Policy</
<option value="default">Using organization default</option>
<option value="none">No automatic deletion</option>
<option value="1">1 day</option>
<option value="2">2 days</option>
<option value="3">3 days</option>
<option value="4">4 days</option>
<option value="5">5 days</option>
<option value="6">6 days</option>
<option value="7">7 days (1 week)</option>
<option value="10">10 days</option>
<option value="14">14 days (2 weeks)</option>
<option value="21">21 days (3 weeks)</option>
<option value="30">30 days</option>
<option value="60">60 days</option>
Expand All @@ -1687,8 +1693,14 @@ <h6 class="fw-bold"><i class="bi bi-hourglass-split me-2"></i>Retention Policy</
<option value="default">Using organization default</option>
<option value="none">No automatic deletion</option>
<option value="1">1 day</option>
<option value="2">2 days</option>
<option value="3">3 days</option>
<option value="4">4 days</option>
<option value="5">5 days</option>
<option value="6">6 days</option>
<option value="7">7 days (1 week)</option>
<option value="10">10 days</option>
<option value="14">14 days (2 weeks)</option>
<option value="21">21 days (3 weeks)</option>
<option value="30">30 days</option>
<option value="60">60 days</option>
Expand Down Expand Up @@ -2287,8 +2299,14 @@ <h6 class="fw-bold"><i class="bi bi-hourglass-split me-2"></i>Retention Policy</
<option value="default">Using organization default</option>
<option value="none">No automatic deletion</option>
<option value="1">1 day</option>
<option value="2">2 days</option>
<option value="3">3 days</option>
<option value="4">4 days</option>
<option value="5">5 days</option>
<option value="6">6 days</option>
<option value="7">7 days (1 week)</option>
<option value="10">10 days</option>
<option value="14">14 days (2 weeks)</option>
<option value="21">21 days (3 weeks)</option>
<option value="30">30 days</option>
<option value="60">60 days</option>
Expand All @@ -2304,8 +2322,14 @@ <h6 class="fw-bold"><i class="bi bi-hourglass-split me-2"></i>Retention Policy</
<option value="default">Using organization default</option>
<option value="none">No automatic deletion</option>
<option value="1">1 day</option>
<option value="2">2 days</option>
<option value="3">3 days</option>
<option value="4">4 days</option>
<option value="5">5 days</option>
<option value="6">6 days</option>
<option value="7">7 days (1 week)</option>
<option value="10">10 days</option>
<option value="14">14 days (2 weeks)</option>
<option value="21">21 days (3 weeks)</option>
<option value="30">30 days</option>
<option value="60">60 days</option>
Expand Down
12 changes: 12 additions & 0 deletions application/single_app/templates/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,14 @@ <h5 class="mb-3"><i class="bi bi-hourglass-split me-2"></i>Retention Policy Sett
<option value="default">Using organization default</option>
<option value="none">No automatic deletion</option>
<option value="1">1 day</option>
<option value="2">2 days</option>
<option value="3">3 days</option>
<option value="4">4 days</option>
<option value="5">5 days</option>
<option value="6">6 days</option>
<option value="7">7 days (1 week)</option>
<option value="10">10 days</option>
<option value="14">14 days (2 weeks)</option>
Comment on lines +322 to +329
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The retention policy dropdown additions (values 2, 3, 4, 6, 7, and 14 days) are unrelated to the logo display bug fix described in the PR. These changes should be in a separate PR or the PR description should be updated to document this additional feature. Mixing unrelated changes in a single PR makes it harder to review, track, and potentially revert changes if needed.

Copilot uses AI. Check for mistakes.
<option value="21">21 days (3 weeks)</option>
<option value="30">30 days</option>
<option value="60">60 days</option>
Expand All @@ -338,8 +344,14 @@ <h5 class="mb-3"><i class="bi bi-hourglass-split me-2"></i>Retention Policy Sett
<option value="default">Using organization default</option>
<option value="none">No automatic deletion</option>
<option value="1">1 day</option>
<option value="2">2 days</option>
<option value="3">3 days</option>
<option value="4">4 days</option>
<option value="5">5 days</option>
<option value="6">6 days</option>
<option value="7">7 days (1 week)</option>
<option value="10">10 days</option>
<option value="14">14 days (2 weeks)</option>
<option value="21">21 days (3 weeks)</option>
<option value="30">30 days</option>
<option value="60">60 days</option>
Expand Down
102 changes: 102 additions & 0 deletions docs/explanation/fixes/v0.237.003/CUSTOM_LOGO_NOT_DISPLAYING_FIX.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Custom Logo Not Displaying Across App Fix

## Issue Description
When an admin uploaded a custom logo via Admin Settings, the logo would display correctly on the admin settings page but **not appear elsewhere in the application** (e.g., chat page, sidebar navigation).

### Symptoms
- Logo visible in Admin Settings preview
- Logo not appearing in sidebar navigation
- Logo not appearing on chat/chats pages
- Logo not appearing on index/landing page

## Root Cause Analysis
The issue was in the `sanitize_settings_for_user()` function in [functions_settings.py](../../application/single_app/functions_settings.py).

This function is designed to strip sensitive data before sending settings to the frontend. It filters out any keys containing terms like:
- `key`
- `secret`
- `password`
- `connection`
- **`base64`**
- `storage_account_url`

The logo settings are stored with keys:
- `custom_logo_base64`
- `custom_logo_dark_base64`
- `custom_favicon_base64`

Because these keys contain `base64`, they were being **completely removed** from the sanitized settings.

### Template Logic Impact
Templates check for custom logos using conditions like:
```jinja2
{% if app_settings.custom_logo_base64 %}
<img src="{{ url_for('static', filename='images/custom_logo.png') }}" />
{% else %}
<img src="{{ url_for('static', filename='images/logo-lightmode.png') }}" />
{% endif %}
```

When `custom_logo_base64` was stripped entirely, this condition always evaluated to `False`, causing the default logo to display instead of the custom uploaded logo.

## Solution
Modified `sanitize_settings_for_user()` to add boolean flags for logo/favicon existence **after** the main sanitization loop. This allows templates to check if logos exist without exposing the actual base64 data.

### Code Change
```python
def sanitize_settings_for_user(full_settings: dict) -> dict:
# ... existing sanitization logic ...

# Add boolean flags for logo/favicon existence so templates can check without exposing base64 data
# These fields are stripped by the base64 filter above, but templates need to know if logos exist
if 'custom_logo_base64' in full_settings:
sanitized['custom_logo_base64'] = bool(full_settings.get('custom_logo_base64'))
if 'custom_logo_dark_base64' in full_settings:
sanitized['custom_logo_dark_base64'] = bool(full_settings.get('custom_logo_dark_base64'))
if 'custom_favicon_base64' in full_settings:
sanitized['custom_favicon_base64'] = bool(full_settings.get('custom_favicon_base64'))

return sanitized
```

### How It Works
1. The sensitive base64 data is still stripped during the main loop
2. After sanitization, boolean flags are added:
- `True` if the logo exists (base64 string is non-empty)
- `False` if no logo is set (base64 string is empty)
3. Templates can still use `{% if app_settings.custom_logo_base64 %}` and it will correctly evaluate to `True` or `False`
4. The actual base64 data is never exposed to the frontend

## Files Modified
- [functions_settings.py](../../application/single_app/functions_settings.py) - Modified `sanitize_settings_for_user()` function

## Version
**Fixed in version:** 0.237.002

## Testing
A functional test was created: [test_custom_logo_sanitization_fix.py](../../functional_tests/test_custom_logo_sanitization_fix.py)

### Test Cases
1. **Logo flags preserved as True** - When logos exist, boolean flags are `True`
2. **Logo flags preserved as False** - When logos are empty, boolean flags are `False`
3. **No spurious flags added** - If logo keys don't exist in settings, they're not added
4. **Template compatibility** - Boolean flags work correctly in Jinja2-style conditionals

### Running the Test
```bash
cd functional_tests
python test_custom_logo_sanitization_fix.py
```

## Impact
This fix affects all pages that display the application logo:
- Landing/Index page
- Chat page
- Sidebar navigation (when left nav is enabled)
- Any other page using `base.html` that references logo settings

## Security Considerations
- ✅ Actual base64 data is still never exposed to the frontend
- ✅ Only boolean True/False values are sent
- ✅ No sensitive data leakage
- ✅ Maintains the security intent of the original sanitization function
22 changes: 22 additions & 0 deletions docs/explanation/release_notes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,28 @@
<!-- BEGIN release_notes.md BLOCK -->
# Feature Release

### **(v0.237.003)**

#### New Features

* **Extended Retention Policy Timeline Options**
* Added additional granular retention period options for conversations and documents across all workspace types.
* **New Options**: 2 days, 3 days, 4 days, 6 days, 7 days (1 week), and 14 days (2 weeks).
* **Full Option Set**: 1, 2, 3, 4, 5, 6, 7 (1 week), 10, 14 (2 weeks), 21 (3 weeks), 30, 60, 90 (3 months), 180 (6 months), 365 (1 year), 730 (2 years) days.
* **Scope**: Available in Admin Settings (organization defaults), Profile page (personal settings), and Control Center (group/public workspace management).
* **Files Modified**: `admin_settings.html`, `profile.html`, `control_center.html`.
* (Ref: retention policy configuration, workspace retention settings, granular time periods)

#### Bug Fixes

* **Custom Logo Not Displaying Across App Fix**
* Fixed issue where custom logos uploaded via Admin Settings would only display on the admin page but not on other pages (chat, sidebar, landing page).
* **Root Cause**: The `sanitize_settings_for_user()` function was stripping `custom_logo_base64`, `custom_logo_dark_base64`, and `custom_favicon_base64` keys entirely because they contained "base64" (a sensitive term filter), preventing templates from detecting logo existence.
* **Solution**: Modified sanitization to add boolean flags for logo/favicon existence after filtering, allowing templates to check if logos exist without exposing actual base64 data.
* **Security**: Actual base64 data remains hidden from frontend; only True/False boolean values are exposed.
* **Files Modified**: `functions_settings.py` (`sanitize_settings_for_user()` function).
* (Ref: logo display, settings sanitization, template conditionals)

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

#### New Features
Expand Down
Loading