-
-
Notifications
You must be signed in to change notification settings - Fork 413
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
User-Agent is incorrectly cached in settings.json, with stale value remembered on upgrades #921
Comments
The main reason I think is when the app is freshly installed there is no user-agent and we need to have this while adding the servers from the setting page, #817 should contain more info. But I think it's worth revisiting the implementation of this. |
I don’t understand. There “is no User-Agent”, so the solution is…to store the User-Agent to disk? |
Yeah, that doesn't make any sense to me. The parts of the User-Agent above that aren't this bit from disk come from the browser. Yes, we do need to set User-Agent header when making that HTTP request, but what does that have to do with what's stored on disk? |
I think it makes sense to use |
There is no reason to store the User-Agent to disk at all, ever. I don’t understand what problem you think that is solving. |
There is ideally no reason to do it. Since |
If we’re trying to avoid |
I am not sure but I don't suppose we can access main process variables from renderer. Is storing on the disk a bad approach? |
Yes. Storing it to disk is a bad approach. Cons:
Pros:
The renderer process has variables too. |
If we can get the User-agent from the "session" in the renderer process we don't need to save anything. |
Yeah, so we can do one thing to avoid |
@manavmehta can you open a WIP PR with your fix? |
fetch and send UA from main process and use ipc call to catch it in renderer process
fetch and send UA from main process and use ipc call to catch it in renderer process
We seem to be saving and restoring (part of) the User-Agent in
settings.json
, leading to self-contradictory user-agents likeZulipElectron/5.0.0 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Zulip/4.0.3 Chrome/66.0.3359.181 Electron/3.1.10 Safari/537.36
(Note the
ZulipElectron/5.0.0
andZulip/4.0.3
.)This setting seems to have been added in #818. There should be no reason to persist the User-Agent to disk at all. Why are we doing that?
Cc @kanishk98
The text was updated successfully, but these errors were encountered: