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

[#12783] Improve order of mailserver requests #2510

Merged
merged 1 commit into from
Feb 2, 2022

Conversation

rasom
Copy link
Collaborator

@rasom rasom commented Jan 28, 2022

needed for status-im/status-mobile#12783

Before syncing, topics are sorted by priority. In case if all topics have zero priority requests are executed as before. Otherwise, topics with higher priority are requested in first N batches (currently three batches with 1, 5, 10 topics. That's arbitrary, emphasis is on the first batch), and the rest of topics are requested as before.

chat.ReadMessagesAtClockValue is used to prioritise topics before historical requests as it is always updated when the user opens chat (at least in mobile version). We can add a separate field for this but I'm not sure this is necessary.

status: ready

@ghost
Copy link

ghost commented Jan 28, 2022

Pull Request Checklist

  • Have you updated the documentation, if impacted (e.g. docs.status.im)?
  • Have you tested changes with mobile?
  • Have you tested changes with desktop?

@status-im-auto
Copy link
Member

status-im-auto commented Jan 28, 2022

Jenkins Builds

Click to see older builds (12)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 0de0fd5 #1 2022-01-28 12:36:06 ~2 min linux 📦zip
✔️ 0de0fd5 #1 2022-01-28 12:37:50 ~4 min android 📦aar
✔️ 0de0fd5 #1 2022-01-28 12:37:55 ~4 min ios 📦zip
✔️ 445656e #2 2022-01-31 12:00:59 ~2 min ios 📦zip
✔️ 445656e #2 2022-01-31 12:01:01 ~1 min linux 📦zip
✔️ 445656e #2 2022-01-31 12:02:07 ~3 min android 📦aar
✔️ 03b16f3 #3 2022-01-31 12:12:56 ~1 min linux 📦zip
✔️ 03b16f3 #3 2022-01-31 12:13:11 ~1 min ios 📦zip
✔️ 03b16f3 #3 2022-01-31 12:15:22 ~3 min android 📦aar
✔️ 88fd9cb #4 2022-01-31 12:33:16 ~2 min android 📦aar
✔️ 88fd9cb #4 2022-01-31 12:33:40 ~3 min ios 📦zip
✔️ 88fd9cb #4 2022-01-31 12:33:42 ~3 min linux 📦zip
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 5693bc6 #5 2022-02-01 18:35:25 ~1 min linux 📦zip
✔️ 5693bc6 #5 2022-02-01 18:35:35 ~1 min ios 📦zip
✔️ 5693bc6 #5 2022-02-01 18:36:53 ~3 min android 📦aar
✔️ c0c9094 #6 2022-02-02 07:40:33 ~1 min linux 📦zip
✔️ c0c9094 #6 2022-02-02 07:41:08 ~2 min ios 📦zip
✔️ c0c9094 #6 2022-02-02 07:42:18 ~3 min android 📦aar

@rasom rasom force-pushed the feat/#12783-chat-topics-retreiving-order branch from 445656e to 03b16f3 Compare January 31, 2022 12:11
@rasom rasom marked this pull request as ready for review January 31, 2022 12:28
@rasom rasom force-pushed the feat/#12783-chat-topics-retreiving-order branch from 03b16f3 to 88fd9cb Compare January 31, 2022 12:30
Copy link
Member

@richard-ramos richard-ramos left a comment

Choose a reason for hiding this comment

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

💯

Copy link
Member

@Samyoul Samyoul left a comment

Choose a reason for hiding this comment

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

Looks good. Nice idea

@rasom rasom force-pushed the feat/#12783-chat-topics-retreiving-order branch from 88fd9cb to 5693bc6 Compare February 1, 2022 18:33
@rasom rasom force-pushed the feat/#12783-chat-topics-retreiving-order branch from 5693bc6 to c0c9094 Compare February 2, 2022 07:38
@rasom rasom merged commit c0c9094 into develop Feb 2, 2022
@rasom rasom deleted the feat/#12783-chat-topics-retreiving-order branch February 2, 2022 09:16
@Khushboo-dev-cpp
Copy link
Contributor

Hey @rasom -> we are not sure but we are getting a crash after these changes, can you have a look DBG 2022-02-02 13:04:57.626+01:00 NewBE_callPrivateRPC topics="rpc" tid=18836562 file=core.nim:24 rpc_method=wakuext_importCommunity
panic: runtime error: index out of range [0] with length 0

goroutine 4351 [running]:
github.com/status-im/status-go/protocol.(*Messenger).syncFilters(0xc00092ce00, 0x0, 0x0, 0x0, 0x0, 0x5d011a27e8d936b7, 0xabc701512a75b559)
/Users/sale/Status/desktop-app/vendor/status-lib/vendor/status-go/protocol/messenger_mailserver.go:291 +0x1fac
github.com/status-im/status-go/protocol.(*Messenger).scheduleSyncFilters.func1(0xc00092ce00, 0x0, 0x0, 0x0)
/Users/sale/Status/desktop-app/vendor/status-lib/vendor/status-go/protocol/messenger_mailserver.go:103 +0x6a
created by github.com/status-im/status-go/protocol.(*Messenger).scheduleSyncFilters
/Users/sale/Status/desktop-app/vendor/status-lib/vendor/status-go/protocol/messenger_mailserver.go:102 +0x29f
nim_status_client(63447,0x70000edbe000) malloc: *** error for object 0x7f99434df820: pointer being freed was not allocated
nim_status_client(63447,0x70000edbe000) malloc: *** set a breakpoint in malloc_error_break to debug
^Cmake: *** [run-macos] Killed: 9

?

@rasom
Copy link
Collaborator Author

rasom commented Feb 2, 2022

@Khushboo-dev-cpp I will prepare a fix in a moment

@rasom
Copy link
Collaborator Author

rasom commented Feb 2, 2022

@Khushboo-dev-cpp should be fixed in another PR

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.

5 participants