Sell It Lesson 17 of 27

The Eternal Spinner

The Story

Narrated

Your trip planner is looking real. Users can sign up, log in, generate itineraries with streaming (so no more timeout issues from Lesson 9), and everything feels smooth. You’re proud of it.

Then you add the photo processing feature from Lesson 12. Users can upload vacation photos, and your app resizes them, runs AI analysis to generate captions, and saves everything to storage. Works great for one or two photos.

Then someone uploads 10 photos from their Barcelona trip. They click “Process All.” Your serverless function starts crunching through them — resize photo 1, AI-caption photo 1, resize photo 2, AI-caption photo 2… and somewhere around photo 4, the function times out. On Vercel, you get 10 seconds on the free tier. On Cloudflare, 30 seconds. Either way, your function can’t finish processing 10 photos in one go.

Streaming doesn’t help here. In Lesson 9, streaming fixed the text generation timeout because an AI itinerary is a continuous flow of text — you can send it word by word as it’s produced. But photo processing isn’t a stream. It’s batch work. You need to resize a file, send it to an AI, wait for a response, save the result. Each photo is a discrete chunk of work. You can’t “stream” a photo resize.

So the user clicks “Process All,” sees a spinner, and then gets a timeout error. Half their photos are processed, half aren’t. They don’t know which ones made it. They try again and now some photos get processed twice while the other half still fail.

This is the eternal spinner, batch edition. And it needs a completely different solution than streaming.


This lesson continues with the full course

The story intro above is free to read. The full lesson — prompts, explanations, and adapt-it exercises — requires the Build It Right ($149) tier or above.

Audio narration coming soon