openvk/Web/Presenters
Ilia Breitburg 5ae8b62cd1
fix(api): implement pending uploads cleanup and enhanced error response (#1384)
## Summary
- Implements automatic cleanup mechanism for pending photo uploads older
than 24 hours
- Enhances error response to include actionable information about
pending uploads
- Adds CLI command for manual cleanup with dry-run support

## Changes Made
- **CLI/CleanupPendingUploadsCommand.php**: New command to auto-delete
stale `.oct` files
- **Web/Presenters/VKAPIPresenter.php**: Enhanced error response with
pending upload details
- **openvkctl**: Added cleanup command to CLI bootstrap
- **CLI/README.md**: Documentation with usage examples and cron setup

## Problem Solved
When users encounter "There are 3 pending already" error, they now
receive:
1. **Structured JSON response** with upload details (ID, filename, size,
age, timestamp)
2. **Automatic cleanup** removes uploads older than 24 hours
3. **Manual cleanup** available via CLI command with configurable age
threshold

## Usage
```bash
# Auto-cleanup (daily cron recommended)
php openvkctl cleanup-pending-uploads

# Custom age threshold
php openvkctl cleanup-pending-uploads --max-age=1

# Preview what would be deleted
php openvkctl cleanup-pending-uploads --dry-run
```

Fixes #1275
2025-07-15 23:19:30 +03:00
..
templates feat(rate_limits) (#1353) 2025-06-29 17:11:33 +03:00
AboutPresenter.php fix(API): users bdate field, can edit/delete comments (#1359) 2025-06-29 17:12:55 +03:00
AdminPresenter.php feat(admin): ability to hide user's posts from global feed (#1291) 2025-06-01 16:30:25 +03:00
AppsPresenter.php feat: add linting of code (#1220) 2025-01-31 18:20:13 +03:00
AudioPresenter.php fix: resolve issues related to API listens field, anonymous notifications, and UX bugs (#1279) 2025-05-03 16:53:14 +03:00
AuthPresenter.php feat: add linting of code (#1220) 2025-01-31 18:20:13 +03:00
AwayPresenter.php fix(links, away) (fixes #1253) 2025-03-16 17:57:21 +03:00
BannedLinkPresenter.php feat: add linting of code (#1220) 2025-01-31 18:20:13 +03:00
BlobPresenter.php feat(core): add phpstan for static analysis (#1223) 2025-03-09 16:03:33 +03:00
CommentPresenter.php feat(core): add phpstan for static analysis (#1223) 2025-03-09 16:03:33 +03:00
ContentSearchPresenter.php feat(core): add phpstan for static analysis (#1223) 2025-03-09 16:03:33 +03:00
DocumentsPresenter.php fix: wide avatars at tips 2025-06-01 17:04:44 +03:00
GiftsPresenter.php feat(rate_limits) (#1353) 2025-06-29 17:11:33 +03:00
GroupPresenter.php feat(rate_limits) (#1353) 2025-06-29 17:11:33 +03:00
HelloPresenter.php feat: add linting of code (#1220) 2025-01-31 18:20:13 +03:00
InternalAPIPresenter.php feat(notes): use whitelist for images sources (#1352) 2025-06-15 16:55:27 +03:00
MaintenancePresenter.php feat: add linting of code (#1220) 2025-01-31 18:20:13 +03:00
MessengerPresenter.php feat(core): add phpstan for static analysis (#1223) 2025-03-09 16:03:33 +03:00
NoSpamPresenter.php fix: add warning at nospam 2025-06-01 17:04:44 +03:00
NotesPresenter.php feat: add linting of code (#1220) 2025-01-31 18:20:13 +03:00
NotificationPresenter.php feat: add linting of code (#1220) 2025-01-31 18:20:13 +03:00
OpenVKPresenter.php fix(pda), chore(locale): adapt for pda (#1276) 2025-04-19 17:37:59 +03:00
PhotosPresenter.php fix(photo upload): fix own page upload error (#1336) 2025-06-01 15:02:00 +00:00
PollPresenter.php feat: add linting of code (#1220) 2025-01-31 18:20:13 +03:00
ReportPresenter.php feat(rate_limits) (#1353) 2025-06-29 17:11:33 +03:00
SearchPresenter.php fix: resolve issues related to API listens field, anonymous notifications, and UX bugs (#1279) 2025-05-03 16:53:14 +03:00
SupportPresenter.php feat(support): add more telegram posts (#1282) 2025-05-10 16:55:54 +03:00
ThemepacksPresenter.php feat: add linting of code (#1220) 2025-01-31 18:20:13 +03:00
TopicsPresenter.php feat(core): add phpstan for static analysis (#1223) 2025-03-09 16:03:33 +03:00
UnknownTextRouteStrategyPresenter.php feat: add linting of code (#1220) 2025-01-31 18:20:13 +03:00
UserPresenter.php feat(rate_limits) (#1353) 2025-06-29 17:11:33 +03:00
VideosPresenter.php feat: video not unlisted af. editing 2025-06-01 17:04:44 +03:00
VKAPIPresenter.php fix(api): implement pending uploads cleanup and enhanced error response (#1384) 2025-07-15 23:19:30 +03:00
WallPresenter.php feat(rate_limits) (#1353) 2025-06-29 17:11:33 +03:00