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 12/6/2023 in #general
Has anyone got Hono with Convex working
Anyway, thanks again!
5 replies
CCConvex Community
Created by yarrichar on 12/6/2023 in #general
Has anyone got Hono with Convex working
Not sure who is responsible for the 404 (convex or hono), but better messaging around that would have been nice.
5 replies
CCConvex Community
Created by yarrichar on 12/6/2023 in #general
Has anyone got Hono with Convex working
I thought it wasn't for a second because I was getting a 404 when hitting the endpoint. It turns out that was because I wasn't returning anything from my request handler.
5 replies
CCConvex Community
Created by yarrichar on 12/6/2023 in #general
Has anyone got Hono with Convex working
Thanks for getting back to me. Your fix worked.
5 replies