Tiger 🐅
Tiger 🐅2mo ago

convex/eleven labs, weird caching issue

hi team, idk if this is on convex i got "use node" at the top im using the eleven labs sdk to generate voices whats weird is that when i update the voice id, everything updates, the db, all logs are right, etc. but for some reason, even if we're passing the new voice id to the call, its using the old one
5 Replies
Tiger 🐅
Tiger 🐅OP2mo ago
what i find so weird is that when restarting the dev server, it then works, it updates the new voice to generate but then it caches that voice again 😅 im digging into their sdk source code to figure out whats going wrong, but its indeed a strange issue ive used their sdk in the past, so that should be ok apologies for the unstructured writing 😄 im thinking out loud im not sure where or what is going wrong why would restarting the convex server use the right value from db
console.log('voiceId inside node.lib', voiceId)

const [stream, convertError] = await handlePromise(
elevenlabsClient.textToSpeech.convert(voiceId, {
text,
model_id: ELEVEN_LABS_MODEL,
})
)
console.log('voiceId inside node.lib', voiceId)

const [stream, convertError] = await handlePromise(
elevenlabsClient.textToSpeech.convert(voiceId, {
text,
model_id: ELEVEN_LABS_MODEL,
})
)
--- we begin by restarting convex dev with npx convex dev Let's say we start with voice id A its fine moving to voice B is where im having issues i see the RIGHT voice id in the logs but it still uses the wrong one or better said, the first one its as if there is a permanent cache happening inside the eleven labs sdk im wondering if "use node" at the top might be related to it not sure im thinking "closures" of some kind in this environment with elevenlabs sdk
MapleLeaf 🍁
MapleLeaf 🍁2mo ago
so by "restarting the dev server", do you mean the web app? is it a next app? next is known to have some aggressive caching by default (although they made some changes here, not sure if any are meaningful)
Tiger 🐅
Tiger 🐅OP2mo ago
reactjs restarting i mean "npx convex dev" cancelling that and retsarting refreshign the web app doesnt help either imma check soon if it works in production or not
MapleLeaf 🍁
MapleLeaf 🍁2mo ago
i guess uhhhh how does the ID get determined on the frontend? if convex is caching args i can only think the frontend is accidentally providing it unchanged like a stale closure
Tiger 🐅
Tiger 🐅OP2mo ago
right before i call eleven labs its ok so its gotta be something else we call eleven labs with the updated voice id which is so weird

Did you find this page helpful?