Skip to content
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

External property on kCBLDatabaseChangeNotification when CBL is remote #1100

Closed
jamesnocentini opened this issue Feb 4, 2016 · 4 comments
Closed

Comments

@jamesnocentini
Copy link
Contributor

Steps to reproduce:

  1. Device A starts the Listener to enable CBL to become a remote in a replication
  2. Start a push replication from another db to the CBL Listener (the target)
  3. The changes being pushed and posted in the kCBLDatabaseChangeNotification handler always have a source URL that's null and external is false

When the replication is CBL <-> Sync Gateway, the external field has the expected value but when CBL becomes the remote it's always false on the database event.

@snej
Copy link
Contributor

snej commented Feb 8, 2016

Turns out this is already hooked up, via the CBLRouter.source property which gets set by CBLHTTPConnection httpResponseForMethod:URI:. But it only gets set if the connection is authenticated as a user. This must be because I'm setting the value of source to a fake URL that looks like user:username.

@snej
Copy link
Contributor

snej commented Feb 8, 2016

I could use user: (with no username) for the anonymous case.

For bonus points I could also append the socket's peer IP address, like user:username@66.66.66.66.

@borrrden
Copy link
Member

Also if a bulk docs request comes in with new_edits = true

https://github.com/couchbase/couchbase-lite-ios/blob/master/Source/CBL_Router+Handlers.m#L285
https://github.com/couchbase/couchbase-lite-ios/blob/master/Source/CBL_Router+Handlers.m#L867

Note that the source is passed in but never used in either case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants