Add retry logic for folder creation confirmation#9
Conversation
Implement retry mechanism for folder visibility after creation.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR updates ChangesEventual Consistency Handling in Folder Creation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Implement retry mechanism for folder visibility after creation
ControlD's API can be eventually consistent — after creating a folder via POST,
the subsequent GET request to retrieve the folder list may not include the newly
created folder immediately. This causes a spurious "Folder 'X' was not found
after creation" error.
This change adds a retry loop (up to 5 attempts with progressive 2s/4s/6s/8s delays)
when the folder isn't found in the response, fixing the race condition at its
source. After 5 failed attempts, it logs the error and returns None as before.
Summary by CodeRabbit