-
-
Notifications
You must be signed in to change notification settings - Fork 41
connector,messagix: support backfill of all chats #196
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
base: main
Are you sure you want to change the base?
Conversation
ec685e6 to
8d27f18
Compare
8d27f18 to
b7a3511
Compare
Chats only, no messages. Though in testing it appears to pick up the most recent messages for each room as we paginate anyway.
b7a3511 to
90b6f3c
Compare
pkg/connector/example-config.yaml
Outdated
| # Thread backfill settings for syncing older conversations | ||
| thread_backfill: | ||
| # Enable thread list backfill to sync older conversations on connect | ||
| enabled: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Batch count limit would probably be more appropriate than an enabled boolean (-1 for unlimited, 0 for disabled, >0 for limited)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pkg/connector/threadbackfill.go
Outdated
|
|
||
| batchCount++ | ||
|
|
||
| keyStore := m.Client.GetSyncGroupKeyStore(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fetching this inside FetchMoreThreads and again here is a bit weird
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah should just come back from fetch more => 4281417
| helper.Copy(up.Bool, "send_presence_on_typing") | ||
| helper.Copy(up.Bool, "receive_instagram_typing_indicators") | ||
| helper.Copy(up.Bool, "disable_view_once") | ||
| helper.Copy(up.Bool, "thread_backfill", "enabled") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| helper.Copy(up.Bool, "thread_backfill", "enabled") | |
| helper.Copy(up.Int, "thread_backfill", "batch_count") |
| helper.Copy(up.Bool, "receive_instagram_typing_indicators") | ||
| helper.Copy(up.Bool, "disable_view_once") | ||
| helper.Copy(up.Bool, "thread_backfill", "enabled") | ||
| helper.Copy(up.Str, "thread_backfill", "batch_delay") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think duration parsing allows numbers too (mostly useful for 0)
| helper.Copy(up.Str, "thread_backfill", "batch_delay") | |
| helper.Copy(up.Str|up.Int, "thread_backfill", "batch_delay") |
| delay := m.Main.Config.ThreadBackfill.BatchDelay | ||
|
|
||
| batchCount := 0 | ||
| lastMinThreadKey := m.Client.GetSyncGroupKeyStore(1).MinThreadKey |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the key store be nil? (i.e. will this panic?)
Chats, not messages.