mirror of
https://github.com/AJaySi/ALwrity.git
synced 2026-04-25 00:45:54 +03:00
[PR #344] [MERGED] Fix UnifiedOAuthToken metadata property, import timedelta, and add model tests #310
Labels
No labels
AI Content Agents
AI Content Strategy
AI Content planning
AI Marketing Tools
AI SEO
AI personalization
AI writer
ALwrity Copi-lot
Alwrity web search
Anthropic
DeepSeek
Gemini AI
Integration
LLM
OnBoarding
OnBoarding
RAG knowledgebase Memory
bug
documentation
enhancement
good first issue
help wanted
invalid
openai
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ALwrity#310
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/AJaySi/ALwrity/pull/344
Author: @AJaySi
Created: 2/11/2026
Status: ✅ Merged
Merged: 2/11/2026
Merged by: @AJaySi
Base:
main← Head:codex/repair-model-level-defects-for-production📝 Commits (1)
c9b906eFix unified oauth token metadata and expiry handling📊 Changes
2 files changed (+84 additions, -9 deletions)
View changed files
📝
backend/models/unified_oauth_tokens.py(+8 -9)➕
backend/tests/models/test_unified_oauth_tokens.py(+76 -0)📄 Description
Motivation
UnifiedOAuthTokenaround time calculations and a reservedmetadataproperty to avoid runtime errors in production.Description
timedeltafromdatetimeand initialized a module-levellogurulogger viafrom loguru import loggerinbackend/models/unified_oauth_tokens.pyto supportneeds_refreshcomputations and logging.metadatatotoken_metadatawhile keeping the backing columnmetadata_jsonand implemented JSON serialization/deserialization in the new getter/setter.token_metadata(including thedetailsblock into_connection_status) and removed a duplicate local import oflogger.backend/tests/models/test_unified_oauth_tokens.pyvalidatingis_expired,needs_refresh, metadata serialization round-trip, and graceful handling of invalid JSON.Testing
pytest -q backend/tests/models/test_unified_oauth_tokens.py, which completed with6 passedand warnings; all tests passed.Codex Task
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.