Skip to content
New issue

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

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

Already on GitHub? # to your account

Many settings request RPCs on each received message #10493

Closed
igor-sirotin opened this issue May 1, 2023 · 5 comments · Fixed by #10532
Closed

Many settings request RPCs on each received message #10493

igor-sirotin opened this issue May 1, 2023 · 5 comments · Fixed by #10532
Assignees
Milestone

Comments

@igor-sirotin
Copy link
Contributor

igor-sirotin commented May 1, 2023

Description

I get this log on each received message.
I suppose that all of these notifications settings should be cached?

INF 2023-05-01 15:39:12.618+03:00 received                                   topics="signals-manager" tid=2625076 file=messages.nim:63 signal=messages.new messageID=0x3a56a6eaf8501e3086a9db9e5305e8a18e649503c7624049464e6f880d8c9cc2
ERR 2023-05-01 15:39:12.628+03:00 error: requested community doesn't exists  topics="community-service" tid=2625076 file=service.nim:669 communityId=
ERR 2023-05-01 15:39:12.629+03:00 error: requested community doesn't exists  topics="community-service" tid=2625076 file=service.nim:669 communityId=
DBG 2023-05-01 15:39:12.633+03:00 NewBE_callPrivateRPC                       topics="rpc" tid=2625076 file=core.nim:27 rpc_method=settings_notificationsGetAllowNotifications
DBG 2023-05-01 15:39:12.634+03:00 NewBE_callPrivateRPC                       topics="rpc" tid=2625076 file=core.nim:27 rpc_method=settings_notificationsGetAllMessages
DBG 2023-05-01 15:39:12.634+03:00 NewBE_callPrivateRPC                       topics="rpc" tid=2625076 file=core.nim:27 rpc_method=settings_notificationsGetExMuteAllMessages
DBG 2023-05-01 15:39:12.634+03:00 NewBE_callPrivateRPC                       topics="rpc" tid=2625076 file=core.nim:27 rpc_method=settings_notificationsGetExPersonalMentions
DBG 2023-05-01 15:39:12.635+03:00 NewBE_callPrivateRPC                       topics="rpc" tid=2625076 file=core.nim:27 rpc_method=settings_notificationsGetExGlobalMentions
DBG 2023-05-01 15:39:12.635+03:00 NewBE_callPrivateRPC                       topics="rpc" tid=2625076 file=core.nim:27 rpc_method=settings_notificationsGetExOtherMessages
DBG 2023-05-01 15:39:12.635+03:00 NewBE_callPrivateRPC                       topics="rpc" tid=2625076 file=core.nim:27 rpc_method=settings_notificationsGetOneToOneChats
DBG 2023-05-01 15:39:12.635+03:00 NewBE_callPrivateRPC                       topics="rpc" tid=2625076 file=core.nim:27 rpc_method=settings_notificationsGetOneToOneChats
DBG 2023-05-01 15:39:12.636+03:00 NewBE_callPrivateRPC                       topics="rpc" tid=2625076 file=core.nim:27 rpc_method=settings_notificationsGetMessagePreview
DBG 2023-05-01 15:39:12.636+03:00 NewBE_callPrivateRPC                       topics="rpc" tid=2625076 file=core.nim:27 rpc_method=settings_notificationsGetMessagePreview
DBG 2023-05-01 15:39:12.636+03:00 Add OS notification                        topics="notifications-manager" tid=2625076 file=notifications_manager.nim:245 title=qwerc message=77 identifier="{\"notificationType\":7,\"sectionId\":\"0x04be8cd34109fa5d18998931bc9a3199b9b26f0940ee97735b351ecda1649792dff75087bbe657eeb418f2bfdd1932c4ca7d1b66395eb6f1464fe576558366003f\",\"isCommunitySection\":false,\"sectionActive\":true,\"chatId\":\"0x04b8a8d3fccf3ba7cf04ee168447821ba9110c0db957577fd85b43504d68332fa98cac8d405f5e26ce66660d892b4303397e8cb96c29183e64dddabf903d01b7ef\",\"chatActive\":true,\"isOneToOne\":true,\"isGroupChat\":false,\"messageId\":\"0x3a56a6eaf8501e3086a9db9e5305e8a18e649503c7624049464e6f880d8c9cc2\"}"
DBG 2023-05-01 15:39:12.637+03:00 NewBE_callPrivateRPC                       topics="rpc" tid=2625076 file=core.nim:27 rpc_method=settings_notificationsGetSoundEnabled
DBG 2023-05-01 15:39:12.637+03:00 NewBE_callPrivateRPC                       topics="rpc" tid=2625076 file=core.nim:27 rpc_method=settings_notificationsGetVolume
@jrainville
Copy link
Member

Yeah they 100% should be. Good catch

@jrainville jrainville added this to the 0.13 milestone May 1, 2023
@jrainville jrainville moved this to Iteration Backlog in Status Desktop/Mobile Board May 2, 2023
@0x-r4bbit
Copy link
Member

@igor-sirotin can you please provide steps to reproduce this?

@0x-r4bbit 0x-r4bbit moved this from Iteration Backlog to In Progress in Status Desktop/Mobile Board May 3, 2023
@0x-r4bbit
Copy link
Member

Nevermind, managed to reproduce

@igor-sirotin
Copy link
Contributor Author

@0x-r4bbit Just receive a message from anyone. I had such output on each message the app was receiving

0x-r4bbit added a commit that referenced this issue May 3, 2023
There are a bunch of notification related settings that cause RPC
calls when read from the UI in QML/Qt.

This is bad because whenever the view tries to read a notification
setting it causes an RPC call and then rerenders the view. This happens
pretty much every time a new signal arrives in the client.

To account for that we now fetch all notification settings once and mark
the service as initialized so it know when to simply return cached
values. The cache is updated when the notification settings change.

Fixes #10493
@0x-r4bbit
Copy link
Member

@igor-sirotin this is fixed in the linked PR.

PTAL

@igor-sirotin igor-sirotin moved this from In Progress to Code review in Status Desktop/Mobile Board May 3, 2023
0x-r4bbit added a commit that referenced this issue May 4, 2023
There are a bunch of notification related settings that cause RPC
calls when read from the UI in QML/Qt.

This is bad because whenever the view tries to read a notification
setting it causes an RPC call and then rerenders the view. This happens
pretty much every time a new signal arrives in the client.

To account for that we now fetch all notification settings once and mark
the service as initialized so it know when to simply return cached
values. The cache is updated when the notification settings change.

Fixes #10493
@github-project-automation github-project-automation bot moved this from Code review to Done in Status Desktop/Mobile Board May 4, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants