-
-
Notifications
You must be signed in to change notification settings - Fork 99
jsonrpc: add more functions, mostly message related #3590
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
jsonrpc: add more functions, mostly message related #3590
Conversation
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.
for the new BasicChat
- where is the line that makes a difference to FullChat
?
my advice would be, to make the object clearer, more useful and faster, to draw the line about what should be in and what not by the need of additional database callls:
so, add only add things where ...
- one knows for sure they are always or most times needed whenever a
BasicChat
object is created - or things, that do not require additional database calls.
otherwise, things may easily end up in a mess, not much different from FullChat
.
concrete, this means to think over adding can_send
, profile_image
and color
- maybe remove them for now and use separate functions instead or re-add them if it turns out they are really needed for the majority of usages of BasicChat
. or let the caller use FullChat
. it is easier to add a field than to remove one :)
otherwise, we waste up to 3 database calls per load of a BasicChat
structure.
also, i would document what makes the difference between BasicChat
and FullChat
- so future improvements are easier.
apart from these general thoughts, the pr lgtm.
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.
in case, we assume that chat image/color is needed most times BasicChat
is created (not so unlikely), this lgtm.
Agree with your thoughts, but at the same time it's about porting from js to rust and keeping the refactorings as sane as possible. Also weighting database accesses vs socket overhead I think won't make a big difference. Having the data structure properly modularized in jsonrpc will allow us to have a lot better and clearer overview over the types we use, and also evaluate better ones. But we can do this at any time, also removing properties will not be a problem as deltachat-desktop is the only consumer of this api for now. |
and adjust properties acordingly r10s is right it should only contain what we need of the expensive calls
Fix get_connectivity_html and get_encrinfo futures not being Send. See rust-lang/rust#101650 for more information. Co-authored-by: jikstra <[email protected]>
6471cf8
to
4ac4047
Compare
No description provided.