fix: uses the same base64 for decoding we use for encoding the UsageCursor (#64290)

At the moment we decode via the "Std" encoding, which expects padding
but we encode with "Raw" which doesn't add any.

## Test plan

Manual testing
This commit is contained in:
Christoph Hegemann 2024-08-06 11:38:00 +02:00 committed by GitHub
parent c09552ed15
commit 4ebb805bd3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,8 +2,6 @@ package resolvers
import (
"context"
"encoding/base64"
"encoding/json"
"fmt"
"path"
"strings"
@ -343,13 +341,10 @@ func (args *UsagesForSymbolArgs) Resolve(
}
var cursor codenav.UsagesCursor
if args.After != nil {
bytes, err := base64.StdEncoding.DecodeString(*args.After)
cursor, err = codenav.DecodeUsagesCursor(*args.After)
if err != nil {
return out, errors.Wrap(err, "invalid after: cursor")
}
if err = json.Unmarshal(bytes, &cursor); err != nil {
return out, errors.Wrap(err, "invalid after: cursor")
}
} else {
cursor.CursorType = codenav.CursorTypeDefinitions
}