Skip to content

Commit 389fd91

Browse files
committed
Fix Convex event ordering index
1 parent 35d7cad commit 389fd91

4 files changed

Lines changed: 16 additions & 15 deletions

File tree

apps/dashboard/AGENTS.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
<!-- convex-ai-start -->
2+
23
This project uses [Convex](https://convex.dev) as its backend.
34

4-
When working on Convex code, **always read `convex/_generated/ai/guidelines.md` first** for important guidelines on how to correctly use Convex APIs and patterns. The file contains rules that override what you may have learned about Convex from training data.
5+
When working on Convex code, **always read `convex/_generated/ai/guidelines.md` first** for important guidelines on how to
6+
correctly use Convex APIs and patterns. The file contains rules that override what you may have learned about Convex from training
7+
data.
58

69
Convex agent skills for common tasks can be installed by running `npx convex ai-files install`.
10+
711
<!-- convex-ai-end -->

apps/dashboard/convex/_generated/api.d.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,22 @@
1111
import type * as _shared_adminToken from "../_shared/adminToken.js";
1212
import type * as auth from "../auth.js";
1313
import type * as bookmarks from "../bookmarks.js";
14+
import type * as crons from "../crons.js";
1415
import type * as dev from "../dev.js";
1516
import type * as events from "../events.js";
1617
import type * as follows from "../follows.js";
17-
import type * as crons from "../crons.js";
1818
import type * as gmailConnection from "../gmailConnection.js";
1919
import type * as gmailOAuth from "../gmailOAuth.js";
2020
import type * as http from "../http.js";
21+
import type * as ingestion from "../ingestion.js";
22+
import type * as listservAdmin from "../listservAdmin.js";
2123
import type * as orgs from "../orgs.js";
24+
import type * as parser from "../parser.js";
2225
import type * as rsvps from "../rsvps.js";
2326
import type * as seed from "../seed.js";
2427
import type * as seedData from "../seedData.js";
25-
import type * as users from "../users.js";
26-
import type * as ingestion from "../ingestion.js";
27-
import type * as listservAdmin from "../listservAdmin.js";
28-
import type * as parser from "../parser.js";
2928
import type * as sourceAdmin from "../sourceAdmin.js";
29+
import type * as users from "../users.js";
3030

3131
import type {
3232
ApiFromModules,
@@ -38,22 +38,22 @@ declare const fullApi: ApiFromModules<{
3838
"_shared/adminToken": typeof _shared_adminToken;
3939
auth: typeof auth;
4040
bookmarks: typeof bookmarks;
41+
crons: typeof crons;
4142
dev: typeof dev;
4243
events: typeof events;
4344
follows: typeof follows;
44-
crons: typeof crons;
4545
gmailConnection: typeof gmailConnection;
4646
gmailOAuth: typeof gmailOAuth;
4747
http: typeof http;
48+
ingestion: typeof ingestion;
49+
listservAdmin: typeof listservAdmin;
4850
orgs: typeof orgs;
51+
parser: typeof parser;
4952
rsvps: typeof rsvps;
5053
seed: typeof seed;
5154
seedData: typeof seedData;
52-
users: typeof users;
53-
ingestion: typeof ingestion;
54-
listservAdmin: typeof listservAdmin;
55-
parser: typeof parser;
5655
sourceAdmin: typeof sourceAdmin;
56+
users: typeof users;
5757
}>;
5858

5959
/**

apps/dashboard/convex/events.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ export const feed = query({
105105
): Promise<Doc<"events">[]> => {
106106
const pool = await ctx.db
107107
.query("events")
108-
.withIndex("by_creation_time")
109108
.order("desc")
110109
.take(RECOMMENDED_POOL_SIZE);
111110
const out: Doc<"events">[] = [];
@@ -203,14 +202,13 @@ export const feed = query({
203202
return [...personalised, ...recent];
204203
};
205204

206-
// "all" scope or signed-out: paginate over all events with by_creation_time
205+
// "all" scope or signed-out: paginate over all events with creation-time
207206
// ordering, then opportunistically backfill the first page with
208207
// recommended events if the page comes up short. We tag every event with
209208
// source = "recommended" because the user has no follow context.
210209
if (scope === "all" || userId === null) {
211210
const result = await ctx.db
212211
.query("events")
213-
.withIndex("by_creation_time")
214212
.order("desc")
215213
.paginate(args.paginationOpts);
216214

apps/dashboard/convex/schema.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,6 @@ export default defineSchema({
465465
.index("by_dedupe_key", ["dedupeKey"])
466466
.index("by_section", ["listservSection"])
467467
.index("by_event_type", ["eventType"])
468-
.index("by_creation_time", ["_creationTime"])
469468
.index("by_seed", ["isSeed"])
470469
.searchIndex("search_events_title", { searchField: "title" })
471470
.searchIndex("search_events_desc", { searchField: "description" }),

0 commit comments

Comments
 (0)