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

Extend peersyncing to sync 1-to-1 messages #4962

Merged
merged 2 commits into from
May 14, 2024
Merged

Conversation

alwx
Copy link
Contributor

@alwx alwx commented Mar 21, 2024

Fixes status-im/status-mobile#18957
Updates peer syncing so that it works not only for communities but also for one-to-one chats.

@alwx alwx self-assigned this Mar 21, 2024
@status-im-auto
Copy link
Member

status-im-auto commented Mar 21, 2024

Jenkins Builds

Click to see older builds (138)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ ab73cf8 #1 2024-03-21 17:33:11 ~3 min linux 📦zip
✔️ ab73cf8 #1 2024-03-21 17:34:59 ~4 min ios 📦zip
✔️ ab73cf8 #1 2024-03-21 17:35:22 ~5 min android 📦aar
✖️ d22c5eb #2 2024-03-25 12:33:34 ~59 sec tests 📄log
✔️ d22c5eb #2 2024-03-25 12:34:53 ~2 min android 📦aar
✔️ d22c5eb #2 2024-03-25 12:35:41 ~3 min linux 📦zip
✔️ d22c5eb #2 2024-03-25 12:36:52 ~4 min ios 📦zip
✖️ fc073c9 #3 2024-03-25 12:53:07 ~53 sec tests 📄log
✔️ fc073c9 #3 2024-03-25 12:54:42 ~2 min android 📦aar
✔️ fc073c9 #3 2024-03-25 12:55:34 ~3 min linux 📦zip
✔️ fc073c9 #3 2024-03-25 12:55:43 ~3 min ios 📦zip
✖️ 1ec5cd8 #4 2024-03-27 16:52:53 ~37 sec tests 📄log
✔️ 1ec5cd8 #4 2024-03-27 16:53:46 ~1 min linux 📦zip
✔️ 1ec5cd8 #4 2024-03-27 16:55:43 ~3 min ios 📦zip
✔️ 1ec5cd8 #4 2024-03-27 16:57:22 ~5 min android 📦aar
✔️ ff27bff #5 2024-03-27 17:05:10 ~2 min linux 📦zip
✔️ ff27bff #5 2024-03-27 17:05:39 ~2 min android 📦aar
✔️ ff27bff #5 2024-03-27 17:07:01 ~4 min ios 📦zip
✔️ ff27bff #5 2024-03-27 17:44:18 ~41 min tests 📄log
✔️ 10c96a5 #6 2024-03-27 19:01:01 ~1 min linux 📦zip
✔️ 10c96a5 #6 2024-03-27 19:01:57 ~2 min android 📦aar
✔️ 10c96a5 #6 2024-03-27 19:09:13 ~9 min ios 📦zip
✔️ 10c96a5 #6 2024-03-27 19:38:57 ~39 min tests 📄log
✔️ f41e895 #7 2024-03-27 21:06:39 ~1 min linux 📦zip
✔️ f41e895 #7 2024-03-27 21:07:10 ~1 min android 📦aar
✖️ f41e895 #7 2024-03-27 21:07:59 ~2 min tests 📄log
✔️ f41e895 #7 2024-03-27 21:08:23 ~3 min ios 📦zip
✔️ cc62324 #8 2024-03-27 21:08:19 ~1 min linux 📦zip
✔️ cc62324 #8 2024-03-27 21:08:50 ~1 min android 📦aar
✔️ cc62324 #8 2024-03-27 21:11:22 ~2 min ios 📦zip
✖️ cc62324 #8 2024-03-27 21:12:04 ~3 min tests 📄log
✖️ cc62324 #9 2024-03-28 11:49:01 ~1 min tests 📄log
✖️ 0ba86f7 #10 2024-04-15 07:35:11 ~1 min tests 📄log
✔️ 0ba86f7 #9 2024-04-15 07:37:58 ~3 min linux 📦zip
✔️ 0ba86f7 #9 2024-04-15 07:39:29 ~5 min android 📦aar
✔️ 0ba86f7 #9 2024-04-15 07:40:07 ~6 min ios 📦zip
✖️ 5aaf245 #11 2024-04-15 08:07:52 ~1 min tests 📄log
✔️ 5aaf245 #10 2024-04-15 08:09:58 ~3 min ios 📦zip
✔️ 5aaf245 #10 2024-04-15 08:10:32 ~3 min linux 📦zip
✔️ 5aaf245 #10 2024-04-15 08:12:05 ~5 min android 📦aar
✖️ 752ec5a #12 2024-04-15 10:09:55 ~1 min tests 📄log
✔️ 752ec5a #11 2024-04-15 10:10:20 ~2 min android 📦aar
✔️ 752ec5a #11 2024-04-15 10:11:22 ~3 min ios 📦zip
✔️ 752ec5a #11 2024-04-15 10:11:32 ~3 min linux 📦zip
✖️ 752ec5a #13 2024-04-15 11:55:48 ~14 sec tests 📄log
✖️ 752ec5a #14 2024-04-17 11:39:12 ~14 sec tests 📄log
✖️ cff24cf #15 2024-04-17 11:46:04 ~1 min tests 📄log
✔️ cff24cf #12 2024-04-17 11:47:35 ~2 min linux 📦zip
✔️ cff24cf #12 2024-04-17 11:47:46 ~2 min android 📦aar
✔️ cff24cf #12 2024-04-17 12:14:24 ~29 min ios 📦zip
✖️ bda7a6b #16 2024-04-17 13:43:50 ~59 sec tests 📄log
✔️ bda7a6b #13 2024-04-17 13:44:25 ~1 min android 📦aar
✔️ bda7a6b #13 2024-04-17 13:44:55 ~2 min linux 📦zip
✔️ bda7a6b #13 2024-04-17 13:48:03 ~5 min ios 📦zip
✔️ 4d019d4 #14 2024-04-17 13:58:36 ~2 min android 📦aar
✔️ 4d019d4 #14 2024-04-17 13:59:51 ~3 min ios 📦zip
✔️ 4d019d4 #14 2024-04-17 14:00:26 ~4 min linux 📦zip
✖️ 4d019d4 #17 2024-04-17 14:07:40 ~11 min tests 📄log
✖️ 4d019d4 #18 2024-04-17 14:17:38 ~1 min tests 📄log
✔️ b984bc2 #15 2024-04-17 14:25:10 ~4 min linux 📦zip
✖️ b984bc2 #19 2024-04-17 14:25:15 ~4 min tests 📄log
✔️ b984bc2 #15 2024-04-17 14:25:36 ~4 min ios 📦zip
✔️ b984bc2 #15 2024-04-17 14:25:57 ~4 min android 📦aar
✔️ 7ca6475 #16 2024-04-17 14:32:27 ~4 min ios 📦zip
✔️ 7ca6475 #16 2024-04-17 14:35:00 ~7 min linux 📦zip
✔️ 7ca6475 #16 2024-04-17 14:37:35 ~9 min android 📦aar
✖️ 7ca6475 #20 2024-04-17 14:42:30 ~14 min tests 📄log
✖️ 7ca6475 #21 2024-04-18 07:28:54 ~3 min tests 📄log
✔️ 42fa6e5 #17 2024-04-18 07:34:21 ~2 min android 📦aar
✔️ 42fa6e5 #17 2024-04-18 07:34:25 ~2 min linux 📦zip
✔️ 42fa6e5 #17 2024-04-18 07:35:13 ~3 min ios 📦zip
✖️ 42fa6e5 #22 2024-04-18 07:42:15 ~10 min tests 📄log
✔️ 10e5a50 #18 2024-04-18 07:54:18 ~2 min linux 📦zip
✔️ 10e5a50 #18 2024-04-18 07:54:37 ~2 min android 📦aar
✔️ 10e5a50 #18 2024-04-18 07:55:20 ~3 min ios 📦zip
✖️ 10e5a50 #23 2024-04-18 07:55:25 ~3 min tests 📄log
✔️ bcd4190 #19 2024-04-18 08:06:04 ~2 min android 📦aar
✔️ bcd4190 #19 2024-04-18 08:06:17 ~2 min linux 📦zip
✔️ bcd4190 #19 2024-04-18 08:08:33 ~4 min ios 📦zip
✖️ bcd4190 #24 2024-04-18 08:41:51 ~37 min tests 📄log
✔️ 553b360 #20 2024-04-18 08:24:03 ~2 min linux 📦zip
✔️ 553b360 #20 2024-04-18 08:24:15 ~3 min android 📦aar
✔️ 553b360 #20 2024-04-18 08:25:00 ~3 min ios 📦zip
✖️ 553b360 #25 2024-04-18 09:19:58 ~37 min tests 📄log
✖️ 553b360 #26 2024-04-18 10:09:56 ~38 min tests 📄log
✖️ 553b360 #27 2024-04-18 13:47:46 ~37 min tests 📄log
✖️ 553b360 #28 2024-04-19 10:08:05 ~36 min tests 📄log
✔️ dacd9eb #21 2024-04-22 09:45:03 ~4 min linux 📦zip
✔️ dacd9eb #21 2024-04-22 09:46:07 ~5 min ios 📦zip
✔️ dacd9eb #21 2024-04-22 09:46:14 ~5 min android 📦aar
✖️ dacd9eb #29 2024-04-22 10:19:29 ~38 min tests 📄log
✔️ 1a65a50 #22 2024-04-22 12:15:48 ~2 min linux 📦zip
✔️ 1a65a50 #22 2024-04-22 12:16:36 ~3 min ios 📦zip
✔️ 1a65a50 #22 2024-04-22 12:18:59 ~5 min android 📦aar
✖️ 1a65a50 #30 2024-04-22 12:51:32 ~38 min tests 📄log
✖️ f86f812 #31 2024-04-22 13:03:49 ~1 min tests 📄log
✔️ f86f812 #23 2024-04-22 13:04:25 ~1 min android 📦aar
✔️ f86f812 #23 2024-04-22 13:04:44 ~2 min linux 📦zip
✔️ f86f812 #23 2024-04-22 13:05:39 ~3 min ios 📦zip
✖️ f86f812 #32 2024-04-22 13:06:40 ~1 min tests 📄log
✖️ d9a6fbf #33 2024-04-22 13:08:34 ~1 min tests 📄log
✔️ d9a6fbf #24 2024-04-22 13:09:14 ~1 min android 📦aar
✔️ d9a6fbf #24 2024-04-22 13:09:43 ~2 min linux 📦zip
✔️ d9a6fbf #24 2024-04-22 13:10:24 ~2 min ios 📦zip
✔️ 9557acf #25 2024-04-22 13:46:18 ~1 min android 📦aar
✔️ 9557acf #25 2024-04-22 13:46:51 ~2 min linux 📦zip
✔️ 9557acf #25 2024-04-22 13:47:48 ~3 min ios 📦zip
✖️ 9557acf #34 2024-04-22 13:49:35 ~4 min tests 📄log
✖️ 9557acf #35 2024-04-22 19:36:57 ~39 min tests 📄log
✖️ 9557acf #36 2024-04-23 07:49:03 ~39 min tests 📄log
✖️ 9557acf #37 2024-04-23 10:08:10 ~39 min tests 📄log
✖️ 9557acf #38 2024-04-24 08:12:06 ~39 min tests 📄log
✔️ d43c9e7 #26 2024-04-25 08:29:36 ~2 min android 📦aar
✔️ d43c9e7 #26 2024-04-25 08:29:42 ~2 min linux 📦zip
✔️ d43c9e7 #26 2024-04-25 08:30:26 ~3 min ios 📦zip
✖️ d43c9e7 #39 2024-04-25 09:07:14 ~40 min tests 📄log
✔️ 53a98f7 #27 2024-04-29 15:12:24 ~2 min linux 📦zip
✔️ 53a98f7 #27 2024-04-29 15:13:02 ~3 min ios 📦zip
✔️ 53a98f7 #27 2024-04-29 15:14:23 ~5 min android 📦aar
✖️ 53a98f7 #40 2024-04-29 15:15:03 ~5 min tests 📄log
✖️ 53a98f7 #41 2024-04-29 21:04:21 ~41 min tests 📄log
✖️ 53a98f7 #42 2024-04-30 09:51:24 ~39 min tests 📄log
✖️ e446603 #43 2024-04-30 10:16:15 ~1 min tests 📄log
✔️ e446603 #28 2024-04-30 10:17:05 ~2 min android 📦aar
✔️ e446603 #28 2024-04-30 10:18:01 ~3 min ios 📦zip
✔️ e446603 #28 2024-04-30 10:18:34 ~3 min linux 📦zip
✔️ 930e368 #29 2024-04-30 15:09:59 ~2 min linux 📦zip
✔️ 930e368 #29 2024-04-30 15:10:03 ~2 min android 📦aar
✔️ 930e368 #29 2024-04-30 15:11:04 ~3 min ios 📦zip
✖️ 930e368 #44 2024-04-30 15:47:23 ~39 min tests 📄log
✔️ 09cd871 #30 2024-05-01 06:53:17 ~2 min linux 📦zip
✔️ 09cd871 #30 2024-05-01 06:55:19 ~4 min ios 📦zip
✔️ 09cd871 #30 2024-05-01 06:55:36 ~4 min android 📦aar
✖️ 09cd871 #45 2024-05-01 07:30:30 ~39 min tests 📄log
✖️ a50fb55 #46 2024-05-13 13:52:14 ~2 min tests 📄log
✔️ a50fb55 #31 2024-05-13 13:54:50 ~4 min linux 📦zip
✔️ a50fb55 #31 2024-05-13 13:55:29 ~5 min ios 📦zip
✔️ a50fb55 #31 2024-05-13 13:55:39 ~5 min android 📦aar
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ f8abe7f #32 2024-05-13 15:09:48 ~3 min linux 📦zip
✔️ f8abe7f #32 2024-05-13 15:11:10 ~5 min android 📦aar
✔️ f8abe7f #32 2024-05-13 15:14:17 ~8 min ios 📦zip
✔️ f8abe7f #47 2024-05-13 15:50:02 ~44 min tests 📄log

