0.0.9
Publish npm package / publish (push) Failing after 16s

This commit is contained in:
2026-10-08 09:39:38 +02:00
parent 8e3abca9d7
commit 6afe1f7b67
25 changed files with 340 additions and 170 deletions
+13 -13
View File
@@ -59,20 +59,20 @@ func (srv *TodoServer) ListTodos(ctx context.Context, req *connect.Request[todov
Done: BoolPtr(todo.Done.Bool),
})
}
slices.SortFunc(responseTodos, func(a, b *todov1.Todo) int {
dateCmp := cmp.Compare(a.GetCreatedAt(), b.GetCreatedAt())
return dateCmp
})
slices.SortFunc(responseTodos, func(a, b *todov1.Todo) int {
var boolToInt = func(b bool) int {
if b {
return 1
} else {
return 0
}
// Open todos first, each group oldest first. A single total order (SortFunc isn't stable)
// keeps rows from swapping places between polls.
boolToInt := func(b bool) int {
if b {
return 1
}
doneCmp := cmp.Compare(boolToInt(*a.Done), boolToInt(*b.Done))
return doneCmp
return 0
}
slices.SortFunc(responseTodos, func(a, b *todov1.Todo) int {
return cmp.Or(
cmp.Compare(boolToInt(a.GetDone()), boolToInt(b.GetDone())),
cmp.Compare(a.GetCreatedAt(), b.GetCreatedAt()),
cmp.Compare(a.GetId(), b.GetId()),
)
})
return &connect.Response[todov1.ListTodosResponse]{