Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 22, 02:00 UTC
fix(e2e): add retry logic to tool-router-files download for eventual consistency
The download call can 404 immediately after upload due to API eventual consistency. Add the same retry pattern already used for list. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Rahul Tarak committed
Mar 17, 2026 at 19:58 UTC
ddf871c1ec4064333722532da5f922fdb024140d
1 file changed
+11
-2
ts/e2e-tests/runtimes/node/tool-router-files/fixtures/index.mjs
+11
-2
@@ -55,8 +55,17 @@ async function main() {
55
if (listOk) console.log('LIST_OK');
56
else console.log('LIST_SKIP'); // eventual consistency
57
58
- // Download the file (use path from API response)
59
- const downloaded = await files.download(storedPath);
58
+ // Download the file (retry for eventual consistency, same as list above)
59
+ let downloaded;
60
+ for (let attempt = 0; attempt < 5; attempt++) {
61
+ try {
62
+ downloaded = await files.download(storedPath);
63
+ break;
64
+ } catch (err) {
65
+ if (attempt === 4) throw err;
66
+ await new Promise((r) => setTimeout(r, 1000));
67
+ }
68
+ }
69
const content = await downloaded.text();
70
if (content !== testContent) {
71
throw new Error(`Download failed: expected "${testContent}", got "${content}"`);