#21 SIGSEGV in "builds list" with invalid access token 3 years ago

Ticket created by ~gpanders on ~xenrox/hut

When the config file contains an invalid access token (e.g. a garbage value like "invalid_token"), running hut builds list results in a SIGSEGV.

System: macOS 12.3.1

Go version: go version go1.18.1 darwin/arm64

Config file:

instance "sr.ht" {
	access-token "something_fake"
}

Reproduce:

hut builds list

Stack trace:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x100bb9d04]

goroutine 1 [running]:
main.newBuildsListCommand.func1(0x14000186000?, {0x1400014a740?, 0x2?, 0x2?})
	/Users/greg/src/hut/builds.go:318 +0x94
github.com/spf13/cobra.(*Command).execute(0x14000186000, {0x1400014a700, 0x2, 0x2})
	/Users/greg/.go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:860 +0x4ac
github.com/spf13/cobra.(*Command).ExecuteC(0x14000154f00)
	/Users/greg/.go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:974 +0x354
github.com/spf13/cobra.(*Command).Execute(...)
	/Users/greg/.go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:902
github.com/spf13/cobra.(*Command).ExecuteContext(...)
	/Users/greg/.go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:895
main.main()
	/Users/greg/src/hut/main.go:49 +0x29c

I ran it in Delve and pinpointed it to this line in builds.go:

for _, job := range jobs.Results {
	printJob(&job)
}

Printing jobs in Delve shows:

(dlv) p jobs
*git.sr.ht/~emersion/hut/srht/buildssrht.JobCursor {
	Results: []git.sr.ht/~emersion/hut/srht/buildssrht.Job len: 0, cap: 0, [],
	Cursor: *(unreadable invalid length: -486054628144709631),}

It looks to me like the cursor is invalid, but I could be misunderstanding what it's supposed to look like.

Notably, this does not happen with other commands such as hut todo list or hut lists list.

#180 Mailing list name should not start with dot 3 years ago

Comment by ~gpanders on ~sircmpwn/lists.sr.ht

#49 Separate username and repository from wiki title 4 years ago

Comment by ~gpanders on ~sircmpwn/man.sr.ht

Looks like this was resolved by this commit.

REPORTED RESOLVED IMPLEMENTED

#49 Separate username and repository from wiki title 4 years ago

Ticket created by ~gpanders on ~sircmpwn/man.sr.ht

Currently the title of the wiki page is displayed alongside the username and repo. This crowds the title and makes the title of the page harder to read (example here).

Consider separating the username and repo from the title of the page, instead displaying it in a different location. This makes it clear the wiki page belongs to a user and is not part of the official sourcehut documentation, while still allowing the title of the page to stand alone.

Further discussion on the mailing list here.

#308 Tag assets persist after tag is deleted 4 years ago

Ticket created by ~gpanders on ~sircmpwn/git.sr.ht

If I upload an asset to a tag (under refs) and then that tag is deleted (either explicitly or if the tag gets moved and pushed with --force), the assets seem to persist and cannot be reuploaded (when I try it says "A file by this name was already uploaded").

Steps to reproduce:

  1. In any git repo, create a new tag (e.g. test)

    git tag -a test -m "Test tag"
    git push --tags
    
  2. In the git.sr.ht web interface, navigate to the refs tab and select the 'test' tag

  3. Upload/attach a file to the ref using the upload form

  4. Move the tag to a different ref and force push it to the remote

    git tag -a test -m "Test tag" -f HEAD^
    git push --tags --force
    
  5. Repeat steps 2-3 (ensure the same file is uploaded from step 3). Step 3 fails with "A file by this name was already uploaded".

As far as I can tell, there is no way to access the attachments from the original ref (before it was moved), so they cannot be deleted.

#95 Give user option to save/pipe/etc messages with unsupported mimetypes 5 years ago

Comment by ~gpanders on ~sircmpwn/aerc2

I took a stab at this here.

#299 select fields in compose form via mouse 5 years ago

Comment by ~gpanders on ~sircmpwn/aerc2

Patch here