diff --git a/.github/workflows/single_sdk_tests.yml b/.github/workflows/single_sdk_tests.yml index 6b2459b..0a5252e 100644 --- a/.github/workflows/single_sdk_tests.yml +++ b/.github/workflows/single_sdk_tests.yml @@ -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 != '' }} diff --git a/matrix_sdk_ffi.patch b/matrix_sdk_ffi.patch new file mode 100644 index 0000000..837d585 --- /dev/null +++ b/matrix_sdk_ffi.patch @@ -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)),