Skip to content

Testing: Helper http matrix xmpp#63

Closed
selfhoster1312 wants to merge 11 commits intomatterbridge-org:masterfrom
selfhoster1312:helper-http-matrix-xmpp
Closed

Testing: Helper http matrix xmpp#63
selfhoster1312 wants to merge 11 commits intomatterbridge-org:masterfrom
selfhoster1312:helper-http-matrix-xmpp

Conversation

@selfhoster1312
Copy link
Collaborator

Don't merge this is only for testing purposes, to prebuild the binaries.

Contains PRs #59 #23 and #61

@poVoq
Copy link
Collaborator

poVoq commented Dec 7, 2025

Trying to share an image on the Matrix side with this build results in the following error in the Matterbridge logs:

level=error msg="&fmt.wrapError{msg:"HTTP server responded non-OK code: https://matrix.f-hub.org/_matrix/client/v1/media/download/matrix.f-hub.org/nyeNiuHtTUnDujeOIlWMuZRA returned code 401", err:(*errors.errorString)(0x37f49e0)}" prefix=matrix

Not sure how those URLs should look like, but maybe the matrix.f-hub.org duplication is the problem?

Edit: No, that URL seems fine, but if you open it in a browser you get a "missing access token" error in json.

@selfhoster1312 selfhoster1312 force-pushed the helper-http-matrix-xmpp branch from 4b3549d to 45d87b2 Compare December 8, 2025 10:05
@selfhoster1312
Copy link
Collaborator Author

My bad i forgot to actually set the Authorization header. This should be fixed could you try again please?

@selfhoster1312
Copy link
Collaborator Author

I also added the image's metadata as proposed in upstream PR. Ready to test again @poVoq :)

@poVoq
Copy link
Collaborator

poVoq commented Dec 8, 2025

Tested it again, still the same error in the logs.

@poVoq
Copy link
Collaborator

poVoq commented Dec 8, 2025

Full relevant log with -debug enabled:

[0154] DEBUG matrix:       [handleEvent:matterbridge/bridge/matrix/matrix.go:522] == Receiving event: &gomatrix.Event{StateKey:(*string)(nil), Sender:"@povoq:matrix.org", Type:"m.room.message", Timestamp:1765208676381, ID:"$1uG2WqhHq0RYklR2x9dl_2MeclVwSyGZTyLIEfkchJs", RoomID:"!hdXqFOSejEDijaHqta:matrix.f-hub.org", Redacts:"", Unsigned:map[string]interface {}{"membership":"join"}, Content:map[string]interface {}{"body":"dumpsterfire_cute.jpg", "info":map[string]interface {}{"h":933, "mimetype":"image/jpeg", "size":78509, "w":1125, "xyz.amorgan.blurhash":"LTIN:tk7ZZM~_lS0TbODAeRk=rkR"}, "m.mentions":map[string]interface {}{}, "msgtype":"m.image", "url":"mxc://matrix.org/IQvqunCIVXgJrQVzPdcYSKsA"}, PrevContent:map[string]interface {}(nil)}
[0154] ERROR matrix:       [func1:matterbridge/bridge/matrix/matrix.go:502] &fmt.wrapError{msg:"HTTP server responded non-OK code: https://matrix.f-hub.org/_matrix/client/v1/media/download/matrix.org/IQvqunCIVXgJrQVzPdcYSKsA returned code 401", err:(*errors.errorString)(0x37fba40)}

@selfhoster1312 selfhoster1312 force-pushed the helper-http-matrix-xmpp branch from 6083a28 to f46a1b6 Compare December 8, 2025 16:08
@poVoq
Copy link
Collaborator

poVoq commented Dec 8, 2025

Still not working, but the logs are now:

[0068] DEBUG matrix:       [handleEvent:matterbridge/bridge/matrix/matrix.go:522] == Receiving event: &gomatrix.Event{StateKey:(*string)(nil), Sender:"@povoq:matrix.org", Type:"m.room.message", Timestamp:1765210849701, ID:"$J8F3IiSJJr9tObHsQLy2T6GEfcK-_P6H-Jy5f0M3eBI", RoomID:"!hdXqFOSejEDijaHqta:matrix.f-hub.org", Redacts:"", Unsigned:map[string]interface {}{"membership":"join"}, Content:map[string]interface {}{"body":"frogs_politics.webp", "info":map[string]interface {}{"h":880, "mimetype":"image/webp", "org.matrix.msc4230.is_animated":false, "size":38422, "thumbnail_info":map[string]interface {}{"h":600, "mimetype":"image/png", "size":162349, "w":490}, "thumbnail_url":"mxc://matrix.org/dDYReRFIixUXFSenrZgClOXp", "w":720, "xyz.amorgan.blurhash":"TXKU_=fk~Xxvj[jD4.j[MyD$ayo#"}, "m.mentions":map[string]interface {}{}, "msgtype":"m.image", "url":"mxc://matrix.org/bZgLlRbXgwtkgPrvxVuyuvSB"}, PrevContent:map[string]interface {}(nil)}
[0068] DEBUG matrix:       [HttpGetBytes:matterbridge/bridge/bridge.go:194] Getting HTTP bytes with request: &http.Request{Method:"GET", URL:(*url.URL)(0xc000376360), Proto:"HTTP/1.1", ProtoMajor:1, ProtoMinor:1, Header:http.Header{}, Body:io.ReadCloser(nil), GetBody:(func() (io.ReadCloser, error))(nil), ContentLength:0, TransferEncoding:[]string(nil), Close:false, Host:"matrix.f-hub.org", Form:url.Values(nil), PostForm:url.Values(nil), MultipartForm:(*multipart.Form)(nil), Trailer:http.Header(nil), RemoteAddr:"", RequestURI:"", TLS:(*tls.ConnectionState)(nil), Cancel:(<-chan struct {})(nil), Response:(*http.Response)(nil), Pattern:"", ctx:context.backgroundCtx{emptyCtx:context.emptyCtx{}}, pat:(*http.pattern)(nil), matches:[]string(nil), otherValues:map[string]string(nil)}
[0069] ERROR matrix:       [func1:matterbridge/bridge/matrix/matrix.go:502] &fmt.wrapError{msg:"HTTP server responded non-OK code: https://matrix.f-hub.org/_matrix/client/v1/media/download/matrix.org/bZgLlRbXgwtkgPrvxVuyuvSB returned code 401", err:(*errors.errorString)(0x37fba40)}

@selfhoster1312 selfhoster1312 force-pushed the helper-http-matrix-xmpp branch from f46a1b6 to 20534f9 Compare December 8, 2025 16:44
@selfhoster1312
Copy link
Collaborator Author

So apparently in order to do proper inheritance we need to declare the Http methods in the Bridger interface, then call explicitly the bridger methods in the bridge methods.

@poVoq
Copy link
Collaborator

poVoq commented Dec 8, 2025

looks like it is working now.

@selfhoster1312
Copy link
Collaborator Author

@poVoq i just pushed a new commit you can use the binaries from this PR to test the fix for xmppo/go-xmpp#223

@selfhoster1312
Copy link
Collaborator Author

Closing in favor of #23, #59, and #61

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants