-
Notifications
You must be signed in to change notification settings - Fork 893
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
[Sync] Add an option in setting page to Enter Custom Sync Url #25484
[Sync] Add an option in setting page to Enter Custom Sync Url #25484
Conversation
8d7d7ff
to
f26c2e6
Compare
Hey @aguscruiz ! Could you confirm the design for this UI? Kindly refer SC in Overview. |
e2da192
to
4fc9c3e
Compare
7ddc422
to
8cc6efd
Compare
e0844cf
to
6034292
Compare
#include "brave/components/sync/service/brave_sync_service_impl.h" | ||
#include "chrome/browser/history/history_service_factory.h" | ||
#include "chrome/browser/sync/device_info_sync_service_factory.h" | ||
#include "components/sync/base/command_line_switches.h" | ||
|
||
// Below includes are just to prevent redefining of |
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.
These included seems nasty,
@goodov Do we have any known alternatives to avoid this, other than direct patching?
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.
yeah, this is too messy.
I think we should stop using syncer::kSyncServiceURL
for setting the URL via the command line, but instead do this:
- override
syncer::internal::kSyncServerUrl
andsyncer::internal::kSyncDevServerUrl
to beBUILDFLAG(BRAVE_SYNC_ENDPOINT)
. - modify
BraveGetSyncServiceURL
to also use the pref value ifsyncer::kSyncServiceURL
flag is not passed (right now it's used only if the pref is managed). - remove
syncer::kSyncServiceURL
setting in//brave/app/brave_main_delegate.cc
. - support
AdjustSyncServiceUrlForAndroid
inBraveGetSyncServiceURL
.
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.
cc @AlexeyBarabash ^ does this sound correct? aren't there any hidden shenanigans on iOS/Android if we go this way?
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.
Sorry, @jagadeshjai @goodov I have conmpletly missed this PR and the question.
all above sounds correct and I see the code is now much cleaner.
No hidden shenanigans on Android.
iOS should also be ok. Just in case lets ask @Brandon-T, does iOS have any code to setup custom sync server url?
I just have tested the PR on Android and Desktop - works fine.
6034292
to
c42c7ba
Compare
2c9a8ce
to
0d046ba
Compare
0d046ba
to
bf28c14
Compare
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.
please also rebase and regenerate patches.
relaunch button when toogle/url change.
…ndling custom sync url. Also show Relauch button and Managed icon when required. Conflicts: browser/ui/webui/brave_settings_ui.cc
…ervice via command line before bulding its service in browser context.
…DevServerUrl using chromium_src overrides instead of passing it via command_line
…in Android to |BraveGetSyncServiceURL|.
…s_sync_service_[sources/deps]. And Remove some unused includes.
…ock when sync already started and the custom sync url is empty. Also disable the 'Custom sync URL' block when sync started.
6226566
to
c4b0885
Compare
@goodov Can you run the CI now? |
@bsclifton CI run is green #25691 This can be merged. |
Huge thanks for sticking with this PR @jagadeshjai! 🎉 Really great to have this change finally 😄👍 |
Released in v1.75.58 |
Thanks All ❤️ 😄 ! |
* Revert "Merge pull request #25484 from jagadeshjai/feature__add_option_custom_sync_url" This reverts commit d547c86 and 9757d93, reversing changes made to ab6eba7. * revert #27054 * fixed presubmit errors * Removed code supposed to support `Use Sync staging server` QA preference Related PR - #26804 --------- Co-authored-by: AlexeyBarabash <[email protected]> Co-authored-by: AlexeyBarabash <[email protected]>
@jagadeshjai quick update- we discovered a few issues unfortunately while folks were reviewing (post-merge). Because those issues had security implications, this work was reverted with #27136 Something we missed and I think this is on me - is making sure we had a security review before merge. I'll try to help with the next steps so this doesn't get lost. We'll want to make a new issue to track the request (and not re-open brave/brave-browser#12314). |
brave_components_sync_driver_[sources/deps]
->brave_components_sync_service_[sources/deps]
Resolves brave/brave-browser#12314
Resolves brave/brave-browser#41280
UI:
brave_custom_sync_input.webm
After configuring policy
Two different Profiles
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
wikinpm run presubmit
wiki,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan:
Note: If sync already turned ON and Custom sync URL is empty then the Custom sync URL option should be hidden.