@alwx alwx marked this pull request as ready for review March 27, 2024 16:53
@alwx
Copy link
Contributor Author

alwx commented Apr 3, 2024

Any chance to get a review for this one? :)

@jrainville
Copy link
Member

cc @osmaczko @igor-sirotin

Copy link
Contributor

@cammellos cammellos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks ok, I can't remember if RENAME is supported in our sqlite version, that's the only thing, but if it works fine on both android/ios, that should be ok

Copy link
Contributor

@vitvly vitvly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great PR, some minor questions.

protocol/messenger_peersyncing.go Show resolved Hide resolved
protocol/peersyncing/peersyncing.go Outdated Show resolved Hide resolved
protocol/messenger_peersyncing.go Outdated Show resolved Hide resolved
protocol/messenger_peersyncing.go Outdated Show resolved Hide resolved
@@ -133,22 +151,22 @@ func (m *Messenger) sendDatasyncOffers() error {
continue
}

availableMessages, err := m.peersyncing.AvailableMessagesByGroupIDs(chatIDs, maxAdvertiseMessages)
availableMessages, err := m.peersyncing.AvailableMessagesByChatIDs(chatIDs, maxAdvertiseMessages)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We seem to be constructing a chatID->msgID map in all cases when we invoke m.peersyncing.AvailableMessagesByChatIDs - maybe makes sense to make the latter fn return that map instead. (unless i missed some other uses)

@alwx alwx requested a review from vitvly April 15, 2024 11:54
@alwx alwx force-pushed the peer-syncing-one-to-one branch 8 times, most recently from f86f812 to d9a6fbf Compare April 22, 2024 13:07
@alwx alwx force-pushed the peer-syncing-one-to-one branch from 09cd871 to a50fb55 Compare May 13, 2024 13:49
@alwx alwx force-pushed the peer-syncing-one-to-one branch from a50fb55 to f8abe7f Compare May 13, 2024 15:05
@alwx alwx merged commit c46e395 into develop May 14, 2024
8 of 9 checks passed
@alwx alwx deleted the peer-syncing-one-to-one branch May 14, 2024 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extend peersyncing to sync 1-to-1 messages
5 participants