{"action":"created","issue":{"url":"https://api.github.com/repos/guardian/support-workers/issues/157","repository_url":"https://api.github.com/repos/guardian/support-workers","labels_url":"https://api.github.com/repos/guardian/support-workers/issues/157/labels{/name}","comments_url":"https://api.github.com/repos/guardian/support-workers/issues/157/comments","events_url":"https://api.github.com/repos/guardian/support-workers/issues/157/events","html_url":"https://github.com/guardian/support-workers/pull/157","id":382771440,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMyNDAwNzgw","number":157,"title":"Store request id instead of session id for zuora deduping","user":{"login":"johnduffell","id":7304387,"node_id":"MDQ6VXNlcjczMDQzODc=","avatar_url":"https://avatars1.githubusercontent.com/u/7304387?v=4","gravatar_id":"","url":"https://api.github.com/users/johnduffell","html_url":"https://github.com/johnduffell","followers_url":"https://api.github.com/users/johnduffell/followers","following_url":"https://api.github.com/users/johnduffell/following{/other_user}","gists_url":"https://api.github.com/users/johnduffell/gists{/gist_id}","starred_url":"https://api.github.com/users/johnduffell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnduffell/subscriptions","organizations_url":"https://api.github.com/users/johnduffell/orgs","repos_url":"https://api.github.com/users/johnduffell/repos","events_url":"https://api.github.com/users/johnduffell/events{/privacy}","received_events_url":"https://api.github.com/users/johnduffell/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-11-20T17:26:12Z","updated_at":"2018-11-21T15:39:28Z","closed_at":"2018-11-21T15:38:53Z","author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/guardian/support-workers/pulls/157","html_url":"https://github.com/guardian/support-workers/pull/157","diff_url":"https://github.com/guardian/support-workers/pull/157.diff","patch_url":"https://github.com/guardian/support-workers/pull/157.patch"},"body":"## Why are you doing this?\r\nfrom https://github.com/guardian/support-models/pull/48\r\nOriginally we added deduplication on identity id to prevent multiple contributions in a very watertight way. This was because sometimes we saw duplicates when the step functions retried the create subscription step.\r\nWe added the ability to contribute when not logged in, meaning that in a previous PR I added session id so we would deduplicate all requests that came from the same browser when logged in, but didn't deduplicate if the person wasn't logged in. This would prevent as best as possible anyone who ended up double paying without leaking any information.\r\nUnfortunately it turned out that we can only actually deduplicate in that way within a single execution of the step functions, as currently once the zuora step passes, the analytics events are sent regardless.\r\n\r\n[**Trello Card**](https://trello.com/c/k0RXPuuf/179-dups-change-step-functions-to-only-send-events-if-a-contribution-happened)\r\n\r\n## Changes\r\nThis PR changes support workers to use CreatedRequestId__c in zuora to deduplicate.  This means that if the person runs the create twice from the same browser, they will end up with two subscriptions and two analytics events.\r\n"},"comment":{"url":"https://api.github.com/repos/guardian/support-workers/issues/comments/440709851","html_url":"https://github.com/guardian/support-workers/pull/157#issuecomment-440709851","issue_url":"https://api.github.com/repos/guardian/support-workers/issues/157","id":440709851,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MDcwOTg1MQ==","user":{"login":"johnduffell","id":7304387,"node_id":"MDQ6VXNlcjczMDQzODc=","avatar_url":"https://avatars1.githubusercontent.com/u/7304387?v=4","gravatar_id":"","url":"https://api.github.com/users/johnduffell","html_url":"https://github.com/johnduffell","followers_url":"https://api.github.com/users/johnduffell/followers","following_url":"https://api.github.com/users/johnduffell/following{/other_user}","gists_url":"https://api.github.com/users/johnduffell/gists{/gist_id}","starred_url":"https://api.github.com/users/johnduffell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnduffell/subscriptions","organizations_url":"https://api.github.com/users/johnduffell/orgs","repos_url":"https://api.github.com/users/johnduffell/repos","events_url":"https://api.github.com/users/johnduffell/events{/privacy}","received_events_url":"https://api.github.com/users/johnduffell/received_events","type":"User","site_admin":false},"created_at":"2018-11-21T15:39:28Z","updated_at":"2018-11-21T15:39:28Z","author_association":"MEMBER","body":"seems to work fine in CODE (although I did notice a previous execution that was looping on create SF contact since 2am, so I terminated it)"}}
{"actor":{"display_login":"johnduffell"}}