{"action":"created","issue":{"url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-JS/issues/164","labels_url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-JS/issues/164/labels{/name}","comments_url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-JS/issues/164/comments","events_url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-JS/issues/164/events","html_url":"https://github.com/ParsePlatform/Parse-SDK-JS/pull/164","id":126031388,"number":164,"title":"Split ObjectState into utilities and storage implementations","user":{"login":"andrewimm","id":494043,"avatar_url":"https://avatars.githubusercontent.com/u/494043?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewimm","html_url":"https://github.com/andrewimm","followers_url":"https://api.github.com/users/andrewimm/followers","following_url":"https://api.github.com/users/andrewimm/following{/other_user}","gists_url":"https://api.github.com/users/andrewimm/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewimm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewimm/subscriptions","organizations_url":"https://api.github.com/users/andrewimm/orgs","repos_url":"https://api.github.com/users/andrewimm/repos","events_url":"https://api.github.com/users/andrewimm/events{/privacy}","received_events_url":"https://api.github.com/users/andrewimm/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-JS/labels/CLA%20Signed","name":"CLA Signed","color":"009900"}],"state":"open","locked":false,"assignee":{"login":"peterdotjs","id":2185784,"avatar_url":"https://avatars.githubusercontent.com/u/2185784?v=3","gravatar_id":"","url":"https://api.github.com/users/peterdotjs","html_url":"https://github.com/peterdotjs","followers_url":"https://api.github.com/users/peterdotjs/followers","following_url":"https://api.github.com/users/peterdotjs/following{/other_user}","gists_url":"https://api.github.com/users/peterdotjs/gists{/gist_id}","starred_url":"https://api.github.com/users/peterdotjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterdotjs/subscriptions","organizations_url":"https://api.github.com/users/peterdotjs/orgs","repos_url":"https://api.github.com/users/peterdotjs/repos","events_url":"https://api.github.com/users/peterdotjs/events{/privacy}","received_events_url":"https://api.github.com/users/peterdotjs/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-JS/milestones/4","html_url":"https://github.com/ParsePlatform/Parse-SDK-JS/milestones/1.7.0","labels_url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-JS/milestones/4/labels","id":1484215,"number":4,"title":"1.7.0","description":null,"creator":{"login":"andrewimm","id":494043,"avatar_url":"https://avatars.githubusercontent.com/u/494043?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewimm","html_url":"https://github.com/andrewimm","followers_url":"https://api.github.com/users/andrewimm/followers","following_url":"https://api.github.com/users/andrewimm/following{/other_user}","gists_url":"https://api.github.com/users/andrewimm/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewimm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewimm/subscriptions","organizations_url":"https://api.github.com/users/andrewimm/orgs","repos_url":"https://api.github.com/users/andrewimm/repos","events_url":"https://api.github.com/users/andrewimm/events{/privacy}","received_events_url":"https://api.github.com/users/andrewimm/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":1,"state":"open","created_at":"2016-01-05T07:42:12Z","updated_at":"2016-01-11T20:37:59Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2016-01-11T20:37:59Z","updated_at":"2016-01-11T23:25:42Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-JS/pulls/164","html_url":"https://github.com/ParsePlatform/Parse-SDK-JS/pull/164","diff_url":"https://github.com/ParsePlatform/Parse-SDK-JS/pull/164.diff","patch_url":"https://github.com/ParsePlatform/Parse-SDK-JS/pull/164.patch"},"body":"ObjectState used to both store object data *and* the perform the functionality to mutate it.\r\nNow, to facilitate different behavior between single-instance mode and unique-instance mode, ObjectState simply contains the mutation behavior, independent of how it's stored.\r\nThis PR introduces `SingleInstanceState` and `UniqueInstanceState`, storage layers that are directly accessed by ParseObject, and use ObjectState as a utility.\r\n\r\nThis change is chiefly to prevent the memory leaks reported in #111 \r\n\r\nEssentially, there are 4 pieces:\r\n - Isolation of ObjectState into utility functions that have their data sources passed in\r\n - Implementation of SingleInstanceState and UniqueInstanceState\r\n - Reimplementation of tests for both of these storage systems\r\n - Branching of ParseObject logic to interact with one or the other\r\n\r\nI'll be adding more tests, but things look good for now."},"comment":{"url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-JS/issues/comments/170730765","html_url":"https://github.com/ParsePlatform/Parse-SDK-JS/pull/164#issuecomment-170730765","issue_url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-JS/issues/164","id":170730765,"user":{"login":"andrewimm","id":494043,"avatar_url":"https://avatars.githubusercontent.com/u/494043?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewimm","html_url":"https://github.com/andrewimm","followers_url":"https://api.github.com/users/andrewimm/followers","following_url":"https://api.github.com/users/andrewimm/following{/other_user}","gists_url":"https://api.github.com/users/andrewimm/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewimm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewimm/subscriptions","organizations_url":"https://api.github.com/users/andrewimm/orgs","repos_url":"https://api.github.com/users/andrewimm/repos","events_url":"https://api.github.com/users/andrewimm/events{/privacy}","received_events_url":"https://api.github.com/users/andrewimm/received_events","type":"User","site_admin":false},"created_at":"2016-01-11T23:25:41Z","updated_at":"2016-01-11T23:25:41Z","body":"cc @hallucinogen and @wangmengyan95 for review as well"}}