From 252cd67fbc0aed6e8b06790bfecb804f75685d23 Mon Sep 17 00:00:00 2001 From: mcrakhman Date: Tue, 21 May 2024 10:59:30 +0200 Subject: [PATCH 1/2] GO-3495 Update any-sync --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 9579935609..81bcc907d4 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/PuerkitoBio/goquery v1.9.2 github.com/VividCortex/ewma v1.2.0 github.com/adrium/goheif v0.0.0-20230113233934-ca402e77a786 - github.com/anyproto/any-sync v0.4.16 + github.com/anyproto/any-sync v0.4.18-0.20240519122304-fab12e7b4a1c github.com/anyproto/go-naturaldate/v2 v2.0.2-0.20230524105841-9829cfd13438 github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de github.com/avast/retry-go/v4 v4.6.0 diff --git a/go.sum b/go.sum index 3ed3c754fe..9d20d77ef9 100644 --- a/go.sum +++ b/go.sum @@ -91,6 +91,8 @@ github.com/andybalholm/cascadia v1.3.2 h1:3Xi6Dw5lHF15JtdcmAHD3i1+T8plmv7BQ/nsVi github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6lUvCFb+h7KvU= github.com/anyproto/any-sync v0.4.16 h1:oD2Ag0/a+oCWPxfK0BQiisOmYqAkDTqcFHyVJR0Dw8g= github.com/anyproto/any-sync v0.4.16/go.mod h1:q/RpyR97Flj5Ao3tMR/Sr/IV6kVWpAzTIsS4qqzxDGU= +github.com/anyproto/any-sync v0.4.18-0.20240519122304-fab12e7b4a1c h1:Ijn1+oTfM4GYEZBC6wlB48x13vyZ8cBQssqoU/vpqq0= +github.com/anyproto/any-sync v0.4.18-0.20240519122304-fab12e7b4a1c/go.mod h1:hXa0S/3RxmjomMCF7D504fBVmdDc/p08OFSf+cslJWE= github.com/anyproto/badger/v4 v4.2.1-0.20240110160636-80743fa3d580 h1:Ba80IlCCxkZ9H1GF+7vFu/TSpPvbpDCxXJ5ogc4euYc= github.com/anyproto/badger/v4 v4.2.1-0.20240110160636-80743fa3d580/go.mod h1:T/uWAYxrXdaXw64ihI++9RMbKTCpKd/yE9+saARew7k= github.com/anyproto/go-chash v0.1.0 h1:I9meTPjXFRfXZHRJzjOHC/XF7Q5vzysKkiT/grsogXY= From e458ec64a460880e14649735bb5fcbe8ccbed83f Mon Sep 17 00:00:00 2001 From: mcrakhman Date: Tue, 21 May 2024 11:24:47 +0200 Subject: [PATCH 2/2] GO-3495 Update any-sync and add locks to check where locks are missing --- core/block/editor/factory.go | 4 +++- core/payments/payments.go | 1 - go.mod | 2 +- go.sum | 2 ++ 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/core/block/editor/factory.go b/core/block/editor/factory.go index ff2eb88928..a81df768de 100644 --- a/core/block/editor/factory.go +++ b/core/block/editor/factory.go @@ -120,8 +120,10 @@ func (f *ObjectFactory) InitObject(space smartblock.Space, id string, initCtx *s sb.SetLocker(ot) } - // we probably don't need any locks here, because the object is initialized synchronously initCtx.Source = sc + // adding locks as a temporary measure to find the place where we have races in our code + sb.Lock() + defer sb.Unlock() err = sb.Init(initCtx) if err != nil { return nil, fmt.Errorf("init smartblock: %w", err) diff --git a/core/payments/payments.go b/core/payments/payments.go index f360dfbe11..f8b5333382 100644 --- a/core/payments/payments.go +++ b/core/payments/payments.go @@ -872,7 +872,6 @@ func (s *service) VerifyAppStoreReceipt(ctx context.Context, req *pb.RpcMembersh verifyReq := proto.VerifyAppStoreReceiptRequest{ // payment node will check if signature matches with this OwnerAnyID OwnerAnyId: s.wallet.Account().SignKey.GetPublic().Account(), - BillingID: req.BillingId, Receipt: req.Receipt, } diff --git a/go.mod b/go.mod index 81bcc907d4..270013a2a1 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/PuerkitoBio/goquery v1.9.2 github.com/VividCortex/ewma v1.2.0 github.com/adrium/goheif v0.0.0-20230113233934-ca402e77a786 - github.com/anyproto/any-sync v0.4.18-0.20240519122304-fab12e7b4a1c + github.com/anyproto/any-sync v0.4.18-0.20240521091226-d8b93f5aec5f github.com/anyproto/go-naturaldate/v2 v2.0.2-0.20230524105841-9829cfd13438 github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de github.com/avast/retry-go/v4 v4.6.0 diff --git a/go.sum b/go.sum index 9d20d77ef9..46173a2bbb 100644 --- a/go.sum +++ b/go.sum @@ -93,6 +93,8 @@ github.com/anyproto/any-sync v0.4.16 h1:oD2Ag0/a+oCWPxfK0BQiisOmYqAkDTqcFHyVJR0D github.com/anyproto/any-sync v0.4.16/go.mod h1:q/RpyR97Flj5Ao3tMR/Sr/IV6kVWpAzTIsS4qqzxDGU= github.com/anyproto/any-sync v0.4.18-0.20240519122304-fab12e7b4a1c h1:Ijn1+oTfM4GYEZBC6wlB48x13vyZ8cBQssqoU/vpqq0= github.com/anyproto/any-sync v0.4.18-0.20240519122304-fab12e7b4a1c/go.mod h1:hXa0S/3RxmjomMCF7D504fBVmdDc/p08OFSf+cslJWE= +github.com/anyproto/any-sync v0.4.18-0.20240521091226-d8b93f5aec5f h1:A7nT/wtA/kA/7bnSBd/qn5NaIivPPXi3g+WnsunHf5c= +github.com/anyproto/any-sync v0.4.18-0.20240521091226-d8b93f5aec5f/go.mod h1:hXa0S/3RxmjomMCF7D504fBVmdDc/p08OFSf+cslJWE= github.com/anyproto/badger/v4 v4.2.1-0.20240110160636-80743fa3d580 h1:Ba80IlCCxkZ9H1GF+7vFu/TSpPvbpDCxXJ5ogc4euYc= github.com/anyproto/badger/v4 v4.2.1-0.20240110160636-80743fa3d580/go.mod h1:T/uWAYxrXdaXw64ihI++9RMbKTCpKd/yE9+saARew7k= github.com/anyproto/go-chash v0.1.0 h1:I9meTPjXFRfXZHRJzjOHC/XF7Q5vzysKkiT/grsogXY=