Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/single_sdk_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ jobs:
run: |
echo "Compiling matrix-rust-sdk @ $RUST_SDK"
cd complement-crypto && ./install_uniffi_bindgen_go.sh && ./rebuild_rust_sdk.sh $RUST_SDK_DIR
patch -p0 < matrix_sdk_ffi.patch

- name: Build RPC client (rust)
if: ${{ inputs.use_rust_sdk != '' }}
Expand Down
47 changes: 47 additions & 0 deletions matrix_sdk_ffi.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
--- internal/api/rust/matrix_sdk_ffi/matrix_sdk_ffi.go.orig 2026-07-23 17:25:04.754939450 +0100
+++ internal/api/rust/matrix_sdk_ffi/matrix_sdk_ffi.go 2026-07-23 17:27:40.408000000 +0100
@@ -19,20 +19,22 @@
"io"
"math"
"runtime"
"runtime/cgo"
"sync"
"sync/atomic"
"time"
"unsafe"
)

+import "os"
+
// This is needed, because as of go 1.24
// type RustBuffer C.RustBuffer cannot have methods,
// RustBuffer is treated as non-local type
type GoRustBuffer struct {
inner C.RustBuffer
}

type RustBufferI interface {
AsReader() *bytes.Reader
Free()
@@ -23494,20 +23496,21 @@
// possible, instead of just storing IDs and coming back to the timeline
// object to look up items.
func (_self *Timeline) GetEventTimelineItemByEventId(eventId string) (EventTimelineItem, error) {
_pointer := _self.ffiObject.incrementPointer("*Timeline")
defer _self.ffiObject.decrementPointer()
res, err := uniffiRustCallAsync[*ClientError](
FfiConverterClientErrorINSTANCE,
// completeFn
func(handle C.uint64_t, status *C.RustCallStatus) RustBufferI {
res := C.ffi_matrix_sdk_ffi_rust_future_complete_rust_buffer(handle, status)
+ fmt.Fprintf(os.Stderr, "GetEventTimelineItemByEventId returned status %d, buffer of length %d\n", status.code, uint64(res.len))
return GoRustBuffer{
inner: res,
}
},
// liftFn
func(ffi RustBufferI) EventTimelineItem {
return FfiConverterEventTimelineItemINSTANCE.Lift(ffi)
},
C.uniffi_matrix_sdk_ffi_fn_method_timeline_get_event_timeline_item_by_event_id(
_pointer, FfiConverterStringINSTANCE.Lower(eventId)),
Loading