WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@yashranaway
Copy link
Contributor

Fixes #1814

Previous PR #1955

What

Added a "Resend all" button to the customer drawer that allows sellers to resend all missed posts to a customer with a single click. The button appears when there are 2+ missed posts and processes emails asynchronously via a background job.

**Flow **

  • Job retrieves missed posts at execution time (not request time) to ensure up-to-date list
  • Job respects 8-hour throttling mechanism using Rails.cache.fetch (same as single post sends)
  • Added POST /posts/send_all_for_purchase/:purchase_id endpoint
  • Created SendAllMissedPostsJob Sidekiq job
  • Updated PurchasePolicy for authorization

Why

Saves time and improves UX by allowing bulk resend of missed posts.

Tests

  • Controller enqueues job with seller and purchase IDs only ✓
  • Job retrieves missed posts at execution time ✓
  • Job respects 8-hour throttling mechanism ✓
  • Job handles errors gracefully and continues processing ✓
  • Authorization and eligibility checks ✓
  • All tests pass ✓

Demo

Screen.Recording.2025-11-09.at.11.03.34.AM.mov

AI disclosure

I used Claude 4.5 via Cursor. All code and tests were manually verified and fixed where needed.

@yashranaway yashranaway marked this pull request as ready for review December 4, 2025 12:49
@yashranaway
Copy link
Contributor Author

@EmCousin mentioned since you already have the context 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Send all missed posts button

1 participant