{"action":"created","issue":{"url":"https://api.github.com/repos/couchbaselabs/mobile-testkit/issues/641","repository_url":"https://api.github.com/repos/couchbaselabs/mobile-testkit","labels_url":"https://api.github.com/repos/couchbaselabs/mobile-testkit/issues/641/labels{/name}","comments_url":"https://api.github.com/repos/couchbaselabs/mobile-testkit/issues/641/comments","events_url":"https://api.github.com/repos/couchbaselabs/mobile-testkit/issues/641/events","html_url":"https://github.com/couchbaselabs/mobile-testkit/issues/641","id":172519124,"number":641,"title":"Add Test Replication with Session cookie","user":{"login":"pasin","id":801454,"avatar_url":"https://avatars.githubusercontent.com/u/801454?v=3","gravatar_id":"","url":"https://api.github.com/users/pasin","html_url":"https://github.com/pasin","followers_url":"https://api.github.com/users/pasin/followers","following_url":"https://api.github.com/users/pasin/following{/other_user}","gists_url":"https://api.github.com/users/pasin/gists{/gist_id}","starred_url":"https://api.github.com/users/pasin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pasin/subscriptions","organizations_url":"https://api.github.com/users/pasin/orgs","repos_url":"https://api.github.com/users/pasin/repos","events_url":"https://api.github.com/users/pasin/events{/privacy}","received_events_url":"https://api.github.com/users/pasin/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/couchbaselabs/mobile-testkit/labels/in%20progress","name":"in progress","color":"bfdadc"},{"url":"https://api.github.com/repos/couchbaselabs/mobile-testkit/labels/release-prep","name":"release-prep","color":"c7def8"}],"state":"open","locked":false,"assignee":{"login":"sethrosetter","id":1365736,"avatar_url":"https://avatars.githubusercontent.com/u/1365736?v=3","gravatar_id":"","url":"https://api.github.com/users/sethrosetter","html_url":"https://github.com/sethrosetter","followers_url":"https://api.github.com/users/sethrosetter/followers","following_url":"https://api.github.com/users/sethrosetter/following{/other_user}","gists_url":"https://api.github.com/users/sethrosetter/gists{/gist_id}","starred_url":"https://api.github.com/users/sethrosetter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sethrosetter/subscriptions","organizations_url":"https://api.github.com/users/sethrosetter/orgs","repos_url":"https://api.github.com/users/sethrosetter/repos","events_url":"https://api.github.com/users/sethrosetter/events{/privacy}","received_events_url":"https://api.github.com/users/sethrosetter/received_events","type":"User","site_admin":false},"assignees":[{"login":"sethrosetter","id":1365736,"avatar_url":"https://avatars.githubusercontent.com/u/1365736?v=3","gravatar_id":"","url":"https://api.github.com/users/sethrosetter","html_url":"https://github.com/sethrosetter","followers_url":"https://api.github.com/users/sethrosetter/followers","following_url":"https://api.github.com/users/sethrosetter/following{/other_user}","gists_url":"https://api.github.com/users/sethrosetter/gists{/gist_id}","starred_url":"https://api.github.com/users/sethrosetter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sethrosetter/subscriptions","organizations_url":"https://api.github.com/users/sethrosetter/orgs","repos_url":"https://api.github.com/users/sethrosetter/repos","events_url":"https://api.github.com/users/sethrosetter/events{/privacy}","received_events_url":"https://api.github.com/users/sethrosetter/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/couchbaselabs/mobile-testkit/milestones/7","html_url":"https://github.com/couchbaselabs/mobile-testkit/milestones/1.3.1","labels_url":"https://api.github.com/repos/couchbaselabs/mobile-testkit/milestones/7/labels","id":1939432,"number":7,"title":"1.3.1","description":"","creator":{"login":"sethrosetter","id":1365736,"avatar_url":"https://avatars.githubusercontent.com/u/1365736?v=3","gravatar_id":"","url":"https://api.github.com/users/sethrosetter","html_url":"https://github.com/sethrosetter","followers_url":"https://api.github.com/users/sethrosetter/followers","following_url":"https://api.github.com/users/sethrosetter/following{/other_user}","gists_url":"https://api.github.com/users/sethrosetter/gists{/gist_id}","starred_url":"https://api.github.com/users/sethrosetter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sethrosetter/subscriptions","organizations_url":"https://api.github.com/users/sethrosetter/orgs","repos_url":"https://api.github.com/users/sethrosetter/repos","events_url":"https://api.github.com/users/sethrosetter/events{/privacy}","received_events_url":"https://api.github.com/users/sethrosetter/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":0,"state":"open","created_at":"2016-08-12T17:41:30Z","updated_at":"2016-08-22T18:19:41Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2016-08-22T18:18:03Z","updated_at":"2016-08-23T21:11:17Z","closed_at":null,"body":"I think it's a good idea to add this test to the functional tests as we don't have the unit test and the unit test cannot test this easily.\r\n\r\nSetup:\r\n\r\n1. SyncGateway Config with guest disabled = true and One user added (e.g. user1 / 1234).\r\n\r\nSteps:\r\n\r\n1. Create a new session on SGW for the user1 by using POST /_session. Capture the SyncGatewaySession cookie from the set-cookie in the response header.\r\n\r\n2. Start continuous push and pull replicator on the LiteServ with SyncGatewaySession cookie. Make sure that both replicators start correctly.\r\n\r\n Sample POST /_replicate body:\r\n ```\r\n// Push\r\n{\r\n      source: 'db',\r\n      target: {\r\n            url: 'http://10.17.2.133:4984/db'\r\n            headers: {\r\n                    SyncGatewaySession: 'd92f44b908b5c9dd20b351fb4b8a6b273433387b; Path=/sync_gateway; Expires=Thu, 11 Aug 2016 17:53:49 GMT'\r\n            } \r\n      },\r\n      continuous: true\r\n}\r\n// Pull\r\n{\r\n      target: 'db',\r\n      source: {\r\n            url: 'http://10.17.2.133:4984/db'\r\n            headers: {\r\n                    SyncGatewaySession: 'd92f44b908b5c9dd20b351fb4b8a6b273433387b; Path=/sync_gateway; Expires=Thu, 11 Aug 2016 17:53:49 GMT'\r\n            } \r\n      },\r\n      continuous: true\r\n}\r\n```\r\nNote that I don't know if Path and Expires are required or not.\r\n\r\n3. Delete the session from SGW by sending DELETE /_sessions/<sessionid> to SGW.\r\n\r\n4. Cancel both push and pull replicator on the LiteServ.\r\n\r\n5. Repeat step 1 and 2.\r\n\r\nReference: https://github.com/couchbase/couchbase-lite-android/issues/817."},"comment":{"url":"https://api.github.com/repos/couchbaselabs/mobile-testkit/issues/comments/241879984","html_url":"https://github.com/couchbaselabs/mobile-testkit/issues/641#issuecomment-241879984","issue_url":"https://api.github.com/repos/couchbaselabs/mobile-testkit/issues/641","id":241879984,"user":{"login":"pasin","id":801454,"avatar_url":"https://avatars.githubusercontent.com/u/801454?v=3","gravatar_id":"","url":"https://api.github.com/users/pasin","html_url":"https://github.com/pasin","followers_url":"https://api.github.com/users/pasin/followers","following_url":"https://api.github.com/users/pasin/following{/other_user}","gists_url":"https://api.github.com/users/pasin/gists{/gist_id}","starred_url":"https://api.github.com/users/pasin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pasin/subscriptions","organizations_url":"https://api.github.com/users/pasin/orgs","repos_url":"https://api.github.com/users/pasin/repos","events_url":"https://api.github.com/users/pasin/events{/privacy}","received_events_url":"https://api.github.com/users/pasin/received_events","type":"User","site_admin":false},"created_at":"2016-08-23T21:11:17Z","updated_at":"2016-08-23T21:11:17Z","body":"From https://github.com/couchbase/couchbase-lite-android/issues/817#issuecomment-241710428, we should also include a test to check _active_tasks to detect the session deletion / expiration but this could be a bit tricky.\r\n\r\nFor Push replicator, we need to update/create a document to have the replicator recognizes. For Pull replicator, we need to wait until _changes feed timeout so the change tracker can resend the request and got 401 error.  Note that SGW has 5 mins default timeout.\r\n"}}
{"actor":{"display_login":"pasin"}}