[PR #334] [MERGED] Implement typo cleanup, calendar retrieval bug fix, and stronger polling tests #639

Closed
opened 2026-03-13 21:01:18 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/AJaySi/ALwrity/pull/334
Author: @AJaySi
Created: 2/10/2026
Status: Merged
Merged: 2/11/2026
Merged by: @AJaySi

Base: mainHead: codex/fix-typo-in-codebase


📝 Commits (1)

  • 30655a9 Implement calendar event retrieval fixes and strengthen polling tests

📊 Changes

16 files changed (+158 additions, -570 deletions)

View changed files

📝 backend/api/content_planning/services/calendar_service.py (+1 -2)
📝 backend/services/content_planning_db.py (+9 -1)
📝 backend/services/content_planning_service.py (+1 -2)
docs/CODEBASE_ISSUE_TASKS.md (+67 -0)
📝 docs/Content Calendar/ALWRITY_CONTENT_CALENDAR_COMPREHENSIVE_GUIDE.md (+0 -0)
📝 docs/Content Calendar/ALWRITY_CONTENT_PLANNING_COMPREHENSIVE_GUIDE.md (+0 -0)
📝 docs/Content Calendar/calendar_data_transparency_end_user.md (+0 -0)
📝 docs/Content Calendar/calendar_generation_prompt_chaining_architecture.md (+0 -0)
📝 docs/Content Calendar/calendar_generation_transparency_modal_implementation_plan.md (+0 -0)
📝 docs/Content Calendar/calendar_generator_refactoring_summary.md (+0 -0)
📝 docs/Content Calendar/calendar_wizard_strategy_integration_implementation_plan.md (+0 -0)
📝 docs/Content Calendar/calendar_wizard_transparency_implementation_plan.md (+0 -0)
📝 docs/Content Calendar/content_calendar_quality_gates.md (+0 -0)
📝 docs/Content Calendar/expected_calendar_output_structure.md (+0 -0)
docs/Content Calender/calendar_generation_transparency_modal_implementation_plan copy.md (+0 -520)
📝 frontend/src/components/BlogWriter/__tests__/PollingIntegration.test.tsx (+80 -45)

📄 Description

Motivation

  • Fix a backend defect where unfiltered calendar retrieval returned an empty list instead of persisted events and align implementation with the existing docstring.
  • Remove a documented typo and an accidental duplicate planning file in the documentation to keep docs consistent and searchable.
  • Improve a weak/flaky frontend polling test so it asserts deterministic, meaningful behaviors and prevents regressions.

Description

  • Added ContentPlanningDBService.get_all_calendar_events() and wired both API and service layers to call it when strategy_id is not provided (backend/services/content_planning_db.py, backend/api/content_planning/services/calendar_service.py, backend/services/content_planning_service.py).
  • Renamed the misspelled docs directory from docs/Content Calender/ to docs/Content Calendar/ and removed the duplicate calendar_generation_transparency_modal_implementation_plan copy.md file.
  • Reworked frontend/src/components/BlogWriter/__tests__/PollingIntegration.test.tsx to use renderHook + useBlogWriterResearchPolling with jest.useFakeTimers() and deterministic assertions for polling call sequence, onProgress/onComplete payloads, and task-not-found error handling.
  • Updated docs/CODEBASE_ISSUE_TASKS.md to reflect the implemented fixes and to mark follow-ups (e.g., pagination) where applicable.

Testing

  • Ran python -m compileall on modified backend files and compilation completed successfully.
  • Performed repository searches (rg) to verify the new get_all_calendar_events references and that the misspelled docs path and duplicate file were removed; searches succeeded.
  • Attempted to run the targeted frontend Jest test (cd frontend && npm test -- --watch=false --runTestsByPath src/components/BlogWriter/__tests__/PollingIntegration.test.tsx) but test execution could not run in this environment because react-scripts is not available; the updated test file was added and should be executed in CI or a developer environment with frontend dependencies installed.

Codex Task


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/AJaySi/ALwrity/pull/334 **Author:** [@AJaySi](https://github.com/AJaySi) **Created:** 2/10/2026 **Status:** ✅ Merged **Merged:** 2/11/2026 **Merged by:** [@AJaySi](https://github.com/AJaySi) **Base:** `main` ← **Head:** `codex/fix-typo-in-codebase` --- ### 📝 Commits (1) - [`30655a9`](https://github.com/AJaySi/ALwrity/commit/30655a90411242c59d6dfc9b7578599e1347a9fe) Implement calendar event retrieval fixes and strengthen polling tests ### 📊 Changes **16 files changed** (+158 additions, -570 deletions) <details> <summary>View changed files</summary> 📝 `backend/api/content_planning/services/calendar_service.py` (+1 -2) 📝 `backend/services/content_planning_db.py` (+9 -1) 📝 `backend/services/content_planning_service.py` (+1 -2) ➕ `docs/CODEBASE_ISSUE_TASKS.md` (+67 -0) 📝 `docs/Content Calendar/ALWRITY_CONTENT_CALENDAR_COMPREHENSIVE_GUIDE.md` (+0 -0) 📝 `docs/Content Calendar/ALWRITY_CONTENT_PLANNING_COMPREHENSIVE_GUIDE.md` (+0 -0) 📝 `docs/Content Calendar/calendar_data_transparency_end_user.md` (+0 -0) 📝 `docs/Content Calendar/calendar_generation_prompt_chaining_architecture.md` (+0 -0) 📝 `docs/Content Calendar/calendar_generation_transparency_modal_implementation_plan.md` (+0 -0) 📝 `docs/Content Calendar/calendar_generator_refactoring_summary.md` (+0 -0) 📝 `docs/Content Calendar/calendar_wizard_strategy_integration_implementation_plan.md` (+0 -0) 📝 `docs/Content Calendar/calendar_wizard_transparency_implementation_plan.md` (+0 -0) 📝 `docs/Content Calendar/content_calendar_quality_gates.md` (+0 -0) 📝 `docs/Content Calendar/expected_calendar_output_structure.md` (+0 -0) ➖ `docs/Content Calender/calendar_generation_transparency_modal_implementation_plan copy.md` (+0 -520) 📝 `frontend/src/components/BlogWriter/__tests__/PollingIntegration.test.tsx` (+80 -45) </details> ### 📄 Description ### Motivation - Fix a backend defect where unfiltered calendar retrieval returned an empty list instead of persisted events and align implementation with the existing docstring. - Remove a documented typo and an accidental duplicate planning file in the documentation to keep docs consistent and searchable. - Improve a weak/flaky frontend polling test so it asserts deterministic, meaningful behaviors and prevents regressions. ### Description - Added `ContentPlanningDBService.get_all_calendar_events()` and wired both API and service layers to call it when `strategy_id` is not provided (`backend/services/content_planning_db.py`, `backend/api/content_planning/services/calendar_service.py`, `backend/services/content_planning_service.py`). - Renamed the misspelled docs directory from `docs/Content Calender/` to `docs/Content Calendar/` and removed the duplicate `calendar_generation_transparency_modal_implementation_plan copy.md` file. - Reworked `frontend/src/components/BlogWriter/__tests__/PollingIntegration.test.tsx` to use `renderHook` + `useBlogWriterResearchPolling` with `jest.useFakeTimers()` and deterministic assertions for polling call sequence, `onProgress`/`onComplete` payloads, and task-not-found error handling. - Updated `docs/CODEBASE_ISSUE_TASKS.md` to reflect the implemented fixes and to mark follow-ups (e.g., pagination) where applicable. ### Testing - Ran `python -m compileall` on modified backend files and compilation completed successfully. - Performed repository searches (`rg`) to verify the new `get_all_calendar_events` references and that the misspelled docs path and duplicate file were removed; searches succeeded. - Attempted to run the targeted frontend Jest test (`cd frontend && npm test -- --watch=false --runTestsByPath src/components/BlogWriter/__tests__/PollingIntegration.test.tsx`) but test execution could not run in this environment because `react-scripts` is not available; the updated test file was added and should be executed in CI or a developer environment with frontend dependencies installed. ------ [Codex Task](https://chatgpt.com/codex/tasks/task_e_698b0c1e57308328a30970dd3bc057c0) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-13 21:01:18 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ALwrity#639
No description provided.