~netlandish/links-dev

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH links] api: return error when an invalid cursor is given

Details
Message ID
<20260323190342.20723-1-peter@netlandish.com>
Sender timestamp
1774271001
DKIM signature
missing
Download raw message
Patch: +3 -5
Changelog-updated: api will now return an error when an invalid cursor
 is given.
Changelog-updated: api version bumped to 0.11.3
---
Annoying abusers having fun sending me error emails

 api/graph/model/cursor.go     | 6 ++----
 api/graph/schema.resolvers.go | 2 +-
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/api/graph/model/cursor.go b/api/graph/model/cursor.go
index 644c56e..3e04a20 100644
--- a/api/graph/model/cursor.go
+++ b/api/graph/model/cursor.go
@@ -29,10 +29,8 @@ func (c *Cursor) UnmarshalGQL(v any) error {
	if plain == nil || err != nil {
		return fmt.Errorf("Invalid cursor")
	}
	err = json.Unmarshal(plain, c)
	if err != nil {
		// This is guaranteed to be a programming error
		panic(err)
	if err = json.Unmarshal(plain, c); err != nil {
		return fmt.Errorf("Invalid cursor")
	}
	return nil
}
diff --git a/api/graph/schema.resolvers.go b/api/graph/schema.resolvers.go
index f4990c3..9610a1d 100644
--- a/api/graph/schema.resolvers.go
+++ b/api/graph/schema.resolvers.go
@@ -5127,7 +5127,7 @@ func (r *queryResolver) Version(ctx context.Context) (*model.Version, error) {
	return &model.Version{
		Major:           0,
		Minor:           11,
		Patch:           2,
		Patch:           3,
		DeprecationDate: nil,
	}, nil
}
-- 
2.52.0
Details
Message ID
<DHAEACBPBCGL.186HT2U9HYBWS@netlandish.com>
In-Reply-To
<20260323190342.20723-1-peter@netlandish.com> (view parent)
Sender timestamp
1774271149
DKIM signature
missing
Download raw message
Applied.

To git@git.code.netlandish.com:~netlandish/links
   e4a7eb8..270b525  master -> master
Reply to thread Export thread (mbox)