@convex-dev/agent 0.1.8-alpha.1 → 0.1.8-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/component/streams.d.ts +47 -0
- package/dist/commonjs/component/streams.d.ts.map +1 -1
- package/dist/commonjs/component/streams.js +120 -2
- package/dist/commonjs/component/streams.js.map +1 -1
- package/dist/commonjs/component/threads.d.ts.map +1 -1
- package/dist/commonjs/component/threads.js +9 -0
- package/dist/commonjs/component/threads.js.map +1 -1
- package/dist/commonjs/component/users.d.ts.map +1 -1
- package/dist/commonjs/component/users.js +1 -0
- package/dist/commonjs/component/users.js.map +1 -1
- package/dist/commonjs.tsbuildinfo +1 -1
- package/dist/esm/component/streams.d.ts +47 -0
- package/dist/esm/component/streams.d.ts.map +1 -1
- package/dist/esm/component/streams.js +120 -2
- package/dist/esm/component/streams.js.map +1 -1
- package/dist/esm/component/threads.d.ts.map +1 -1
- package/dist/esm/component/threads.js +9 -0
- package/dist/esm/component/threads.js.map +1 -1
- package/dist/esm/component/users.d.ts.map +1 -1
- package/dist/esm/component/users.js +1 -0
- package/dist/esm/component/users.js.map +1 -1
- package/dist/esm.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/component/streams.ts +148 -2
- package/src/component/threads.ts +8 -0
- package/src/component/users.ts +1 -0
package/src/component/threads.ts
CHANGED
|
@@ -131,6 +131,9 @@ export const deleteAllForThreadIdSync = action({
|
|
|
131
131
|
}
|
|
132
132
|
cursor = result.cursor;
|
|
133
133
|
}
|
|
134
|
+
await ctx.runAction(api.streams.deleteAllStreamsForThreadIdSync, {
|
|
135
|
+
threadId: args.threadId,
|
|
136
|
+
});
|
|
134
137
|
},
|
|
135
138
|
returns: v.null(),
|
|
136
139
|
});
|
|
@@ -154,6 +157,11 @@ export const deleteAllForThreadIdAsync = mutation({
|
|
|
154
157
|
threadId: args.threadId,
|
|
155
158
|
cursor: result.cursor,
|
|
156
159
|
});
|
|
160
|
+
} else {
|
|
161
|
+
// Kick off the streams deletion
|
|
162
|
+
await ctx.scheduler.runAfter(0, api.threads.deleteAllForThreadIdSync, {
|
|
163
|
+
threadId: args.threadId,
|
|
164
|
+
});
|
|
157
165
|
}
|
|
158
166
|
return result;
|
|
159
167
|
},
|
package/src/component/users.ts
CHANGED
|
@@ -156,6 +156,7 @@ async function deletePageForUserId(
|
|
|
156
156
|
});
|
|
157
157
|
await Promise.all(messages.page.map((m) => deleteMessage(ctx, m)));
|
|
158
158
|
if (messages.isDone) {
|
|
159
|
+
// TODO: delete streams - maybe use workpool?
|
|
159
160
|
await ctx.db.delete(threadInProgress);
|
|
160
161
|
threadInProgress = null;
|
|
161
162
|
messagesCursor = null;
|