Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repeated errors in Updates Recovery for Channels becoming private #1322

Open
sebkaluzny opened this issue Feb 19, 2024 · 0 comments
Open

Repeated errors in Updates Recovery for Channels becoming private #1322

sebkaluzny opened this issue Feb 19, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@sebkaluzny
Copy link

What version of gotd are you using?

v0.97.0

Can this issue be reproduced with the latest version?

Yes

What did you do?

I'm using updatesRecovery:

d := tg.NewUpdateDispatcher()
updateHandler := storage.UpdateHook(d, peerDB)
...
updatesRecovery := updates.New(updates.Config{
	Handler: updateHandler, // using previous handler with peerDB
	Logger:  log.Named("updates.recovery"),
	Storage: boltstor.NewStateStorage(boltdb),
})
...
... client.Run code
      return updatesRecovery.Run(ctx, api, self.ID, updates.AuthOptions{
	      IsBot: self.Bot,
	      OnStart: func(ctx context.Context) {
		      fmt.Println("Update recovery initialized and started, listening for events")
	      },
      })

When I join to channel which after some time is changed to PRIVATE (or deleted idk), I can see then repeated errors:

updates/state_channel.go:336	get channel difference error	{"channel_id": 1234, "error": "get channel difference: rpcDoRequest: rpc error code 400: CHANNEL_PRIVATE", "errorVerbose": "get channel difference:\n    github.com/gotd/td/telegram/updates.(*channelState).getDifference\n        /go/pkg/mod/github.com/gotd/[email protected]/telegram/updates/state_channel.go:253\n  - rpcDoRequest:\n    github.com/gotd/td/internal/mtproto.(*Conn).Invoke\n        /go/pkg/mod/github.com/gotd/[email protected]/internal/mtproto/rpc.go:44\n  - rpc error code 400: CHANNEL_PRIVATE"}

And this error appears every timer tick of channel state updater.

What did you expect to see?

I think there should be some configuration to set, if updater fails to get updates for channel for X minutes or after X calls of seeing the same error it should stop watching the channel instead of making calls every time to TG api and receiving errors.

What did you see instead?

Updater tries to get channel updates anyway

What Go version and environment are you using?

go1.21.5

@sebkaluzny sebkaluzny added the bug Something isn't working label Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant