mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-03 08:18:42 +08:00
## Summary - **Nil patron data crash**: Patreon V1 API can return pledge entries where `relationships.patron.data` is null (deleted/deactivated accounts). This caused `extract` to raise `NoMethodError`, preventing `save!` from completing — leaving the pledge store stuck at stale data (exactly 100 pledges from a previous sync). Fixed with `dig` for safe nil traversal, skipping entries with missing IDs. - **Double base URL**: Pagination `next` links from Patreon are absolute URLs, but `Api.get` was prepending the base URL again (`https://api.patreon.comhttps://api.patreon.com/...`). Fixed by detecting absolute URIs and using them directly. - **Non-incremental saves**: All pages were collected before a single `save!`. If any page failed, nothing was persisted. Now each page is saved incrementally — first page clears stale data, subsequent pages append. Also handles the edge case where the API returns empty data by explicitly clearing the store so ex-patrons don't keep group access. |
||
|---|---|---|
| .. | ||
| api_version | ||
| discourse_patreon | ||
| validators | ||
| api.rb | ||
| campaign.rb | ||
| patron.rb | ||
| pledge.rb | ||
| seed.rb | ||
| tokens.rb | ||