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
.order("uri", { ascending: false })
37
.limit(25);
38
if (cursor) {
39
-
query = query.lt("indexed_at", cursor.timestamp).lte("uri", cursor.uri);
0
0
40
}
41
let { data: feed, error } = await query;
42
···
36
.order("uri", { ascending: false })
37
.limit(25);
38
if (cursor) {
39
+
query = query.or(
40
+
`indexed_at.lt.${cursor.timestamp},and(indexed_at.eq.${cursor.timestamp},uri.lt.${cursor.uri})`,
41
+
);
42
}
43
let { data: feed, error } = await query;
44
+3
-7
app/reader/getSubscriptions.ts
···
28
.eq("identity", auth_res.atp_did);
29
30
if (cursor) {
31
-
query = query.lt("created_at", cursor.timestamp).lte("uri", cursor.uri);
0
0
32
}
33
let { data: pubs, error } = await query;
34
-
console.log(cursor);
35
36
-
const actors: string[] = [
37
-
...new Set(
38
-
pubs?.map((pub) => pub.publications?.identity_did!).filter(Boolean) || [],
39
-
),
40
-
];
41
const hydratedSubscriptions: PublicationSubscription[] = await Promise.all(
42
pubs?.map(async (pub) => {
43
let id = await idResolver.did.resolve(pub.publications?.identity_did!);
···
28
.eq("identity", auth_res.atp_did);
29
30
if (cursor) {
31
+
query = query.or(
32
+
`created_at.lt.${cursor.timestamp},and(created_at.eq.${cursor.timestamp},uri.lt.${cursor.uri})`,
33
+
);
34
}
35
let { data: pubs, error } = await query;
0
36
0
0
0
0
0
37
const hydratedSubscriptions: PublicationSubscription[] = await Promise.all(
38
pubs?.map(async (pub) => {
39
let id = await idResolver.did.resolve(pub.publications?.identity_did!);