refactor: sync sparse tlprofile runtime

This commit is contained in:
A 2026-07-16 21:36:32 +08:00
parent 5ecf4e912d
commit 25ab04a254
93 changed files with 2983 additions and 1615 deletions

View file

@ -16,6 +16,17 @@ import (
"testing"
)
// dispatchCanonicalValue exposes the handler value behind tlprofile's exact
// result encoder. Object/class results already arrive as concrete tg values;
// primitive and Vector<T> method results remain attached to the exact result
// plan because they are not bin.Object values.
func dispatchCanonicalValue(encoded bin.Encoder) any {
if result, ok := encoded.(interface{ CanonicalValue() any }); ok {
return result.CanonicalValue()
}
return encoded
}
type rpcChannelFixture struct {
t *testing.T
ctx context.Context
@ -111,8 +122,6 @@ func searchMessagesPayload(t *testing.T, enc bin.Encoder) ([]tg.MessageClass, []
return result.Messages, result.Chats, result.Users
case *tg.MessagesChannelMessages:
return result.Messages, result.Chats, result.Users
case *tg.MessagesMessagesBox:
return searchMessagesPayload(t, result.Messages)
default:
t.Fatalf("search result type = %T, want messages/messagesSlice", enc)
return nil, nil, nil