Skip to content

fix: Modify how collections are fetched and handle flood error - #257

Merged
danoctua merged 5 commits into
mainfrom
chore/new-collections
Sep 25, 2026
Merged

danoctua merged 5 commits into
mainfrom
chore/new-collections

Conversation

@danoctua

Copy link
Copy Markdown
Collaborator

No description provided.

- Wraps get_user_gifts with _safe_request to catch TelegramRetryAfter
- Sleeps for retry_after seconds and retries up to 3 times before raising
- Removes duplicate generic exception logging in pagination loop
- Skips gifts belonging to collections not yet synced rather than creating empty stubs
- Uses allows_write_to_pm flag instead of is_blocked to represent user bot writeability
- Marks users as not writable on Telegram 'user not found' error during gifts indexing
- Marks users as writable when interacting with bot via /start
- Preserves allows_write_to_pm during profile update from auth
- Adds unit tests for get_all_writable_telegram_ids and status toggles
…s sync

- Runs sync-gift-collections-from-api hourly at :00
- Runs refresh-all-user-gifts every 4 hours at :02, giving collection sync time to complete
@danoctua danoctua self-assigned this Sep 25, 2026
@danoctua danoctua added bug Something isn't working gifts labels Sep 25, 2026
@danoctua
danoctua merged commit 003e859 into main Sep 25, 2026
2 checks passed
@danoctua
danoctua deleted the chore/new-collections branch September 25, 2026 20:30
@danoctua
danoctua restored the chore/new-collections branch September 26, 2026 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working gifts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant