yarrichar
yarrichar
CCConvex Community
Created by yarrichar on 10/6/2024 in #support-community
Is there a way to control the websocket reconnect backoff?
Yeah, that would probably work... Although it makes me want to ask for an escape hatch for that as well, maybe attemptReconnectImmediately_immediately() 😄
18 replies
CCConvex Community
Created by yarrichar on 10/6/2024 in #support-community
Is there a way to control the websocket reconnect backoff?
That sounds good, but what I was trying to get at is that the problem with exposing something like attemptReconnectImmediately() to users is that it can be overused. Which would stop reconnections being nicely distributed and have an impact on the Convex infrastructure. I would be happy to have it (especially if it comes with a callback to tell me when the websocket is down).... I just don't think you should trust us users 😄
18 replies
CCConvex Community
Created by yarrichar on 10/6/2024 in #support-community
Is there a way to control the websocket reconnect backoff?
Yeah, I understand. So a reduction in the max is unacceptable, what about making it take longer to get to the max? Another thought: If the client has no internet then short reconnect times are presumably fine since it's not impacting Convex's infrastructure. So what about using something like the navigator.onLine property to help determine the shape of the exponential backoff?
18 replies
CCConvex Community
Created by yarrichar on 10/6/2024 in #support-community
Is there a way to control the websocket reconnect backoff?
Thanks for taking the time to reply @sshader It’s really just like I said - the behaviour I want is just to reduce the max time between reconnects - 10 seconds would be ok, it doesn’t need to be zero. I’ve basically got some data that is being pushed from one device to another and want to keep them as close as possible. I’m assuming attemptReconnectImmediately() is something I’d call anytime I want to reconnect (as opposed to calling it once to setup a config option - which I don’t think would make sense). The problem is that I always want the devices to be as close to in sync as possible. So the proposed API would lead to me setting up some sort of listener which always calls attemptReconnectImmediately() on any disconnect. Which basically removes any exponential backoff unless the client is expected to re-add it. The suggested API is also more work for the user than specifying some different config parameters. The other observation I have with the exponential backoff is that it went to 20 seconds + within a few seconds. So if I hit a patchy bit of internet and am suddenly waiting 20 seconds to reconnect. Note that the app I’m developing will be often used on mobile devices. The two options I can see are: 1. Let me manually specify the max time between reconnects (with some lower limit presumably). 2. Increase the time it takes to get to the larger reconnect times so that patchy internet isn’t penalised too hard.
18 replies
CCConvex Community
Created by yarrichar on 8/12/2024 in #support-community
When does a mutation commit?
Great, thanks. Yeah, I'm storing the lock as <requestId>:<timestamp> to handle that case. It also lets me make sure that I don't release a lock someone else has acquired (if the lock times out before the action).
3 replies
CCConvex Community
Created by yarrichar on 4/21/2024 in #support-community
intellisense not working
Ok, cool. Glad I came up with the right approach - I guess all I would say is that it would be nice if it didn't break all types. But I guess that's hard to avoid.
5 replies
CCConvex Community
Created by yarrichar on 4/21/2024 in #support-community
intellisense not working
Hey @Michal Srb - thanks for the response. So I'm not sure exactly what the issue is, but it looks like it was getting confused when returning an unknown type from one of my actions. This seemed to call all convex based types to break. E.g. this didnt work:
return await externalApi.foo...
return await externalApi.foo...
But this did:
const result: any[] = await externalApi.foo...
return result;
const result: any[] = await externalApi.foo...
return result;
There may be something else going on though - I haven't been able to do a simple reproduction yet. The error I was getting on my action was:
TS7022: fetchClips implicitly has type any because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
TS7022: fetchClips implicitly has type any because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
5 replies
CCConvex Community
Created by yarrichar on 2/19/2024 in #support-community
Storing openai embeddings "length limit exceeded"
@Michal Srb now I'm getting:
failure
Uncaught Error: Too many concurrent operations. See https://docs.convex.dev/functions/actions#limits for more information.
at async <anonymous> (../convex/aiIndex.ts:119:16)
at async handler (../convex/aiIndex.ts:116:12)
failure
Uncaught Error: Too many concurrent operations. See https://docs.convex.dev/functions/actions#limits for more information.
at async <anonymous> (../convex/aiIndex.ts:119:16)
at async handler (../convex/aiIndex.ts:116:12)
When trying to do the save. It was a bug that I was trying to save over 1k, but I guess I could get there if I have multiple people saving at the same time.... Is one way to handle this to schedule each of the saves (with timeout = 0)?
10 replies
CCConvex Community
Created by yarrichar on 2/19/2024 in #support-community
Storing openai embeddings "length limit exceeded"
Yeah, I am calling it from "use node"
10 replies
CCConvex Community
Created by yarrichar on 2/19/2024 in #support-community
Storing openai embeddings "length limit exceeded"
I guess I'd hit that with larger documents anyway though
10 replies
CCConvex Community
Created by yarrichar on 2/19/2024 in #support-community
Storing openai embeddings "length limit exceeded"
Yeah, that's what I ended up doing. It's a bit of annoying limit though since it (1) makes it basically impossible to save updated embeddings without a window of either duplications or missing data, and (2) Bumps up the number of function calls I have to use greatly I also believe I'm saving less than both the max DB persist limit, and the max function size argument (8MiB) (about 22KB per vector * 100 + 70KB for the raw text)
10 replies
CCConvex Community
Created by yarrichar on 8/12/2023 in #support-community
langchain - can't find import when doing: npm run build
Not sure, my use of open ai just looks like:
"use node"

import OpenAI from "openai";

...

const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });

const completion = await openai.chat.completions.create({
"use node"

import OpenAI from "openai";

...

const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });

const completion = await openai.chat.completions.create({
So I'm not importing those types.... Make sure you've got "use node" at the top is a potential gotcha
14 replies
CCConvex Community
Created by DerPenz on 8/30/2023 in #support-community
Is svelte support planned? update: its supported!
No I didn't in the end - so I ended up back with nextjs. In hindsight I don't think it would have been too hard to do a custom auth provider: https://docs.convex.dev/auth/custom-auth Here is an example of a custom provider for next auth: https://discord.com/channels/1019350475847499849/1019350478817079338/1133076376501637140
69 replies
CCConvex Community
Created by yarrichar on 10/10/2023 in #support-community
Multiple vector indexes on the same table
10 replies
CCConvex Community
Created by yarrichar on 10/10/2023 in #support-community
Multiple vector indexes on the same table
Yeah, and checking the results after the fact is fine for this use case - hopefully it has no effect 😉
10 replies
CCConvex Community
Created by yarrichar on 10/10/2023 in #support-community
Multiple vector indexes on the same table
So specifying both fields in the one index ["clerkUserId", "documentId"] seems to work, thanks! This mostly meets my needs - the only thing I'm missing is the ability to do ANDs in vector searches (intellisense and the docs both seem to indicate it's not available). When I'm filtering by documentId I would have liked to be able to also filter by clerkUserId to make sure I haven't stuffed up and am only looking at documents for the current user 🙂
10 replies
CCConvex Community
Created by yarrichar on 9/28/2023 in #support-community
Error: Connection lost while action was in flight
I "fixed" it in a slightly cheeky way - I needed to do a useQuery in that component. Only running the action after the query has resolved, fixed the issue
23 replies
CCConvex Community
Created by yarrichar on 9/28/2023 in #support-community
Error: Connection lost while action was in flight
I might just move this to a nextjs api route since I don't really need convex for that bit. Would love to know what I'm doing wrong though
23 replies
CCConvex Community
Created by yarrichar on 9/28/2023 in #support-community
Error: Connection lost while action was in flight
Running the action from a button click always works too
23 replies
CCConvex Community
Created by yarrichar on 9/28/2023 in #support-community
Error: Connection lost while action was in flight
Is it possible to call an action before convex is ready?
23 replies