Sara
Sara6mo ago

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
13 Replies
ballingt
ballingt6mo ago
Thanks for reporting! What's the interaction here, was this left click in that textarea?
Sara
SaraOP6mo ago
exactly I think I found the cause of it I thought the issue was because I didn't add an index field but I was wrong.
ian
ian6mo ago
what was the cause?
Sara
SaraOP6mo ago
I thought it was an indexing issue but i was wrong, although the schema was validated earlier so I'm not sure honestly.. I'll update the objects from functions in my VSCode Its still happening now, I thought it was fixed after the update
Sara
SaraOP6mo ago
and for some reason this is whats failing?
No description
ari
ari5mo ago
Hey @Sara , sorry for the delay here. Is the issue you're seeing now identical to the video you posted earlier? Let me know if you have an updated schema The error you see in your console is unrelated to the functionality of the document panel
Sara
SaraOP5mo ago
Yes, it's identical and I'm aware they're not related, Even after the schema update I remember it occurred occasionally will post the schema update soon
export const settingsSchema = {
userId: v.id("users"),
responseType: literals("chat","single-message"),
theme:literals("dark","light"),
keepChat: v.number(), // How long to keep the chats for // max of 30 days
attachments:v.object({
audio: v.boolean(),
images: v.boolean(),
}),
model: literals("gemini-1.0-pro","gemini-1.0-pro-latest","gemini-1.0-pro-001","gemini-1.5-flash","gemini-1.5-flash-latest","gemini-1.5-pro-latest","gemini-1.5-pro"),
languages: literals("ar","bn","bg","zh","hr","cs","da","nl",
"en","et","fi","fr","de","el","iw","hi","hu","id","it","ja",
"ko","lv","lt","no","pl","pt","ro","ru","sr","sk","sl","es",
"sw","sv","th","tr","uk","vi")
}

const schema = defineSchema({
...authTables,
...rateLimitTables,
settings: defineTable(settingsSchema)
.index("userId", ["userId"])
.index("languages", ["languages"]),
threads: defineTable({
summary: v.optional(v.string()),
summarizer: v.optional(v.id("_scheduled_functions")),
}).index("by_summary", ["summary"]),
threadsMembers: defineTable({
threadId: v.id("threads"),
userId: v.id("users"),
})
.index("threadId", ["threadId"])
.index("userId", ["userId"]),
messages: defineTable({
message: v.string(),
threadId: v.id("threads"),
author: v.union(
v.object({
role: v.literal("system"),
}),
v.object({
role: v.literal("assistant"),
model: v.optional(v.string()),
}),
v.object({
role: v.literal("user"),
userId: v.id("users"),
})
),
state: literals("success", "generating", "failed"),
})
.index("state", ["state", "author.userId"])
.index("threadId", ["threadId"]),
});
export const settingsSchema = {
userId: v.id("users"),
responseType: literals("chat","single-message"),
theme:literals("dark","light"),
keepChat: v.number(), // How long to keep the chats for // max of 30 days
attachments:v.object({
audio: v.boolean(),
images: v.boolean(),
}),
model: literals("gemini-1.0-pro","gemini-1.0-pro-latest","gemini-1.0-pro-001","gemini-1.5-flash","gemini-1.5-flash-latest","gemini-1.5-pro-latest","gemini-1.5-pro"),
languages: literals("ar","bn","bg","zh","hr","cs","da","nl",
"en","et","fi","fr","de","el","iw","hi","hu","id","it","ja",
"ko","lv","lt","no","pl","pt","ro","ru","sr","sk","sl","es",
"sw","sv","th","tr","uk","vi")
}

const schema = defineSchema({
...authTables,
...rateLimitTables,
settings: defineTable(settingsSchema)
.index("userId", ["userId"])
.index("languages", ["languages"]),
threads: defineTable({
summary: v.optional(v.string()),
summarizer: v.optional(v.id("_scheduled_functions")),
}).index("by_summary", ["summary"]),
threadsMembers: defineTable({
threadId: v.id("threads"),
userId: v.id("users"),
})
.index("threadId", ["threadId"])
.index("userId", ["userId"]),
messages: defineTable({
message: v.string(),
threadId: v.id("threads"),
author: v.union(
v.object({
role: v.literal("system"),
}),
v.object({
role: v.literal("assistant"),
model: v.optional(v.string()),
}),
v.object({
role: v.literal("user"),
userId: v.id("users"),
})
),
state: literals("success", "generating", "failed"),
})
.index("state", ["state", "author.userId"])
.index("threadId", ["threadId"]),
});
ari
ari5mo ago
Thanks, I'm trying to reproduce but not having any luck here. This one seems pretty inexplicable to me at the moment. Could you try in a different browser, or the same browser with all of your extensions disabled?
Sara
SaraOP5mo ago
could it be the extentiosn that are causing it? I disabled all the extentions and tried for about 5 min to reproduce it, and It didn't happen
Nathaniel
Nathaniel5mo ago
wowww you're so smart
Sara
SaraOP5mo ago
that's my boyfriend, I'm so sorry :xzibit: turns out it was the jobfill extention that was causing this issue, and I wasn't fully aware that it was it a month ago!
ari
ari5mo ago
Glad it’s working now! We’ll need to look into why this extension is deciding to autofill the document form
Sara
SaraOP5mo ago
I can send you a link to it in a bit, It automatically fills out job applications without having to manually fill it everytime, And I think it's caused because I didn't set any routes to the extention, and it just by default selects all urls that it can automatically fill it out I'm an idiot I'm sorry 😂 https://jobfill.ai/ ^ it was this one