chore: sync td exact-layer projection
Sync telesrv 9e68b9b (chore(protocol): consume td exact-layer projection). Updates the public iamxvbaba/td dependency to v1.1.2 without a local replace.
This commit is contained in:
parent
08c763b683
commit
004365ed48
3 changed files with 21 additions and 9 deletions
2
go.mod
2
go.mod
|
|
@ -8,7 +8,7 @@ require (
|
|||
github.com/golang-migrate/migrate/v4 v4.19.1
|
||||
github.com/gotd/ige v0.2.2
|
||||
github.com/gotd/log/logzap v0.1.1
|
||||
github.com/iamxvbaba/td v1.1.1
|
||||
github.com/iamxvbaba/td v1.1.2
|
||||
github.com/jackc/pgerrcode v0.0.0-20220416144525-469b46aa5efa
|
||||
github.com/jackc/pgx/v5 v5.9.2
|
||||
github.com/pion/datachannel v1.6.2
|
||||
|
|
|
|||
6
go.sum
6
go.sum
|
|
@ -78,10 +78,8 @@ github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY
|
|||
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/go-multierror v1.1.0 h1:B9UzwGQJehnUY1yNrnwREHc3fGbC2xefo8g4TbElacI=
|
||||
github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA=
|
||||
github.com/iamxvbaba/td v1.1.0 h1:6Ddxi8sOuxOioGs3vyDGWlC6q53j4AQ2hFJ4AirJvFk=
|
||||
github.com/iamxvbaba/td v1.1.0/go.mod h1:oG/fu7sqGC7NznoBD8f3fmTy9NFR42+DMNtdCPStX04=
|
||||
github.com/iamxvbaba/td v1.1.1 h1:KPHWqtxnEbcW3/eBWVfD6/GMWwO8/iPeq5yZbbM6WJI=
|
||||
github.com/iamxvbaba/td v1.1.1/go.mod h1:oG/fu7sqGC7NznoBD8f3fmTy9NFR42+DMNtdCPStX04=
|
||||
github.com/iamxvbaba/td v1.1.2 h1:BXmmmAHG9VCLud4zwePyRdKlbwYXMQbTsCxhCd+4xfc=
|
||||
github.com/iamxvbaba/td v1.1.2/go.mod h1:oG/fu7sqGC7NznoBD8f3fmTy9NFR42+DMNtdCPStX04=
|
||||
github.com/jackc/pgerrcode v0.0.0-20220416144525-469b46aa5efa h1:s+4MhCQ6YrzisK6hFJUX53drDT4UsSW3DEhKn0ifuHw=
|
||||
github.com/jackc/pgerrcode v0.0.0-20220416144525-469b46aa5efa/go.mod h1:a/s9Lp5W7n/DD0VrVoyJ00FbP2ytTPDVOivvn2bMlds=
|
||||
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
|
||||
|
|
|
|||
|
|
@ -1431,7 +1431,7 @@ func TestMessagesSearchGlobalExactLayerProfiles(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestMessagesSearchGlobalCommunityProjectionFailsClosedForLayer227(t *testing.T) {
|
||||
func TestMessagesSearchGlobalCommunityFieldIsAbsentFromLayer227Wire(t *testing.T) {
|
||||
request := &tg.MessagesSearchGlobalRequest{
|
||||
Q: "scoped",
|
||||
Filter: &tg.InputMessagesFilterEmpty{},
|
||||
|
|
@ -1453,11 +1453,25 @@ func TestMessagesSearchGlobalCommunityProjectionFailsClosedForLayer227(t *testin
|
|||
}
|
||||
|
||||
var body227 bin.Buffer
|
||||
if err := tlprofile.EncodeObject(tlprofile.Profile227, request, &body227); err == nil {
|
||||
t.Fatal("Layer 227 projection accepted a Layer 228-only community scope")
|
||||
if err := tlprofile.EncodeObject(tlprofile.Profile227, request, &body227); err != nil {
|
||||
t.Fatalf("encode Layer 227 searchGlobal: %v", err)
|
||||
}
|
||||
decoded, err := tlprofile.DecodeObject(tlprofile.Profile227, &bin.Buffer{Buf: body227.Copy()}, tlprofile.Limits{})
|
||||
if err != nil {
|
||||
t.Fatalf("decode Layer 227 searchGlobal: %v", err)
|
||||
}
|
||||
legacy, ok := decoded.(*tg.MessagesSearchGlobalRequest)
|
||||
if !ok {
|
||||
t.Fatalf("decoded Layer 227 request = %T", decoded)
|
||||
}
|
||||
if _, ok := legacy.GetCommunity(); ok {
|
||||
t.Fatal("Layer 227 wire retained the Layer 228-only community scope")
|
||||
}
|
||||
if _, err := New(Config{}, Deps{}, zaptest.NewLogger(t), clock.System).AdmitLayer(tlprofile.Profile227, &body227, tlprofile.Limits{}); err != nil {
|
||||
t.Fatalf("admit Layer 227 searchGlobal: %v", err)
|
||||
}
|
||||
if body227.Len() != 0 {
|
||||
t.Fatalf("failed Layer 227 projection emitted %d partial bytes", body227.Len())
|
||||
t.Fatalf("Layer 227 community-free admission left %d bytes", body227.Len())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue