rusq / slackdump

Save or export your private and public Slack messages, threads, files, and users locally without admin privileges.
GNU General Public License v3.0
1.6k stars 72 forks source link

TestSave/all_info_present fails with release 2.5.10 #318

Closed iyanmv closed 3 months ago

iyanmv commented 3 months ago

Describe the bug Hey! I maintain the slackdump AUR package for Arch Linux (thanks for providing this app btw 😉), and I was going to bump the version to the latest (2.5.9 -> 2.5.10) but I noticed that one of the tests fails now.

This is what I get when I run go test ./...:

--- FAIL: TestSave (0.00s)
    --- FAIL: TestSave/all_info_present (0.00s)
        auth_test.go:112: Save() = {"Token":"token_value","Cookie":[{"Name":"d","Value":"abc","Quoted":false,"Path":"","Domain":"","Expires":"0001-01-01T00:00:00Z","RawExpires":"","MaxAge":0,"Secure":false,"HttpOnly":false,"SameSite":0,"Partitioned":false,"Raw":"","Unparsed":null}]}
            , want {"Token":"token_value","Cookie":[{"Name":"d","Value":"abc","Path":"","Domain":"","Expires":"0001-01-01T00:00:00Z","RawExpires":"","MaxAge":0,"Secure":false,"HttpOnly":false,"SameSite":0,"Raw":"","Unparsed":null}]}
FAIL

I seems that the two versions differ in the "Quoted":false and the "Partitioned":false.

To Reproduce Steps to reproduce the behavior:

  1. Download latest tarball
  2. Compile with go build -o build ./cmd/... (if it matters, I use this GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw")
  3. Run tests with go test ./...

Expected behavior All tests pass.

Output Already included above

Desktop (please complete the following information):

rusq commented 3 months ago

Hey @iyanmv thank you for your effort maintaining the AUR package, it's funny because couple of days ago I was reading comments under it regarding the placement of files. Let me know if I can help with something.

I suspect that you're building with go version 1.23, which has introduced additional fields "Quoted" and "Partitioned" into the http.Cookie structure. Diff: 1.22 vs 1.23.

I'll bump the build environment for v2 to go 1.23, update the tests and release 2.5.11, then it should work.

rusq commented 3 months ago

v2.5.11 is building. I also added the CI step to build with the parameters that you use for AUR builds, just in case.

iyanmv commented 3 months ago

Cool, thanks!