Skip to content

Conversation

@paullizer
Copy link
Contributor

(v0.235.025)

Bug Fixes

  • Retention Policy Document Deletion Fix

    • Fixed critical bug where retention policy execution failed when attempting to delete aged documents, while conversation deletion worked correctly.
    • Root Cause 1: Documents use last_updated field, but query was looking for last_activity_at (used by conversations).
    • Root Cause 2: Date format mismatch - documents store YYYY-MM-DDTHH:MM:SSZ but query used Python's .isoformat() with +00:00 suffix.
    • Root Cause 3: Duplicate column in SELECT clause when partition_field='user_id' caused query errors.
    • Root Cause 4: Activity logging called with incorrect deletion_reason parameter instead of additional_context.
    • Files Modified: functions_retention_policy.py (query field names, date format, SELECT clause, activity logging).
    • (Ref: delete_aged_documents(), retention policy execution, Cosmos DB queries)
  • Retention Policy Scheduler Fix

    • Fixed automated retention policy scheduler not executing at the scheduled time.
    • Root Cause 1: Hour-matching approach was unreliable - only ran if check happened exactly during the execution hour (e.g., 2 AM), but 1-hour sleep intervals could miss the entire window.
    • Root Cause 2: Check interval too long (1 hour) meant poor responsiveness and high probability of missing scheduled time.
    • Root Cause 3: Code ignored the stored retention_policy_next_run timestamp, instead relying solely on hour matching.
    • Solution: Now uses retention_policy_next_run timestamp for comparison, reduced check interval from 1 hour to 5 minutes, added fallback logic for missed executions.
    • Files Modified: app.py (check_retention_policy() background task).
    • (Ref: retention policy scheduler, background task, scheduled execution)

paullizer and others added 30 commits September 22, 2025 20:20
* Development (#467)

* upgrade to v0.229.060 (#459)

* Update release notes to show support for GPT-5

* Documented support for gpt-image-1

* Update config.py

* remove documentation folder

* Documentation and message table support (#444)

* Develop demo docs and import markdown table support

* fixed enhanced citations for groups and public workspaces

* Updated to support showing public workspaces in scope

* Update config.py

* fix docs

* Updated RELEASE_NOTES

* docs demos for public workspaces

* V0.229 bug fixes (v0.229.019) (#448)

* Development (#445)

* Update release notes to show support for GPT-5

* Documented support for gpt-image-1

* Update config.py

* remove documentation folder

* Documentation and message table support (#444)

* Develop demo docs and import markdown table support

* fixed enhanced citations for groups and public workspaces

* Updated to support showing public workspaces in scope

* Update config.py

* fix docs

* Updated RELEASE_NOTES

* video indexer config details, doc intel test button fix, move multimedia configs to search and extract

* improved header security

* updated versions

* moved

* Update EXTERNAL_HEALTH_CHECK_DUPLICATION_FIX.md

* added pdfs

* v0.229.019 bug fixes upgrade to v0.229.058 (#452)

* all urls in chat open in new tabs

* consolidated admin settings for improved navigation

* added left hand nav admin settings menus

* added left hand menu options for workspaces

* Added debug logging to video indexer processes

* readme and functional test

* Workspace Scope in Chat affects Prompts

* Create WORKSPACE_SCOPE_PROMPTS_FIX.md

* time based turn off for debug and file process logging

* improve saving in admin settings

* update to v0.229.058

* Update RELEASE_NOTES.md

* Update RELEASE_NOTES.md

* Popup modal for Health Check config

* Added Health Check config guide

* Chat page top nav bug (#458)

* initial fix

* fixed top nav chat up bug

* notes for v0.229.060

* file location fix

* Update config.py

* Update RELEASE_NOTES.md

* moved to correct location

* Fixed enhanced citations CSP bug

Simple Chat implemented improved security which negatively impacted enhanced citations.

* Updated release notes

* updated version and tests

* swagger support for all endpoints and added swagger search

* added wide screen support for chats when collapsing side bar

* v0.230.001 features
Updated else if for AUTHORITY
* setup folders and base files

* setting up files

* architecture diagrams

* updated to libdoc

* libdoc updates

* updating side bar

* removed loops

* editing side bar

* Created Simple Chat Jekyll theme

* Update config.py (#477) (#478)

Updated else if for AUTHORITY

Co-authored-by: Patrick C Davis <82388365+Patrick-Davis-MSFT@users.noreply.github.com>

* Updating architectures

* Update README.md

---------

Co-authored-by: Patrick C Davis <82388365+Patrick-Davis-MSFT@users.noreply.github.com>
paullizer and others added 22 commits January 13, 2026 14:28
…l, group member role update, and approve/reject request
* retention execution logging bug fix

* debug timer reset with admin save bug fix

* Create test_debug_logging_timer_preservation.py

* fixed file processing logic prevent runtime execution

* fixed bug processing execution against personal documents

* removed test logging

* Retention Policy Document Deletion Fix

* Improve execution logic for rentention policy

Now uses retention_policy_next_run timestamp - Compares current time against the stored next scheduled time. If current time >= next scheduled time, it runs.

Reduced check interval from 1 hour to 5 minutes - More responsive scheduling, ensures it catches the scheduled time promptly.

Better fallback logic - If next_run can't be parsed, falls back to checking last_run (23-hour threshold).

Runs immediately if never run before - If there's no last_run or next_run, it will execute on the first check.
@paullizer
Copy link
Contributor Author

paullizer commented Jan 17, 2026

Testing out the Dev > Staging > Main workflow

Its missing checks and deploy code but I wanted to set up the flow, then work on what we want to add to staging.

else:
print(f"Retention policy execution failed: {results.get('errors')}")

except Exception as e:
Copy link
Collaborator

Choose a reason for hiding this comment

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

log_event

Comment on lines +40 to 41
log_event("get_all_user_settings_error", {"error": str(e)})
debug_print(f"Error fetching all user settings: {e}")
Copy link
Collaborator

Choose a reason for hiding this comment

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

If you are not taking advantage of any of the category or kwargs from debug print, no reason to use both. log_event has a basic built in [DEBUG] print is debugging is enabled. While we cannot use debug_print in log_event because of cyclical import issues, we could always enhance that to leverage the "extra" (custom dimensions) of log_event and output those like we do the kwargs in debug_print.

workspace_deletion_summary['conversation_details'] = conv_results['details']
results['conversations'] += conv_results['count']
except Exception as e:
log_event("process_public_retention_conversations_error", {"error": str(e), "public_workspace_id": workspace_id})
Copy link
Collaborator

Choose a reason for hiding this comment

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

Might be easier to locate these in appinsights/log analytics by setting the level to logging.error. We would probably need to import the logging lib though. It also accepts the corresponding int as well (I believe error is 40).

Bionic711
Bionic711 previously approved these changes Jan 18, 2026
Copy link
Collaborator

@Bionic711 Bionic711 left a comment

Choose a reason for hiding this comment

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

@paullizer Review the couple of comments and we are good to go.

Bug fix - fixed group member management errors with selecting new users, removing them, and updating the roles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants