Sara
Sara
CCConvex Community
Created by Sara on 12/22/2024 in #support-community
Feature Request: return the number the page is on in `.paginate()`
I've hit a use case where I need to know the total page number, Previous page number, and nextPage number, is there something I might be missing with results being returned from the query?
4 replies
CCConvex Community
Created by Sara on 12/5/2024 in #support-community
How to handle metadata fetching in nextjs(14.2.14) + Convex
If for instance I want to have the some of the user's information as metadata, How do I go by doing this with convex? cause it works just in development for me.
7 replies
CCConvex Community
Created by Sara on 10/18/2024 in #support-community
Github Authentication issue with React Vite
No description
8 replies
CCConvex Community
Created by Sara on 8/24/2024 in #support-community
adding rate limits to existing auth functions (store, viewer ..etc)
I just need advice on how I can implement rate limits for pre-existing function that are coming from convex-auth, Is there a way that I can add a certain callback in my auth.ts? Because it's really important especially for anonymous sign up! Thank you for all the advice folks, I really appreciate it ❤️
4 replies
CCConvex Community
Created by Sara on 8/16/2024 in #support-community
Copy Items in documents as individual or bulk copy
it would be great to be able to copy documents as objects or json from the dashboard, instead of creating functions for it
4 replies
CCConvex Community
Created by Sara on 8/11/2024 in #support-community
Problem with building @convex-dev/auth@0.0.50 in deployment
No description
34 replies
CCConvex Community
Created by Sara on 8/1/2024 in #support-community
handling file type, and a small issue with a server package
Issue #1: I was trying to use the file system from google seen here -> google docs, in which I have a file called model.ts that already has some working structure (using async functions and convex built in functions), but when I try importing the GoogleAIFileManager I ran through this error:
Preparing Convex functions...
X [ERROR] Could not resolve "fs"

node_modules/.pnpm/@google+generative-ai@0.16.0/node_modules/@google/generative-ai/dist/server/index.mjs:1:29:
1 │ import { readFileSync } from 'fs';
~~~~

The package "fs" wasn't found on the file system but is built into node. Are you trying to bundle
for node? You can use "platform: 'node'" to do that, which will remove this error.
Preparing Convex functions...
X [ERROR] Could not resolve "fs"

node_modules/.pnpm/@google+generative-ai@0.16.0/node_modules/@google/generative-ai/dist/server/index.mjs:1:29:
1 │ import { readFileSync } from 'fs';
~~~~

The package "fs" wasn't found on the file system but is built into node. Are you trying to bundle
for node? You can use "platform: 'node'" to do that, which will remove this error.
and after further investigation, this could be the possible soultion -> some guy on github threads which I thought I'm already am? I know my code is complaing about the second line here:
const genAI = new GoogleGenerativeAI(apiKey as string);
const fileManager = new GoogleAIFileManager(apiKey as string)
const genAI = new GoogleGenerativeAI(apiKey as string);
const fileManager = new GoogleAIFileManager(apiKey as string)
so what would you suggest in this case? do I wrap it in an action and not use it in another file? Issue #2: I would like to pass my file as a file type to pass it through the google function that handles it for me without having to upload it somewhere or add to my cache history, and the code happend to complain that I used v.any() instead of defining it as a file like i did, what do I do in this case as a suggestion?
Error: File {} is not a supported Convex type (present at path .file in original object {"threadId":"m17a4k298pfydfecht4yevba7x6y1efy","content":"todododooleoeo","file":{}}). To learn about Convex's supported types, see https://docs.convex.dev/using/types.
Error: File {} is not a supported Convex type (present at path .file in original object {"threadId":"m17a4k298pfydfecht4yevba7x6y1efy","content":"todododooleoeo","file":{}}). To learn about Convex's supported types, see https://docs.convex.dev/using/types.
what should I do in this case?
3 replies
CCConvex Community
Created by Sara on 7/29/2024 in #support-community
Type check help - Passing an Object of type Doc<"table_name"> but has partial values
I'm basically wondering if there's another way of Doing this type here? where the body is supposed to be of type Doc<"settings"> but partially has that type?
export const update = mutation({
args:{settingsId: v.id("settings"), body:v.any()},
handler:async(ctx, args_0) => {
await ctx.db.patch(args_0.settingsId, args_0.body as Partial<Doc<"settings">>)
},
})
export const update = mutation({
args:{settingsId: v.id("settings"), body:v.any()},
handler:async(ctx, args_0) => {
await ctx.db.patch(args_0.settingsId, args_0.body as Partial<Doc<"settings">>)
},
})
3 replies
CCConvex Community
Created by Sara on 7/15/2024 in #support-community
A Bug with adding documents
when I add a new document from the website, about 500 new lines appear in the editing area, it has been Working earlier it is just not working properly now for some reason. it showed me an error with validating schema earlier in the console but I can't seem to reproduce it. my schema for refrence:
const schema = defineSchema({
...authTables,
// Your other tables...
profiles: defineTable({
userId: v.id('users'), // one to one
bio: v.string(),
}).index('userId', ['userId']),
// one user has many friends but 1 friend is connected to 1 user, one to many
friends: defineTable({
userId: v.id('users'),
friendId:v.id('users'),
}).index('userId',['userId'],)
.index('friendId',['friendId']),
requests: defineTable({
senderId: v.id('users'),
receiverId: v.id('users'),
status:v.string(),
}).index('senderId',['senderId'])
.index('receiverId',['receiverId']),
chats:defineTable({
name:v.string(),
}),
messages:defineTable({
chatId: v.id("chats"),
senderId: v.id('users'),
message: v.string(),
})
.index('senderId',['senderId'])
.index('chatId',['chatId'])
});

export default schema;
const schema = defineSchema({
...authTables,
// Your other tables...
profiles: defineTable({
userId: v.id('users'), // one to one
bio: v.string(),
}).index('userId', ['userId']),
// one user has many friends but 1 friend is connected to 1 user, one to many
friends: defineTable({
userId: v.id('users'),
friendId:v.id('users'),
}).index('userId',['userId'],)
.index('friendId',['friendId']),
requests: defineTable({
senderId: v.id('users'),
receiverId: v.id('users'),
status:v.string(),
}).index('senderId',['senderId'])
.index('receiverId',['receiverId']),
chats:defineTable({
name:v.string(),
}),
messages:defineTable({
chatId: v.id("chats"),
senderId: v.id('users'),
message: v.string(),
})
.index('senderId',['senderId'])
.index('chatId',['chatId'])
});

export default schema;
I should state it's only occurring for the messages table
23 replies