-
Notifications
You must be signed in to change notification settings - Fork 140
CBG-4945: Fix default sync function dry run #7937
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -1214,6 +1214,34 @@ | |||||||||||||
| expectedOutput: SyncFnDryRun{}, | ||||||||||||||
| expectedStatus: http.StatusBadRequest, | ||||||||||||||
| }, | ||||||||||||||
| // Since the tests run in named Scopes and Collections therefore the | ||||||||||||||
| // default sync function is: | ||||||||||||||
| // function(doc){channel("<collection_name>");} | ||||||||||||||
| // therefore the channels returned will be named collections | ||||||||||||||
|
||||||||||||||
| // Since the tests run in named Scopes and Collections therefore the | |
| // default sync function is: | |
| // function(doc){channel("<collection_name>");} | |
| // therefore the channels returned will be named collections | |
| // Since the tests run in named Scopes and Collections, the default sync function is: | |
| // function(doc){channel("<collection_name>");}. Therefore, the channels returned will be named collections. |
Check failure on line 1279 in rest/diagnostic_doc_api_test.go
GitHub Actions / test-default-collection
diagnostic_doc_api_test.go:1279:
Error Trace: /home/runner/work/sync_gateway/sync_gateway/rest/diagnostic_doc_api_test.go:1279
Error: Not equal:
expected: rest.SyncFnDryRun{Channels:base.Set{"sg_test_0":base.present{}}, Access:channels.AccessMap{}, Roles:channels.AccessMap{}, Exception:"", Expiry:(*uint32)(nil)}
actual : rest.SyncFnDryRun{Channels:base.Set{"chanNew":base.present{}}, Access:channels.AccessMap{}, Roles:channels.AccessMap{}, Exception:"", Expiry:(*uint32)(nil)}
Diff:
--- Expected
+++ Actual
@@ -2,3 +2,3 @@
Channels: (base.Set) (len=1) {
- (string) (len=9) "sg_test_0": (base.present) {
+ (string) (len=7) "chanNew": (base.present) {
}
Test: TestSyncFuncDryRun/no_custom_sync_func-default_db_sync_func-no_doc_body-existing_doc-doc_id
2025-12-24T11:44:38.314Z
Check failure on line 1279 in rest/diagnostic_doc_api_test.go
GitHub Actions / test-default-collection
diagnostic_doc_api_test.go:1279:
Error Trace: /home/runner/work/sync_gateway/sync_gateway/rest/diagnostic_doc_api_test.go:1279
Error: Not equal:
expected: rest.SyncFnDryRun{Channels:base.Set{"sg_test_0":base.present{}}, Access:channels.AccessMap{}, Roles:channels.AccessMap{}, Exception:"", Expiry:(*uint32)(nil)}
actual : rest.SyncFnDryRun{Channels:base.Set{"chanNew":base.present{}}, Access:channels.AccessMap{}, Roles:channels.AccessMap{}, Exception:"", Expiry:(*uint32)(nil)}
Diff:
--- Expected
+++ Actual
@@ -2,3 +2,3 @@
Channels: (base.Set) (len=1) {
- (string) (len=9) "sg_test_0": (base.present) {
+ (string) (len=7) "chanNew": (base.present) {
}
Test: TestSyncFuncDryRun/no_custom_sync_func-default_db_sync_func-doc_body-no_existing_doc-no_doc_id
2025-12-24T11:44:38.292Z
Check failure on line 1279 in rest/diagnostic_doc_api_test.go
GitHub Actions / test-default-collection
diagnostic_doc_api_test.go:1279:
Error Trace: /home/runner/work/sync_gateway/sync_gateway/rest/diagnostic_doc_api_test.go:1279
Error: Not equal:
expected: rest.SyncFnDryRun{Channels:base.Set{"sg_test_0":base.present{}}, Access:channels.AccessMap{}, Roles:channels.AccessMap{}, Exception:"", Expiry:(*uint32)(nil)}
actual : rest.SyncFnDryRun{Channels:base.Set{"chanNew":base.present{}}, Access:channels.AccessMap{}, Roles:channels.AccessMap{}, Exception:"", Expiry:(*uint32)(nil)}
Diff:
--- Expected
+++ Actual
@@ -2,3 +2,3 @@
Channels: (base.Set) (len=1) {
- (string) (len=9) "sg_test_0": (base.present) {
+ (string) (len=7) "chanNew": (base.present) {
}
Test: TestSyncFuncDryRun/no_custom_sync_func-default_db_sync_func-no_doc_body-existing_doc-doc_id
2025-12-24T11:44:45.184Z
Check failure on line 1279 in rest/diagnostic_doc_api_test.go
GitHub Actions / test-default-collection
diagnostic_doc_api_test.go:1279:
Error Trace: /home/runner/work/sync_gateway/sync_gateway/rest/diagnostic_doc_api_test.go:1279
Error: Not equal:
expected: rest.SyncFnDryRun{Channels:base.Set{"sg_test_0":base.present{}}, Access:channels.AccessMap{}, Roles:channels.AccessMap{}, Exception:"", Expiry:(*uint32)(nil)}
actual : rest.SyncFnDryRun{Channels:base.Set{"chanNew":base.present{}}, Access:channels.AccessMap{}, Roles:channels.AccessMap{}, Exception:"", Expiry:(*uint32)(nil)}
Diff:
--- Expected
+++ Actual
@@ -2,3 +2,3 @@
Channels: (base.Set) (len=1) {
- (string) (len=9) "sg_test_0": (base.present) {
+ (string) (len=7) "chanNew": (base.present) {
}
Test: TestSyncFuncDryRun/no_custom_sync_func-default_db_sync_func-doc_body-no_existing_doc-no_doc_id
2025-12-24T11:44:45.164Z
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.
The logic flow has become less clear with the nested conditions. The outer condition checks
syncFn == \"\"twice in different branches. Consider restructuring to: first check ifsyncFnis empty and set it to the default if needed, then proceed with a single conditional based on whether to useChannelMapperorSyncRunner.