{"action":"opened","number":50,"pull_request":{"url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/pulls/50","id":59594561,"html_url":"https://github.com/amplitude/Amplitude-Javascript/pull/50","diff_url":"https://github.com/amplitude/Amplitude-Javascript/pull/50.diff","patch_url":"https://github.com/amplitude/Amplitude-Javascript/pull/50.patch","issue_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/issues/50","number":50,"state":"open","locked":false,"title":"Make json serializable","user":{"login":"djih","id":4776584,"avatar_url":"https://avatars.githubusercontent.com/u/4776584?v=3","gravatar_id":"","url":"https://api.github.com/users/djih","html_url":"https://github.com/djih","followers_url":"https://api.github.com/users/djih/followers","following_url":"https://api.github.com/users/djih/following{/other_user}","gists_url":"https://api.github.com/users/djih/gists{/gist_id}","starred_url":"https://api.github.com/users/djih/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djih/subscriptions","organizations_url":"https://api.github.com/users/djih/orgs","repos_url":"https://api.github.com/users/djih/repos","events_url":"https://api.github.com/users/djih/events{/privacy}","received_events_url":"https://api.github.com/users/djih/received_events","type":"User","site_admin":false},"body":"This will validate event properties when logging events and when loading saved events from localStorage during init.\r\n\r\nBefore if the event properties were incorrectly formatted, they would cause a 400 error from Amplitude servers. Those events would never be removed from localStorage, so the 400 error would never go away.\r\n\r\nThis will clean event properties, ensuring that the keys are all strings, and that the values are an acceptable type. Values that are null, NaN, undefined, functions, regexp, arguments, will be ignored. Values that are errors will be coerced into string values. Nested objects are allowed. Objects or arrays within array values will be ignored.\r\n\r\nThe event properties are validated during logEvent when the event object is being generated. They are also validated during init, when loading saved events from localStorage, in the case that improperly formatted events were already saved. This will clean them and prevent re-occuring 400 errors.","created_at":"2016-02-17T04:19:11Z","updated_at":"2016-02-17T04:19:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":{"login":"djih","id":4776584,"avatar_url":"https://avatars.githubusercontent.com/u/4776584?v=3","gravatar_id":"","url":"https://api.github.com/users/djih","html_url":"https://github.com/djih","followers_url":"https://api.github.com/users/djih/followers","following_url":"https://api.github.com/users/djih/following{/other_user}","gists_url":"https://api.github.com/users/djih/gists{/gist_id}","starred_url":"https://api.github.com/users/djih/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djih/subscriptions","organizations_url":"https://api.github.com/users/djih/orgs","repos_url":"https://api.github.com/users/djih/repos","events_url":"https://api.github.com/users/djih/events{/privacy}","received_events_url":"https://api.github.com/users/djih/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/pulls/50/commits","review_comments_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/pulls/50/comments","review_comment_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/pulls/comments{/number}","comments_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/issues/50/comments","statuses_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/statuses/83d869ce84e853830b83255e6e5c6971ae3d9c85","head":{"label":"amplitude:make_json_serializable","ref":"make_json_serializable","sha":"83d869ce84e853830b83255e6e5c6971ae3d9c85","user":{"login":"amplitude","id":2291562,"avatar_url":"https://avatars.githubusercontent.com/u/2291562?v=3","gravatar_id":"","url":"https://api.github.com/users/amplitude","html_url":"https://github.com/amplitude","followers_url":"https://api.github.com/users/amplitude/followers","following_url":"https://api.github.com/users/amplitude/following{/other_user}","gists_url":"https://api.github.com/users/amplitude/gists{/gist_id}","starred_url":"https://api.github.com/users/amplitude/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amplitude/subscriptions","organizations_url":"https://api.github.com/users/amplitude/orgs","repos_url":"https://api.github.com/users/amplitude/repos","events_url":"https://api.github.com/users/amplitude/events{/privacy}","received_events_url":"https://api.github.com/users/amplitude/received_events","type":"Organization","site_admin":false},"repo":{"id":7568671,"name":"Amplitude-Javascript","full_name":"amplitude/Amplitude-Javascript","owner":{"login":"amplitude","id":2291562,"avatar_url":"https://avatars.githubusercontent.com/u/2291562?v=3","gravatar_id":"","url":"https://api.github.com/users/amplitude","html_url":"https://github.com/amplitude","followers_url":"https://api.github.com/users/amplitude/followers","following_url":"https://api.github.com/users/amplitude/following{/other_user}","gists_url":"https://api.github.com/users/amplitude/gists{/gist_id}","starred_url":"https://api.github.com/users/amplitude/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amplitude/subscriptions","organizations_url":"https://api.github.com/users/amplitude/orgs","repos_url":"https://api.github.com/users/amplitude/repos","events_url":"https://api.github.com/users/amplitude/events{/privacy}","received_events_url":"https://api.github.com/users/amplitude/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/amplitude/Amplitude-Javascript","description":"Javascript SDK for Amplitude","fork":false,"url":"https://api.github.com/repos/amplitude/Amplitude-Javascript","forks_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/forks","keys_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/keys{/key_id}","collaborators_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/teams","hooks_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/hooks","issue_events_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/issues/events{/number}","events_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/events","assignees_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/assignees{/user}","branches_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/branches{/branch}","tags_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/tags","blobs_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/git/refs{/sha}","trees_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/git/trees{/sha}","statuses_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/statuses/{sha}","languages_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/languages","stargazers_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/stargazers","contributors_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/contributors","subscribers_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/subscribers","subscription_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/subscription","commits_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/commits{/sha}","git_commits_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/git/commits{/sha}","comments_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/comments{/number}","issue_comment_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/issues/comments{/number}","contents_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/contents/{+path}","compare_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/compare/{base}...{head}","merges_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/merges","archive_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/downloads","issues_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/issues{/number}","pulls_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/pulls{/number}","milestones_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/milestones{/number}","notifications_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/labels{/name}","releases_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/releases{/id}","deployments_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/deployments","created_at":"2013-01-11T23:04:28Z","updated_at":"2016-01-22T12:48:50Z","pushed_at":"2016-02-17T04:14:18Z","git_url":"git://github.com/amplitude/Amplitude-Javascript.git","ssh_url":"git@github.com:amplitude/Amplitude-Javascript.git","clone_url":"https://github.com/amplitude/Amplitude-Javascript.git","svn_url":"https://github.com/amplitude/Amplitude-Javascript","homepage":null,"size":1105,"stargazers_count":32,"watchers_count":32,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":6,"forks":7,"open_issues":6,"watchers":32,"default_branch":"master"}},"base":{"label":"amplitude:master","ref":"master","sha":"c2ef2ef6bb0d598e87fa5c49229da219020a0b34","user":{"login":"amplitude","id":2291562,"avatar_url":"https://avatars.githubusercontent.com/u/2291562?v=3","gravatar_id":"","url":"https://api.github.com/users/amplitude","html_url":"https://github.com/amplitude","followers_url":"https://api.github.com/users/amplitude/followers","following_url":"https://api.github.com/users/amplitude/following{/other_user}","gists_url":"https://api.github.com/users/amplitude/gists{/gist_id}","starred_url":"https://api.github.com/users/amplitude/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amplitude/subscriptions","organizations_url":"https://api.github.com/users/amplitude/orgs","repos_url":"https://api.github.com/users/amplitude/repos","events_url":"https://api.github.com/users/amplitude/events{/privacy}","received_events_url":"https://api.github.com/users/amplitude/received_events","type":"Organization","site_admin":false},"repo":{"id":7568671,"name":"Amplitude-Javascript","full_name":"amplitude/Amplitude-Javascript","owner":{"login":"amplitude","id":2291562,"avatar_url":"https://avatars.githubusercontent.com/u/2291562?v=3","gravatar_id":"","url":"https://api.github.com/users/amplitude","html_url":"https://github.com/amplitude","followers_url":"https://api.github.com/users/amplitude/followers","following_url":"https://api.github.com/users/amplitude/following{/other_user}","gists_url":"https://api.github.com/users/amplitude/gists{/gist_id}","starred_url":"https://api.github.com/users/amplitude/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amplitude/subscriptions","organizations_url":"https://api.github.com/users/amplitude/orgs","repos_url":"https://api.github.com/users/amplitude/repos","events_url":"https://api.github.com/users/amplitude/events{/privacy}","received_events_url":"https://api.github.com/users/amplitude/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/amplitude/Amplitude-Javascript","description":"Javascript SDK for Amplitude","fork":false,"url":"https://api.github.com/repos/amplitude/Amplitude-Javascript","forks_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/forks","keys_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/keys{/key_id}","collaborators_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/teams","hooks_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/hooks","issue_events_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/issues/events{/number}","events_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/events","assignees_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/assignees{/user}","branches_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/branches{/branch}","tags_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/tags","blobs_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/git/refs{/sha}","trees_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/git/trees{/sha}","statuses_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/statuses/{sha}","languages_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/languages","stargazers_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/stargazers","contributors_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/contributors","subscribers_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/subscribers","subscription_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/subscription","commits_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/commits{/sha}","git_commits_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/git/commits{/sha}","comments_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/comments{/number}","issue_comment_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/issues/comments{/number}","contents_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/contents/{+path}","compare_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/compare/{base}...{head}","merges_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/merges","archive_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/downloads","issues_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/issues{/number}","pulls_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/pulls{/number}","milestones_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/milestones{/number}","notifications_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/labels{/name}","releases_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/releases{/id}","deployments_url":"https://api.github.com/repos/amplitude/Amplitude-Javascript/deployments","created_at":"2013-01-11T23:04:28Z","updated_at":"2016-01-22T12:48:50Z","pushed_at":"2016-02-17T04:14:18Z","git_url":"git://github.com/amplitude/Amplitude-Javascript.git","ssh_url":"git@github.com:amplitude/Amplitude-Javascript.git","clone_url":"https://github.com/amplitude/Amplitude-Javascript.git","svn_url":"https://github.com/amplitude/Amplitude-Javascript","homepage":null,"size":1105,"stargazers_count":32,"watchers_count":32,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":6,"forks":7,"open_issues":6,"watchers":32,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/amplitude/Amplitude-Javascript/pulls/50"},"html":{"href":"https://github.com/amplitude/Amplitude-Javascript/pull/50"},"issue":{"href":"https://api.github.com/repos/amplitude/Amplitude-Javascript/issues/50"},"comments":{"href":"https://api.github.com/repos/amplitude/Amplitude-Javascript/issues/50/comments"},"review_comments":{"href":"https://api.github.com/repos/amplitude/Amplitude-Javascript/pulls/50/comments"},"review_comment":{"href":"https://api.github.com/repos/amplitude/Amplitude-Javascript/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/amplitude/Amplitude-Javascript/pulls/50/commits"},"statuses":{"href":"https://api.github.com/repos/amplitude/Amplitude-Javascript/statuses/83d869ce84e853830b83255e6e5c6971ae3d9c85"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":2,"additions":410,"deletions":99,"changed_files":10}}