fix: 🚨 Enable more Biome 2.0 rules
Some checks failed
CodeQL Scan / Analyze (javascript-typescript) (push) Failing after 4s
Build Docker Images / lint (push) Failing after 10s
Build Docker Images / check (push) Failing after 10s
Build Docker Images / tests (push) Failing after 6s
Deploy Docs to GitHub Pages / build (push) Failing after 0s
Build Docker Images / build (server, Dockerfile, ${{ github.repository_owner }}/server) (push) Has been skipped
Build Docker Images / build (worker, Worker.Dockerfile, ${{ github.repository_owner }}/worker) (push) Has been skipped
Deploy Docs to GitHub Pages / Deploy (push) Has been skipped
Mirror to Codeberg / Mirror (push) Failing after 0s
Nix Build / check (push) Failing after 0s

This commit is contained in:
Jesse Wierzbinski 2025-04-10 19:56:42 +02:00
parent 963173cdae
commit 1679585c4c
No known key found for this signature in database
21 changed files with 116 additions and 53 deletions

View file

@ -141,11 +141,11 @@ export class Timeline<Type extends Note | User | Notification> {
if (notes.length >= (limit ?? 20)) {
const objectAfter = await Note.fromSql(
gt(Notes.id, notes[notes.length - 1].data.id),
gt(Notes.id, notes.at(-1)?.data.id ?? ""),
);
if (objectAfter) {
linkHeader.push(
`<${urlWithoutQuery}?limit=${limit ?? 20}&max_id=${notes[notes.length - 1].data.id}>; rel="next"`,
`<${urlWithoutQuery}?limit=${limit ?? 20}&max_id=${notes.at(-1)?.data.id}>; rel="next"`,
);
}
}
@ -169,11 +169,11 @@ export class Timeline<Type extends Note | User | Notification> {
if (users.length >= (limit ?? 20)) {
const objectAfter = await User.fromSql(
gt(Users.id, users[users.length - 1].id),
gt(Users.id, users.at(-1)?.id ?? ""),
);
if (objectAfter) {
linkHeader.push(
`<${urlWithoutQuery}?limit=${limit ?? 20}&max_id=${users[users.length - 1].id}>; rel="next"`,
`<${urlWithoutQuery}?limit=${limit ?? 20}&max_id=${users.at(-1)?.id}>; rel="next"`,
);
}
}
@ -199,14 +199,11 @@ export class Timeline<Type extends Note | User | Notification> {
if (notifications.length >= (limit ?? 20)) {
const objectAfter = await Notification.fromSql(
gt(
Notifications.id,
notifications[notifications.length - 1].data.id,
),
gt(Notifications.id, notifications.at(-1)?.data.id ?? ""),
);
if (objectAfter) {
linkHeader.push(
`<${urlWithoutQuery}?limit=${limit ?? 20}&max_id=${notifications[notifications.length - 1].data.id}>; rel="next"`,
`<${urlWithoutQuery}?limit=${limit ?? 20}&max_id=${notifications.at(-1)?.data.id}>; rel="next"`,
);
}
}

View file

@ -499,7 +499,7 @@ export class User extends BaseInterface<typeof Users, UserWithRelations> {
await note.author.notify("favourite", this, note);
} else if (this.local && note.author.remote) {
// Federate the like
this.federateToFollowers(newLike.toVersia());
await this.federateToFollowers(newLike.toVersia());
}
return newLike;
@ -528,7 +528,7 @@ export class User extends BaseInterface<typeof Users, UserWithRelations> {
await likeToDelete.clearRelatedNotifications();
} else if (this.local && note.author.remote) {
// User is local, federate the delete
this.federateToFollowers(likeToDelete.unlikeToVersia(this));
await this.federateToFollowers(likeToDelete.unlikeToVersia(this));
}
}