charlie
CCConvex Community
•Created by charlie on 12/16/2024 in #support-community
Convex Auth + Google + Custom Domain
5 replies
CCConvex Community
•Created by charlie on 7/17/2024 in #support-community
v.record
FWIW the commented-out type in
validators.d.ts
works as you outlined above
Of course, you guys have been shipping amazing work! Just wanted to bring some more attention to it, as it is an important primitive22 replies
CCConvex Community
•Created by charlie on 7/17/2024 in #support-community
v.record
The feature would be super useful, even if that edge case threw or had a weird resolution -- it's not like anyone is super likely to need
v.record(?, v.optional(?))
since it doesn't have a direct analogue in TS anyway22 replies
CCConvex Community
•Created by charlie on 7/17/2024 in #support-community
v.record
Just brainstorming
22 replies
CCConvex Community
•Created by charlie on 7/17/2024 in #support-community
v.record
For finite-valued key types, maybe an optional value just gets inferred as a POJO and a non-optional value as a proper TS Record ?
v.record(v.union(v.literal('a'), v.literal('b')), v.number())
=> Record<'a'|'b', number>
v.record(v.union(v.literal('a'), v.literal('b')), v.optional(v.number()))
=> {[inferredKey: 'a' | 'b']: number}
22 replies
CCConvex Community
•Created by charlie on 7/17/2024 in #support-community
v.record
For infinite-valued key types like
v.string()
22 replies
CCConvex Community
•Created by charlie on 7/17/2024 in #support-community
v.record
Alternately... maybe
v.optional()
in that situation is actually just a no-op?22 replies
CCConvex Community
•Created by charlie on 7/17/2024 in #support-community
v.record
Although I haven't thought it through, my first instinct is I'd rather have a Record validator that just throws when passed a
v.optional()
, vs. no Record validator at all22 replies
CCConvex Community
•Created by charlie on 7/17/2024 in #support-community
v.record
I actually don't care about validating the keys -- in my particular case I'm always doing
Record<string, CalEvent>
or Record<string, number>
22 replies
CCConvex Community
•Created by charlie on 7/17/2024 in #support-community
v.record
My use case is just that I use a lot of
Map
s and POJOs in my app, and those values need to be strongly typed. The biggest example: this is a calendar app and there's a field events: Record<string, CalEvent>
where CalEvent
really needs to be typechecked. So using v.any()
and .fromEntries
as suggested is problematic22 replies
CCConvex Community
•Created by charlie on 7/17/2024 in #support-community
v.record
Ah interesting! I was wondering what the problematic edge cases were. Makes sense
22 replies
CCConvex Community
•Created by charlie on 7/17/2024 in #support-community
v.record
Gotcha, thanks Tom! I suppose I was already taking that risk by staying on 1.2.1 and using the
v.record()
from that version.22 replies
CCConvex Community
•Created by charlie on 7/17/2024 in #support-community
v.record
Current hacked-together solution:
Add a file
convex/vWithRecord.ts
(see attached file -- I just copied the export declare const v
block from validator.d.ts
and uncommented the line for v.record
)
Then in schema.ts
:
Are there any risks with this approach?22 replies
CCConvex Community
•Created by FleetAdmiralJakob 🗕 🗗 🗙 on 2/16/2024 in #support-community
Sketchy Link
+1 for vanity API domains. I'm trying to implement a feature involving shareable links that make GET requests to my Convex API, so to avoid end users having to copy/paste a "sketchy" link like this, it seems like I have to use a proxy server -- I naively tried just pointing a CNAME record at my API, but of course the SSL cert doesn't match
5 replies
CCConvex Community
•Created by charlie on 11/8/2023 in #support-community
Best practice for forwarding webhook errors to Sentry?
Don't rush on my account, that's great to hear! Thank you again!
14 replies
CCConvex Community
•Created by charlie on 11/8/2023 in #support-community
Best practice for forwarding webhook errors to Sentry?
Thank you for that, I can hold out for a week 😄
14 replies
CCConvex Community
•Created by charlie on 11/8/2023 in #support-community
Best practice for forwarding webhook errors to Sentry?
Incredible!
14 replies
CCConvex Community
•Created by charlie on 11/8/2023 in #support-community
Best practice for forwarding webhook errors to Sentry?
Thanks @rkbh@ballingt ! I don't think I can add another tool right now, so I may give it a shot with
@sentry/node
(thanks for the tip about flush
!) unless you feel like the Convex-Sentry integration is likely to launch pretty soon. As always thanks for jumping on Discord and helping us devs out, it's an awesome experience working with Convex14 replies
CCConvex Community
•Created by charlie on 11/8/2023 in #support-community
Best practice for forwarding webhook errors to Sentry?
As I am sans DataDog for now 🐕
14 replies
CCConvex Community
•Created by charlie on 11/8/2023 in #support-community
Best practice for forwarding webhook errors to Sentry?
Glad to hear it re: baked-in! For now should I just move to the Node runtime and use Sentry in that case?
14 replies