tangled
alpha
login
or
join now
leaflet.pub
/
leaflet
289
fork
atom
a tool for shared writing and social publishing
289
fork
atom
overview
issues
28
pulls
pipelines
fix compound cursor logic
awarm.space
5 months ago
e5bcf8c7
cf960e2e
+6
-8
2 changed files
expand all
collapse all
unified
split
app
reader
getReaderFeed.ts
getSubscriptions.ts
+3
-1
app/reader/getReaderFeed.ts
···
36
36
.order("uri", { ascending: false })
37
37
.limit(25);
38
38
if (cursor) {
39
39
-
query = query.lt("indexed_at", cursor.timestamp).lte("uri", cursor.uri);
39
39
+
query = query.or(
40
40
+
`indexed_at.lt.${cursor.timestamp},and(indexed_at.eq.${cursor.timestamp},uri.lt.${cursor.uri})`,
41
41
+
);
40
42
}
41
43
let { data: feed, error } = await query;
42
44
+3
-7
app/reader/getSubscriptions.ts
···
28
28
.eq("identity", auth_res.atp_did);
29
29
30
30
if (cursor) {
31
31
-
query = query.lt("created_at", cursor.timestamp).lte("uri", cursor.uri);
31
31
+
query = query.or(
32
32
+
`created_at.lt.${cursor.timestamp},and(created_at.eq.${cursor.timestamp},uri.lt.${cursor.uri})`,
33
33
+
);
32
34
}
33
35
let { data: pubs, error } = await query;
34
34
-
console.log(cursor);
35
36
36
36
-
const actors: string[] = [
37
37
-
...new Set(
38
38
-
pubs?.map((pub) => pub.publications?.identity_did!).filter(Boolean) || [],
39
39
-
),
40
40
-
];
41
37
const hydratedSubscriptions: PublicationSubscription[] = await Promise.all(
42
38
pubs?.map(async (pub) => {
43
39
let id = await idResolver.did.resolve(pub.publications?.identity_did!);