Comments (11)
we have a cache/store for some settings in desktop, is there an event when it changes?
the cache is there to get core values faster, because it is sync, while the core api is async, though we could probably change the code to have less places that rely on it with the cost that we may have to add some loading delays.
from deltachat-desktop.
Unfortunately, no special event is emitted for this. Only IncomingMsgBunch
is emitted for sync messages, can it be used to update the displayname and other things (e.g. the avatar) that can be synchronised?
from deltachat-desktop.
relying on that event would be rather hacky (naming has only weak link to meaning), but could work, but an event that indicates that some config changed would be even better.
from deltachat-desktop.
so @farooqkz listen for IncomingMsgBunch
in settings store and reload the whole message store on that event, don't forget to add a comment that explains that there is no dedicated event for this yet and maybe link to this issue.
Was considering to do it myself, but I don't want to steal your issue this time ;)
from deltachat-desktop.
Yes, relying on IncomingMsgBunch
isn't a good idea, because it only means that some message is received, but it might not be yet applied. So, we can have a race.
EDIT: Maybe indeed add some ConfigChanged
event instead of adding temporary hacks? @r10s would it be useful in mobile apps?
EDIT: Though, for self-avatar we already have SelfavatarChanged
. Thinking about DisplaynameChanged
then, but not sure we need so fine-grained events...
from deltachat-desktop.
@r10s would it be useful in mobile apps?
no. we do not cache config values on mobile, this is not needed, things are fast enough. iirc, not caching is no option as all calls are async on desktop? or did that change meanwhile?
from deltachat-desktop.
So, i'm going to add some event like
ConfigChanged {
key: Config,
val: Option<String>,
}
It will also replace SelfavatarChanged
. But for some time there will be both for compatibility.
EDIT: But then we're going to have some useless events for e.g. LastHousekeeping
. So, i'd rather add an event only for synced config keys, but do that on both sides (sender and receiver) for uniformity.
EDIT: How about ConfigSynced
(with the same params)?
from deltachat-desktop.
EDIT: How about ConfigSynced (with the same params)?
I agree, that would be nice, though value is probably not needed, we can always fetch the newest version of it with a core call.
iirc, not caching is no option as all calls are async on desktop? or did that change meanwhile?
if we do loading states (or react suspense rendering) for places where it is needed we could avoid caching those, but would need some refactoring and maybe not applicable for all cases where the settings store is used.
from deltachat-desktop.
I agree, that would be nice, though value is probably not needed, we can always fetch the newest version of it with a core call.
Decided not to add a value, otherwise it would be logged which might not be good for privacy when sharing logs
from deltachat-desktop.
Merged the core PR
from deltachat-desktop.
Merged another core PR fixing the previous one, now should work
from deltachat-desktop.
Related Issues (20)
- chat does not scroll down after forwarding
- Update UPDATE_CORE documentation HOT 1
- the title on adding subsequent profiles should read "Add Profile", not "Welcome"
- overridden sender name property for outgoing/self messages not displayed
- Skip fill peer connections if webxdc internetAccess is allowed HOT 2
- Allow opening maps of multiple chats HOT 2
- Change map default dimensions to be bigger and landscape instead of portrait
- Visual bug in search result list HOT 3
- Switch to `save_msg_file()` + `MessageObject::file_name` for saving attachments HOT 1
- CI: Mac preview build fails
- Readme still mentions `deltachat-node`
- Map doesn't open HOT 8
- instant onboarding: adapt title of "Privacy Policy" link
- "I already have a profile" dialog doesn't vanish after adding client as second device
- Formatting issues in Russian for scan QR code HOT 1
- Three dots become inactive when opening tabs to the right from Audio HOT 2
- A bug with date of audio messages in Russian HOT 4
- Settings should be closable in sub-pages with escape key HOT 2
- WAV files are not displayed in the audio tab HOT 1
- Plural rules are not followed for many languages HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deltachat-desktop.