{"action":"created","comment":{"url":"https://api.github.com/repos/corda/corda/pulls/comments/91093845","pull_request_review_id":11603443,"id":91093845,"diff_hunk":"@@ -11,7 +11,7 @@ import java.util.*\n class CashBalanceAsMetricsObserver(val serviceHubInternal: ServiceHubInternal) {\n     init {\n         // TODO: Need to consider failure scenarios.  This needs to run if the TX is successfully recorded\n-        serviceHubInternal.vaultService.updates.subscribe { update ->\n+        serviceHubInternal.vaultService.rawUpdates.subscribe { update ->","path":"node/src/main/kotlin/net/corda/node/services/vault/CashBalanceAsMetricsObserver.kt","position":5,"original_position":5,"commit_id":"8add26b0bd6e65ecaf8e6c9fe5574b3ad5b9bf1b","original_commit_id":"8add26b0bd6e65ecaf8e6c9fe5574b3ad5b9bf1b","user":{"login":"rick-r3","id":23558791,"avatar_url":"https://avatars.githubusercontent.com/u/23558791?v=3","gravatar_id":"","url":"https://api.github.com/users/rick-r3","html_url":"https://github.com/rick-r3","followers_url":"https://api.github.com/users/rick-r3/followers","following_url":"https://api.github.com/users/rick-r3/following{/other_user}","gists_url":"https://api.github.com/users/rick-r3/gists{/gist_id}","starred_url":"https://api.github.com/users/rick-r3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rick-r3/subscriptions","organizations_url":"https://api.github.com/users/rick-r3/orgs","repos_url":"https://api.github.com/users/rick-r3/repos","events_url":"https://api.github.com/users/rick-r3/events{/privacy}","received_events_url":"https://api.github.com/users/rick-r3/received_events","type":"User","site_admin":false},"body":"Hmmm.... I ran into an issue doing that but agree.  Will look at what the issue was again.","created_at":"2016-12-06T14:57:26Z","updated_at":"2016-12-06T14:57:26Z","html_url":"https://github.com/corda/corda/pull/33#discussion_r91093845","pull_request_url":"https://api.github.com/repos/corda/corda/pulls/33","_links":{"self":{"href":"https://api.github.com/repos/corda/corda/pulls/comments/91093845"},"html":{"href":"https://github.com/corda/corda/pull/33#discussion_r91093845"},"pull_request":{"href":"https://api.github.com/repos/corda/corda/pulls/33"}}},"pull_request":{"url":"https://api.github.com/repos/corda/corda/pulls/33","id":96725404,"html_url":"https://github.com/corda/corda/pull/33","diff_url":"https://github.com/corda/corda/pull/33.diff","patch_url":"https://github.com/corda/corda/pull/33.patch","issue_url":"https://api.github.com/repos/corda/corda/issues/33","number":33,"state":"open","locked":false,"title":"Buffer observations until database commit.","user":{"login":"rick-r3","id":23558791,"avatar_url":"https://avatars.githubusercontent.com/u/23558791?v=3","gravatar_id":"","url":"https://api.github.com/users/rick-r3","html_url":"https://github.com/rick-r3","followers_url":"https://api.github.com/users/rick-r3/followers","following_url":"https://api.github.com/users/rick-r3/following{/other_user}","gists_url":"https://api.github.com/users/rick-r3/gists{/gist_id}","starred_url":"https://api.github.com/users/rick-r3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rick-r3/subscriptions","organizations_url":"https://api.github.com/users/rick-r3/orgs","repos_url":"https://api.github.com/users/rick-r3/repos","events_url":"https://api.github.com/users/rick-r3/events{/privacy}","received_events_url":"https://api.github.com/users/rick-r3/received_events","type":"User","site_admin":false},"body":"Currently our `Observers` immediately push their observations to subscribers, even though the change of state they refer to will likely not be visible to anyone not inside the same database transaction.  e.g. observe a change in the vault and then query it only to **not** find what you were just informed of.  This particularly impacts RPC and tests. \r\n\r\nAn example test that was impacted by this was `FxTransactionBuildTutorialTest` which had to be re-written from the original form to that which is now in the master branch because the vault update was sometimes not visible to the subscribers due to that race condition, and would occasionally fail.  It is restored to the original form as part of this PR.\r\n\r\nUse the extension method `Observable.afterCommit()` to create a buffered form of the `Observable` that only delivers once the database transaction has been closed.\r\n\r\nNote that we have a few observers that do want to be within the transaction, all of which are observers of the vault.  We now expose the *raw* form of the vault `Observable` to continue to support this, in addition to the default buffered form.","created_at":"2016-12-06T13:40:16Z","updated_at":"2016-12-06T14:57:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"074aa58acda9f11c069d86badff36b8f82dfda79","assignee":{"login":"exFalso","id":1042674,"avatar_url":"https://avatars.githubusercontent.com/u/1042674?v=3","gravatar_id":"","url":"https://api.github.com/users/exFalso","html_url":"https://github.com/exFalso","followers_url":"https://api.github.com/users/exFalso/followers","following_url":"https://api.github.com/users/exFalso/following{/other_user}","gists_url":"https://api.github.com/users/exFalso/gists{/gist_id}","starred_url":"https://api.github.com/users/exFalso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exFalso/subscriptions","organizations_url":"https://api.github.com/users/exFalso/orgs","repos_url":"https://api.github.com/users/exFalso/repos","events_url":"https://api.github.com/users/exFalso/events{/privacy}","received_events_url":"https://api.github.com/users/exFalso/received_events","type":"User","site_admin":false},"assignees":[{"login":"exFalso","id":1042674,"avatar_url":"https://avatars.githubusercontent.com/u/1042674?v=3","gravatar_id":"","url":"https://api.github.com/users/exFalso","html_url":"https://github.com/exFalso","followers_url":"https://api.github.com/users/exFalso/followers","following_url":"https://api.github.com/users/exFalso/following{/other_user}","gists_url":"https://api.github.com/users/exFalso/gists{/gist_id}","starred_url":"https://api.github.com/users/exFalso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exFalso/subscriptions","organizations_url":"https://api.github.com/users/exFalso/orgs","repos_url":"https://api.github.com/users/exFalso/repos","events_url":"https://api.github.com/users/exFalso/events{/privacy}","received_events_url":"https://api.github.com/users/exFalso/received_events","type":"User","site_admin":false},{"login":"shamsasari","id":3883563,"avatar_url":"https://avatars.githubusercontent.com/u/3883563?v=3","gravatar_id":"","url":"https://api.github.com/users/shamsasari","html_url":"https://github.com/shamsasari","followers_url":"https://api.github.com/users/shamsasari/followers","following_url":"https://api.github.com/users/shamsasari/following{/other_user}","gists_url":"https://api.github.com/users/shamsasari/gists{/gist_id}","starred_url":"https://api.github.com/users/shamsasari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shamsasari/subscriptions","organizations_url":"https://api.github.com/users/shamsasari/orgs","repos_url":"https://api.github.com/users/shamsasari/repos","events_url":"https://api.github.com/users/shamsasari/events{/privacy}","received_events_url":"https://api.github.com/users/shamsasari/received_events","type":"User","site_admin":false},{"login":"mnesbit","id":20210228,"avatar_url":"https://avatars.githubusercontent.com/u/20210228?v=3","gravatar_id":"","url":"https://api.github.com/users/mnesbit","html_url":"https://github.com/mnesbit","followers_url":"https://api.github.com/users/mnesbit/followers","following_url":"https://api.github.com/users/mnesbit/following{/other_user}","gists_url":"https://api.github.com/users/mnesbit/gists{/gist_id}","starred_url":"https://api.github.com/users/mnesbit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mnesbit/subscriptions","organizations_url":"https://api.github.com/users/mnesbit/orgs","repos_url":"https://api.github.com/users/mnesbit/repos","events_url":"https://api.github.com/users/mnesbit/events{/privacy}","received_events_url":"https://api.github.com/users/mnesbit/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/corda/corda/pulls/33/commits","review_comments_url":"https://api.github.com/repos/corda/corda/pulls/33/comments","review_comment_url":"https://api.github.com/repos/corda/corda/pulls/comments{/number}","comments_url":"https://api.github.com/repos/corda/corda/issues/33/comments","statuses_url":"https://api.github.com/repos/corda/corda/statuses/8add26b0bd6e65ecaf8e6c9fe5574b3ad5b9bf1b","head":{"label":"corda:parkri-external-observations","ref":"parkri-external-observations","sha":"8add26b0bd6e65ecaf8e6c9fe5574b3ad5b9bf1b","user":{"login":"corda","id":22600631,"avatar_url":"https://avatars.githubusercontent.com/u/22600631?v=3","gravatar_id":"","url":"https://api.github.com/users/corda","html_url":"https://github.com/corda","followers_url":"https://api.github.com/users/corda/followers","following_url":"https://api.github.com/users/corda/following{/other_user}","gists_url":"https://api.github.com/users/corda/gists{/gist_id}","starred_url":"https://api.github.com/users/corda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/corda/subscriptions","organizations_url":"https://api.github.com/users/corda/orgs","repos_url":"https://api.github.com/users/corda/repos","events_url":"https://api.github.com/users/corda/events{/privacy}","received_events_url":"https://api.github.com/users/corda/received_events","type":"Organization","site_admin":false},"repo":{"id":70137417,"name":"corda","full_name":"corda/corda","owner":{"login":"corda","id":22600631,"avatar_url":"https://avatars.githubusercontent.com/u/22600631?v=3","gravatar_id":"","url":"https://api.github.com/users/corda","html_url":"https://github.com/corda","followers_url":"https://api.github.com/users/corda/followers","following_url":"https://api.github.com/users/corda/following{/other_user}","gists_url":"https://api.github.com/users/corda/gists{/gist_id}","starred_url":"https://api.github.com/users/corda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/corda/subscriptions","organizations_url":"https://api.github.com/users/corda/orgs","repos_url":"https://api.github.com/users/corda/repos","events_url":"https://api.github.com/users/corda/events{/privacy}","received_events_url":"https://api.github.com/users/corda/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/corda/corda","description":"Corda is a distributed ledger platform designed to record, manage and automate legal agreements between business partners. Designed by (and for) the world's largest financial institutions, it offers a unique response to the privacy and scalability challenges facing decentralised applications.","fork":false,"url":"https://api.github.com/repos/corda/corda","forks_url":"https://api.github.com/repos/corda/corda/forks","keys_url":"https://api.github.com/repos/corda/corda/keys{/key_id}","collaborators_url":"https://api.github.com/repos/corda/corda/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/corda/corda/teams","hooks_url":"https://api.github.com/repos/corda/corda/hooks","issue_events_url":"https://api.github.com/repos/corda/corda/issues/events{/number}","events_url":"https://api.github.com/repos/corda/corda/events","assignees_url":"https://api.github.com/repos/corda/corda/assignees{/user}","branches_url":"https://api.github.com/repos/corda/corda/branches{/branch}","tags_url":"https://api.github.com/repos/corda/corda/tags","blobs_url":"https://api.github.com/repos/corda/corda/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/corda/corda/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/corda/corda/git/refs{/sha}","trees_url":"https://api.github.com/repos/corda/corda/git/trees{/sha}","statuses_url":"https://api.github.com/repos/corda/corda/statuses/{sha}","languages_url":"https://api.github.com/repos/corda/corda/languages","stargazers_url":"https://api.github.com/repos/corda/corda/stargazers","contributors_url":"https://api.github.com/repos/corda/corda/contributors","subscribers_url":"https://api.github.com/repos/corda/corda/subscribers","subscription_url":"https://api.github.com/repos/corda/corda/subscription","commits_url":"https://api.github.com/repos/corda/corda/commits{/sha}","git_commits_url":"https://api.github.com/repos/corda/corda/git/commits{/sha}","comments_url":"https://api.github.com/repos/corda/corda/comments{/number}","issue_comment_url":"https://api.github.com/repos/corda/corda/issues/comments{/number}","contents_url":"https://api.github.com/repos/corda/corda/contents/{+path}","compare_url":"https://api.github.com/repos/corda/corda/compare/{base}...{head}","merges_url":"https://api.github.com/repos/corda/corda/merges","archive_url":"https://api.github.com/repos/corda/corda/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/corda/corda/downloads","issues_url":"https://api.github.com/repos/corda/corda/issues{/number}","pulls_url":"https://api.github.com/repos/corda/corda/pulls{/number}","milestones_url":"https://api.github.com/repos/corda/corda/milestones{/number}","notifications_url":"https://api.github.com/repos/corda/corda/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/corda/corda/labels{/name}","releases_url":"https://api.github.com/repos/corda/corda/releases{/id}","deployments_url":"https://api.github.com/repos/corda/corda/deployments","created_at":"2016-10-06T08:46:29Z","updated_at":"2016-12-06T13:06:29Z","pushed_at":"2016-12-06T14:30:59Z","git_url":"git://github.com/corda/corda.git","ssh_url":"git@github.com:corda/corda.git","clone_url":"https://github.com/corda/corda.git","svn_url":"https://github.com/corda/corda","homepage":"https://www.corda.net","size":48629,"stargazers_count":256,"watchers_count":256,"language":"Kotlin","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":76,"mirror_url":null,"open_issues_count":12,"forks":76,"open_issues":12,"watchers":256,"default_branch":"master"}},"base":{"label":"corda:master","ref":"master","sha":"e1e6d187e3f72c5ceb67ccfac74b782fd43c1a31","user":{"login":"corda","id":22600631,"avatar_url":"https://avatars.githubusercontent.com/u/22600631?v=3","gravatar_id":"","url":"https://api.github.com/users/corda","html_url":"https://github.com/corda","followers_url":"https://api.github.com/users/corda/followers","following_url":"https://api.github.com/users/corda/following{/other_user}","gists_url":"https://api.github.com/users/corda/gists{/gist_id}","starred_url":"https://api.github.com/users/corda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/corda/subscriptions","organizations_url":"https://api.github.com/users/corda/orgs","repos_url":"https://api.github.com/users/corda/repos","events_url":"https://api.github.com/users/corda/events{/privacy}","received_events_url":"https://api.github.com/users/corda/received_events","type":"Organization","site_admin":false},"repo":{"id":70137417,"name":"corda","full_name":"corda/corda","owner":{"login":"corda","id":22600631,"avatar_url":"https://avatars.githubusercontent.com/u/22600631?v=3","gravatar_id":"","url":"https://api.github.com/users/corda","html_url":"https://github.com/corda","followers_url":"https://api.github.com/users/corda/followers","following_url":"https://api.github.com/users/corda/following{/other_user}","gists_url":"https://api.github.com/users/corda/gists{/gist_id}","starred_url":"https://api.github.com/users/corda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/corda/subscriptions","organizations_url":"https://api.github.com/users/corda/orgs","repos_url":"https://api.github.com/users/corda/repos","events_url":"https://api.github.com/users/corda/events{/privacy}","received_events_url":"https://api.github.com/users/corda/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/corda/corda","description":"Corda is a distributed ledger platform designed to record, manage and automate legal agreements between business partners. Designed by (and for) the world's largest financial institutions, it offers a unique response to the privacy and scalability challenges facing decentralised applications.","fork":false,"url":"https://api.github.com/repos/corda/corda","forks_url":"https://api.github.com/repos/corda/corda/forks","keys_url":"https://api.github.com/repos/corda/corda/keys{/key_id}","collaborators_url":"https://api.github.com/repos/corda/corda/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/corda/corda/teams","hooks_url":"https://api.github.com/repos/corda/corda/hooks","issue_events_url":"https://api.github.com/repos/corda/corda/issues/events{/number}","events_url":"https://api.github.com/repos/corda/corda/events","assignees_url":"https://api.github.com/repos/corda/corda/assignees{/user}","branches_url":"https://api.github.com/repos/corda/corda/branches{/branch}","tags_url":"https://api.github.com/repos/corda/corda/tags","blobs_url":"https://api.github.com/repos/corda/corda/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/corda/corda/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/corda/corda/git/refs{/sha}","trees_url":"https://api.github.com/repos/corda/corda/git/trees{/sha}","statuses_url":"https://api.github.com/repos/corda/corda/statuses/{sha}","languages_url":"https://api.github.com/repos/corda/corda/languages","stargazers_url":"https://api.github.com/repos/corda/corda/stargazers","contributors_url":"https://api.github.com/repos/corda/corda/contributors","subscribers_url":"https://api.github.com/repos/corda/corda/subscribers","subscription_url":"https://api.github.com/repos/corda/corda/subscription","commits_url":"https://api.github.com/repos/corda/corda/commits{/sha}","git_commits_url":"https://api.github.com/repos/corda/corda/git/commits{/sha}","comments_url":"https://api.github.com/repos/corda/corda/comments{/number}","issue_comment_url":"https://api.github.com/repos/corda/corda/issues/comments{/number}","contents_url":"https://api.github.com/repos/corda/corda/contents/{+path}","compare_url":"https://api.github.com/repos/corda/corda/compare/{base}...{head}","merges_url":"https://api.github.com/repos/corda/corda/merges","archive_url":"https://api.github.com/repos/corda/corda/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/corda/corda/downloads","issues_url":"https://api.github.com/repos/corda/corda/issues{/number}","pulls_url":"https://api.github.com/repos/corda/corda/pulls{/number}","milestones_url":"https://api.github.com/repos/corda/corda/milestones{/number}","notifications_url":"https://api.github.com/repos/corda/corda/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/corda/corda/labels{/name}","releases_url":"https://api.github.com/repos/corda/corda/releases{/id}","deployments_url":"https://api.github.com/repos/corda/corda/deployments","created_at":"2016-10-06T08:46:29Z","updated_at":"2016-12-06T13:06:29Z","pushed_at":"2016-12-06T14:30:59Z","git_url":"git://github.com/corda/corda.git","ssh_url":"git@github.com:corda/corda.git","clone_url":"https://github.com/corda/corda.git","svn_url":"https://github.com/corda/corda","homepage":"https://www.corda.net","size":48629,"stargazers_count":256,"watchers_count":256,"language":"Kotlin","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":76,"mirror_url":null,"open_issues_count":12,"forks":76,"open_issues":12,"watchers":256,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/corda/corda/pulls/33"},"html":{"href":"https://github.com/corda/corda/pull/33"},"issue":{"href":"https://api.github.com/repos/corda/corda/issues/33"},"comments":{"href":"https://api.github.com/repos/corda/corda/issues/33/comments"},"review_comments":{"href":"https://api.github.com/repos/corda/corda/pulls/33/comments"},"review_comment":{"href":"https://api.github.com/repos/corda/corda/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/corda/corda/pulls/33/commits"},"statuses":{"href":"https://api.github.com/repos/corda/corda/statuses/8add26b0bd6e65ecaf8e6c9fe5574b3ad5b9bf1b"}}}}
{"actor":{"display_login":"rick-r3"}}