mirror of
https://github.com/Second-Hand-Friends/kleinanzeigen-bot.git
synced 2026-07-09 12:41:05 +02:00
## ℹ️ Description - Link to the related issue(s): Issue # - Fixes a remaining fail-closed gap in BEFORE_PUBLISH title cleanup for ID-less ads when the published-ad list cannot be fetched completely. ## 📋 Changes Summary - Require an additional strict published-ad fetch when BEFORE_PUBLISH title cleanup may match by title for ID-less ads. - Fail closed for ID-less publish candidates if strict published-ad fetch is incomplete, before submit/delete actions. - Keep ID-based candidates on the normal published-ad list so they can continue safely. - Add regression tests for strict-fetch usage and fail-closed behavior. - Add German translations for the new log messages. ### ⚙️ Type of Change Select the type(s) of change(s) included in this pull request: - [x] 🐞 Bug fix (non-breaking change which fixes an issue) - [ ] ✨ New feature (adds new functionality without breaking existing usage) - [ ] 💥 Breaking change (changes that might break existing user setups, scripts, or configurations) ## ✅ Checklist Before requesting a review, confirm the following: - [x] I have reviewed my changes to ensure they meet the project's standards. - [x] I have tested my changes and ensured that all tests pass (`pdm run test`). - [x] I have formatted the code (`pdm run format`). - [x] I have verified that linting passes (`pdm run lint`). - [x] I have updated documentation where necessary. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. Validation performed locally: - `pdm run pytest tests/unit/test_publishing_workflow.py tests/unit/test_delete_flow.py` - `pdm run format` - `pdm run lint` - `pdm run test` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Enhanced publishing workflow to use more precise “published ad” data when title-based cleanup is enabled, improving match-and-replace behavior. * **Bug Fixes** * Publishing now fails safely when strict published-ad data is incomplete, avoiding retries and deletion actions when precision can’t be guaranteed. * For ads lacking a known identifier, the workflow intelligently selects the best available published-ad list or skips with a warning when strict data is unavailable. * **Tests** * Added unit test coverage for strict-vs-non-strict published-ad fetching scenarios and fail-closed behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai -->