{"action":"created","issue":{"url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues/4407","labels_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues/4407/labels{/name}","comments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues/4407/comments","events_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues/4407/events","html_url":"https://github.com/wordpress-mobile/WordPress-iOS/pull/4407","id":114908827,"number":4407,"title":"Feature/4105 sharing update","user":{"login":"aerych","id":1435271,"avatar_url":"https://avatars.githubusercontent.com/u/1435271?v=3","gravatar_id":"","url":"https://api.github.com/users/aerych","html_url":"https://github.com/aerych","followers_url":"https://api.github.com/users/aerych/followers","following_url":"https://api.github.com/users/aerych/following{/other_user}","gists_url":"https://api.github.com/users/aerych/gists{/gist_id}","starred_url":"https://api.github.com/users/aerych/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aerych/subscriptions","organizations_url":"https://api.github.com/users/aerych/orgs","repos_url":"https://api.github.com/users/aerych/repos","events_url":"https://api.github.com/users/aerych/events{/privacy}","received_events_url":"https://api.github.com/users/aerych/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/labels/Sharing","name":"Sharing","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/milestones/47","html_url":"https://github.com/wordpress-mobile/WordPress-iOS/milestones/5.8","labels_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/milestones/47/labels","id":1188117,"number":47,"title":"5.8","description":null,"creator":{"login":"sendhil","id":437043,"avatar_url":"https://avatars.githubusercontent.com/u/437043?v=3","gravatar_id":"","url":"https://api.github.com/users/sendhil","html_url":"https://github.com/sendhil","followers_url":"https://api.github.com/users/sendhil/followers","following_url":"https://api.github.com/users/sendhil/following{/other_user}","gists_url":"https://api.github.com/users/sendhil/gists{/gist_id}","starred_url":"https://api.github.com/users/sendhil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sendhil/subscriptions","organizations_url":"https://api.github.com/users/sendhil/orgs","repos_url":"https://api.github.com/users/sendhil/repos","events_url":"https://api.github.com/users/sendhil/events{/privacy}","received_events_url":"https://api.github.com/users/sendhil/received_events","type":"User","site_admin":false},"open_issues":15,"closed_issues":11,"state":"open","created_at":"2015-06-30T23:23:15Z","updated_at":"2015-11-05T18:13:30Z","due_on":"2015-12-11T00:00:00Z","closed_at":null},"comments":5,"created_at":"2015-11-03T21:01:12Z","updated_at":"2015-11-06T14:09:23Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/pulls/4407","html_url":"https://github.com/wordpress-mobile/WordPress-iOS/pull/4407","diff_url":"https://github.com/wordpress-mobile/WordPress-iOS/pull/4407.diff","patch_url":"https://github.com/wordpress-mobile/WordPress-iOS/pull/4407.patch"},"body":"Refs #4105.  This PR is an update to the sharing feature's data, networking and services layers.  The goal is to clarify the relationships and interactions between the publicize services, connections and the keychain, to match nomenclature used by the WPcom REST API, and to encapsulate the sharing feature away from other blog related concerns.\r\n\r\nBefore:\r\n- The `Blog` model was being passed to and referenced by a remote service.\r\n- The model name `Publicizer` felt a tad confusing.  It wasn't immediately clear if it referenced a service, or a connection to a service. (It was the service).\r\n- `Publicizer`s were stored on the `Blog` model, but these don't really belong to a blog. \r\n- Connections between a blog and Publicize service were stored as a JSON array on the `Blog` model.\r\n- The blog service remotes (REST/XML-RPC) were responsible for all publicize related networking, even though this is not a feature supported by XML-RPC. \r\n- Syncing a blog would also sync Publicize services and connections, but its unlikely these will change frequently.\r\n- RemotePublicizeExternal represented a keyring connection, but the naming didn't make that clear. \r\n\r\nAfter:\r\n- The `Blog` model is no longer referenced by a remote service. \r\n- `Publicizer` is renamed to `PublicizeService`. Some fields were added and some were removed as this data now represents the results of the `/meta/external-connections` endpoint.  `PublicizeService`s no longer belong to a `Blog`.\r\n- Added `PublicizeConnection` model to represent connections between `PublicizeServices` and a `Blog`.\r\n- Added an object to represent KeychainConnections, replacing `RemotePublicizeExternal`. This is not stored in core data as we only use the data briefly.\r\n- Publicize service logic is moved into `SharingService` and `RemoteSharingService`. This encapsulates sharing feature functionality separate from the rest of the blog service layer and avoids producing no-op methods in the blog service's XMLRPC remote. \r\n- `PublicizeServices` and `PublicizeConnections` are synced on demand. The current UI remains largely placeholder and the current syncing mechanism is subject to change. \r\n- The Publicize related tests were moved into their own `XCTestCase`. There were three tests for exceptions that I did not port over.  When I tried the exceptions they were deliberately trying to throw were never caught but just crashed the app.\r\n\r\n@alexcurylo would you have some free time to look things over feature wise? I took a deep dive into the publicize code on the web (both client and API) and while I think i've got a handle on things I would appreciate an extra check since you're familiar with the feature. \r\n\r\n@jleandroperez Could I trouble you for a code review since this is all Swifty-like? \r\ncc My Android partner in crime, @nbradbury \r\n\r\nNeeds Review: @jleandroperez \r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues/comments/154417994","html_url":"https://github.com/wordpress-mobile/WordPress-iOS/pull/4407#issuecomment-154417994","issue_url":"https://api.github.com/repos/wordpress-mobile/WordPress-iOS/issues/4407","id":154417994,"user":{"login":"jleandroperez","id":1195260,"avatar_url":"https://avatars.githubusercontent.com/u/1195260?v=3","gravatar_id":"","url":"https://api.github.com/users/jleandroperez","html_url":"https://github.com/jleandroperez","followers_url":"https://api.github.com/users/jleandroperez/followers","following_url":"https://api.github.com/users/jleandroperez/following{/other_user}","gists_url":"https://api.github.com/users/jleandroperez/gists{/gist_id}","starred_url":"https://api.github.com/users/jleandroperez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jleandroperez/subscriptions","organizations_url":"https://api.github.com/users/jleandroperez/orgs","repos_url":"https://api.github.com/users/jleandroperez/repos","events_url":"https://api.github.com/users/jleandroperez/events{/privacy}","received_events_url":"https://api.github.com/users/jleandroperez/received_events","type":"User","site_admin":false},"created_at":"2015-11-06T14:09:23Z","updated_at":"2015-11-06T14:09:23Z","body":"@aerych i've been testing this puppy, and it's working flawlessly (as far as i can tell!).\r\n\r\nJust added a minor Q (i can't get any warnings / errors when removing the unused closure params).\r\n\r\nNice work sir!!\r\n\r\n:shipit: \r\n"}}