diamondburned / dissent

Tiny native Discord app
https://flathub.org/apps/details/so.libdb.dissent
GNU General Public License v3.0
1.27k stars 40 forks source link

bug: panic: interface conversion: ast.Node is *ast.Paragraph, not *ast.ListItem [recovered] #253

Open diamondburned opened 6 months ago

diamondburned commented 6 months ago
02:35:42.654 INF Parsing content: "+ a lot of my trans friends hang out in PNW and a lot of normal people would really not be ok w/ the stuff we do together as \"friends\"\nso yea"
panic: interface conversion: ast.Node is *ast.Paragraph, not *ast.ListItem [recovered]
    panic: closure error: unexpected panic caught: interface conversion: ast.Node is *ast.Paragraph, not *ast.ListItem

Closure added at:
    github.com/diamondburned/gotk4/pkg/gtk/v4.(*EventControllerKey).ConnectKeyPressed at /home/diamond/.go/pkg/mod/github.com/diamondburned/gotk4/pkg@v0.2.2/gtk/v4/gtk.go:47681
    libdb.so/dissent/internal/messages/composer.NewInput at /home/diamond/Scripts/gotk4/dissent/internal/messages/composer/input.go:156
    libdb.so/dissent/internal/messages/composer.NewView at /home/diamond/Scripts/gotk4/dissent/internal/messages/composer/composer.go:156

goroutine 1 [running, locked to thread]:
github.com/diamondburned/gotk4/pkg/core/closure.(*FuncStack).Panicf(0xc006084de0, {0x25f2ea2, 0x1b}, {0xc001601c60, 0x1, 0x1})
    /home/diamond/.go/pkg/mod/github.com/diamondburned/gotk4/pkg@v0.2.2/core/closure/funcstack.go:104 +0x928
github.com/diamondburned/gotk4/pkg/core/closure.(*FuncStack).TryRepanic(0x1e0?)
    /home/diamond/.go/pkg/mod/github.com/diamondburned/gotk4/pkg@v0.2.2/core/closure/funcstack.go:122 +0xc5
panic({0x2220ee0?, 0xc006efa510?})
    /nix/store/6qd8p8gilzgplpk2ni3109m0k71r21s7-go-1.21.5/share/go/src/runtime/panic.go:914 +0x21f
github.com/yuin/goldmark/parser.lastOffset(...)
    /home/diamond/.go/pkg/mod/github.com/yuin/goldmark@v1.5.6/parser/list.go:107
github.com/yuin/goldmark/parser.(*listParser).Continue(0xc002034620?, {0x2905620?, 0xc0040126c0}, {0x2900390, 0xc002034620}, {0x2900bc0, 0xc002034540})
    /home/diamond/.go/pkg/mod/github.com/yuin/goldmark@v1.5.6/parser/list.go:195 +0x4b8
github.com/yuin/goldmark/parser.(*parser).parseBlocks(0x7f753dd1cd28?, {0x2904ae0, 0xc004012630}, {0x2900390, 0xc002034620}, {0x2900bc0, 0xc002034540})
    /home/diamond/.go/pkg/mod/github.com/yuin/goldmark@v1.5.6/parser/parser.go:1093 +0x5ae
github.com/yuin/goldmark/parser.(*parser).Parse(0xc001064000, {0x2900390, 0xc002034620}, {0xc00527bea8, 0x1, 0x20841d0?})
    /home/diamond/.go/pkg/mod/github.com/yuin/goldmark@v1.5.6/parser/parser.go:876 +0x153
github.com/diamondburned/ningen/v3/discordmd.ParseWithMessage({0xc0033673b0, 0x8d, 0x90}, {{0x28e6a50, 0xc00019e420}, {0x28eb1f0, 0xc000003d70}, {0x28e7688, 0xc0005b5740}, {0x28e82e0, ...}, ...}, ...)
    /home/diamond/.go/pkg/mod/github.com/diamondburned/ningen/v3@v3.0.1-0.20240215053437-0d35ff052647/discordmd/md.go:43 +0x61a
libdb.so/dissent/internal/messages.(*Content).Update(0xc001f1ad80, 0xc003b40240, {0x0, 0x0, 0xc001603108?})
    /home/diamond/Scripts/gotk4/dissent/internal/messages/content.go:241 +0x1025
libdb.so/dissent/internal/messages.(*message).update(0xc005d20a20, {0x28fc500, 0xc005d20a00}, 0xc003b40240)
    /home/diamond/Scripts/gotk4/dissent/internal/messages/message.go:87 +0x6d
libdb.so/dissent/internal/messages.(*cozyMessage).Update(0xc005d20a00, 0xc003b40240)
    /home/diamond/Scripts/gotk4/dissent/internal/messages/message.go:288 +0x53
libdb.so/dissent/internal/messages.(*View).SendMessage(0xc004c8cb40, {{0xc003367320, 0x8d}, {0x4748180, 0x0, 0x0}, 0x0, 0x0})
    /home/diamond/Scripts/gotk4/dissent/internal/messages/view.go:1051 +0x518
libdb.so/dissent/internal/messages/composer.(*View).send(0xc003d822d0)
    /home/diamond/Scripts/gotk4/dissent/internal/messages/composer/composer.go:449 +0x1d8
libdb.so/dissent/internal/messages/composer.inputControllerView.Send({0xc003367170?})
    /home/diamond/Scripts/gotk4/dissent/internal/messages/composer/composer.go:615 +0x13
libdb.so/dissent/internal/messages/composer.(*Input).onKey(0xc002e15bd0, 0xc006084fc0?, 0xc006084f30?, 0x0)
    /home/diamond/Scripts/gotk4/dissent/internal/messages/composer/input.go:237 +0x119
github.com/diamondburned/gotk4/pkg/gtk/v4._gotk4_gtk4_EventControllerKey_ConnectKeyPressed(0xc001603710?, 0xff0d, 0x24, 0x4fafc5?, 0xc0000061a0?)
    /home/diamond/.go/pkg/mod/github.com/diamondburned/gotk4/pkg@v0.2.2/gtk/v4/gtk_export.go:4980 +0x97
github.com/diamondburned/gotk4/pkg/gio/v2._Cfunc_g_application_run(0x496e670, 0x1, 0x4972ee0)
    _cgo_gotypes.go:13791 +0x4b
github.com/diamondburned/gotk4/pkg/gio/v2.(*Application).Run.func3(0xc000555690?, 0x9?, 0x4972ee0?)
    /home/diamond/.go/pkg/mod/github.com/diamondburned/gotk4/pkg@v0.2.2/gio/v2/gio.go:41611 +0x67
github.com/diamondburned/gotk4/pkg/gio/v2.(*Application).Run(0xc0005b4c18, {0xc0000360c0?, 0x1, 0x1})
    /home/diamond/.go/pkg/mod/github.com/diamondburned/gotk4/pkg@v0.2.2/gio/v2/gio.go:41611 +0x20e
github.com/diamondburned/gotkit/app.(*Application).Run(0xc000228400, {0xc0000360c0, 0x1, 0x1})
    /home/diamond/.go/pkg/mod/github.com/diamondburned/gotkit@v0.0.0-20240214122856-34324269516c/app/app.go:272 +0x14f
github.com/diamondburned/gotkit/app.(*Application).RunMain(0x28f17e0?)
    /home/diamond/.go/pkg/mod/github.com/diamondburned/gotkit@v0.0.0-20240214122856-34324269516c/app/app.go:277 +0x28
main.main()
    /home/diamond/Scripts/gotk4/dissent/main.go:70 +0x6c5
exit status 2