{"action":"created","issue":{"url":"https://api.github.com/repos/vanadium/issues/issues/857","labels_url":"https://api.github.com/repos/vanadium/issues/issues/857/labels{/name}","comments_url":"https://api.github.com/repos/vanadium/issues/issues/857/comments","events_url":"https://api.github.com/repos/vanadium/issues/issues/857/events","html_url":"https://github.com/vanadium/issues/issues/857","id":115158045,"number":857,"title":"Sync requires pre-existing hierarchy","user":{"login":"AsturaPhoenix","id":13222934,"avatar_url":"https://avatars.githubusercontent.com/u/13222934?v=3","gravatar_id":"","url":"https://api.github.com/users/AsturaPhoenix","html_url":"https://github.com/AsturaPhoenix","followers_url":"https://api.github.com/users/AsturaPhoenix/followers","following_url":"https://api.github.com/users/AsturaPhoenix/following{/other_user}","gists_url":"https://api.github.com/users/AsturaPhoenix/gists{/gist_id}","starred_url":"https://api.github.com/users/AsturaPhoenix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AsturaPhoenix/subscriptions","organizations_url":"https://api.github.com/users/AsturaPhoenix/orgs","repos_url":"https://api.github.com/users/AsturaPhoenix/repos","events_url":"https://api.github.com/users/AsturaPhoenix/events{/privacy}","received_events_url":"https://api.github.com/users/AsturaPhoenix/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/vanadium/issues/labels/Area:%20Syncbase","name":"Area: Syncbase","color":"bfd4f2"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-11-04T21:55:41Z","updated_at":"2015-11-04T23:14:24Z","closed_at":null,"body":"This issue was originally reported by @jxson. If a Syncbase instance is missing any of the app/db/table hierarchy, sync does not happen. Normally this isn't much of a problem as an app needs to create hierarchy to operate anyway, but I just ran into a case where an app that creates is table lazily tries to start a watch before the table exists.\r\n\r\nStarting the watch first calls a db.getTable(...).get to fetch initial data, which fails with NO_EXIST, and the app falls back on defaults and starts the watch. However, the watch never produces anything since sync doesn't occur.\r\n\r\nOne possible solution might have been to lazily create the table during the initial query, but that query occurs in a read batch (with getResumeMarker) and table creation cannot currently occur in a batch.\r\n\r\nThe app is working around this by ensuring existence of the table prior to the batch."},"comment":{"url":"https://api.github.com/repos/vanadium/issues/issues/comments/153900589","html_url":"https://github.com/vanadium/issues/issues/857#issuecomment-153900589","issue_url":"https://api.github.com/repos/vanadium/issues/issues/857","id":153900589,"user":{"login":"kenashcraft","id":9617941,"avatar_url":"https://avatars.githubusercontent.com/u/9617941?v=3","gravatar_id":"","url":"https://api.github.com/users/kenashcraft","html_url":"https://github.com/kenashcraft","followers_url":"https://api.github.com/users/kenashcraft/followers","following_url":"https://api.github.com/users/kenashcraft/following{/other_user}","gists_url":"https://api.github.com/users/kenashcraft/gists{/gist_id}","starred_url":"https://api.github.com/users/kenashcraft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kenashcraft/subscriptions","organizations_url":"https://api.github.com/users/kenashcraft/orgs","repos_url":"https://api.github.com/users/kenashcraft/repos","events_url":"https://api.github.com/users/kenashcraft/events{/privacy}","received_events_url":"https://api.github.com/users/kenashcraft/received_events","type":"User","site_admin":false},"created_at":"2015-11-04T23:14:24Z","updated_at":"2015-11-04T23:14:24Z","body":"We disallow creation of a table within a batch because we were thinking about SQL-like functionality that would be hard to support.\r\n \r\n@jakline do you have thoughts?"}}