{"action":"created","issue":{"url":"https://api.github.com/repos/realm/realm-js/issues/1930","repository_url":"https://api.github.com/repos/realm/realm-js","labels_url":"https://api.github.com/repos/realm/realm-js/issues/1930/labels{/name}","comments_url":"https://api.github.com/repos/realm/realm-js/issues/1930/comments","events_url":"https://api.github.com/repos/realm/realm-js/issues/1930/events","html_url":"https://github.com/realm/realm-js/issues/1930","id":342531973,"node_id":"MDU6SXNzdWUzNDI1MzE5NzM=","number":1930,"title":"Need better documentation/examples for partially synced Realms","user":{"login":"scottmas","id":2257337,"node_id":"MDQ6VXNlcjIyNTczMzc=","avatar_url":"https://avatars2.githubusercontent.com/u/2257337?v=4","gravatar_id":"","url":"https://api.github.com/users/scottmas","html_url":"https://github.com/scottmas","followers_url":"https://api.github.com/users/scottmas/followers","following_url":"https://api.github.com/users/scottmas/following{/other_user}","gists_url":"https://api.github.com/users/scottmas/gists{/gist_id}","starred_url":"https://api.github.com/users/scottmas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scottmas/subscriptions","organizations_url":"https://api.github.com/users/scottmas/orgs","repos_url":"https://api.github.com/users/scottmas/repos","events_url":"https://api.github.com/users/scottmas/events{/privacy}","received_events_url":"https://api.github.com/users/scottmas/received_events","type":"User","site_admin":false},"labels":[{"id":643640187,"node_id":"MDU6TGFiZWw2NDM2NDAxODc=","url":"https://api.github.com/repos/realm/realm-js/labels/O:User","name":"O:User","color":"006b75","default":false},{"id":643640198,"node_id":"MDU6TGFiZWw2NDM2NDAxOTg=","url":"https://api.github.com/repos/realm/realm-js/labels/P:1%20Required","name":"P:1 Required","color":"bfdadc","default":false},{"id":247475509,"node_id":"MDU6TGFiZWwyNDc0NzU1MDk=","url":"https://api.github.com/repos/realm/realm-js/labels/T:Bug","name":"T:Bug","color":"eb6420","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2018-07-18T23:59:36Z","updated_at":"2018-08-22T20:01:24Z","closed_at":null,"author_association":"NONE","body":"## Goals\r\n\r\nGet up and running with the Realm Platform.\r\n\r\n## Expected Results\r\n\r\nI have a Realm Object server running in the cloud and my local app intelligently syncs with it. \r\n\r\n## Actual Results\r\n\r\nThere's hardly any documentation, and what documentation we have is incomplete. \r\n\r\n## Steps to Reproduce\r\n\r\nPretend you know nothing about Realm and try to get working a partially synced server to the Realm Platform. You won't be able to. It's too poorly documented. \r\n\r\nSee these stack overflow issues demonstrating people have no idea how to set up partial syncing:\r\n\r\nhttps://stackoverflow.com/questions/48404807/how-should-synchronised-realm-actually-work\r\nhttps://stackoverflow.com/questions/49169199/realm-react-native-partial-sync-not-working-in-offline-mode-and-objectforprimary\r\n\r\n## Code Sample\r\nThis is the best minimal react example with partial syncing that it's possible to come up with after doing tons of Google searches. It still doesn't work but simply hangs forever:\r\n\r\n```javascript\r\niimport React from \"react\";\r\nimport Realm from \"realm\";\r\n\r\nconst TickerSchema = {\r\n  name: \"Ticker\",\r\n  primaryKey: \"tickerSymbol\",\r\n  properties: {\r\n    tickerSymbol: { type: \"string\", optional: false },\r\n    price: { type: \"int\", optional: false },\r\n    companyName: { type: \"string\", optional: false }\r\n  }\r\n};\r\n\r\nexport default class extends React.Component {\r\n  async componentDidMount() {\r\n    const SERVER = \"some-cloud-realm.us1.cloud.realm.io\";\r\n    const user = await Realm.Sync.User.login(`https://${SERVER}`, \"test-user\", \"password\");\r\n\r\n    const realm = await Realm.open({\r\n      sync: {\r\n        url: `realms://${SERVER}:/default`,\r\n        user: user\r\n      },\r\n      schema: [TickerSchema]\r\n    }).catch(e => console.error(e));\r\n\r\n    const results = realm.objects(\"Ticker\").filtered(\"price < 11\");\r\n    const subscription = results.subscribe();\r\n\r\n    console.log(\"Logging data...\", results);\r\n  }\r\n  render() {\r\n    return null;\r\n  }\r\n}\r\n```\r\n\r\n## Version of Realm and Tooling\r\n\r\n- Realm JS SDK Version: 2.12.0\r\n- Node or React Native: RN 55\r\n- Client OS & Version: IOS\r\n- Which debugger for React Native: Xcode\r\n"},"comment":{"url":"https://api.github.com/repos/realm/realm-js/issues/comments/415160683","html_url":"https://github.com/realm/realm-js/issues/1930#issuecomment-415160683","issue_url":"https://api.github.com/repos/realm/realm-js/issues/1930","id":415160683,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNTE2MDY4Mw==","user":{"login":"scottmas","id":2257337,"node_id":"MDQ6VXNlcjIyNTczMzc=","avatar_url":"https://avatars2.githubusercontent.com/u/2257337?v=4","gravatar_id":"","url":"https://api.github.com/users/scottmas","html_url":"https://github.com/scottmas","followers_url":"https://api.github.com/users/scottmas/followers","following_url":"https://api.github.com/users/scottmas/following{/other_user}","gists_url":"https://api.github.com/users/scottmas/gists{/gist_id}","starred_url":"https://api.github.com/users/scottmas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scottmas/subscriptions","organizations_url":"https://api.github.com/users/scottmas/orgs","repos_url":"https://api.github.com/users/scottmas/repos","events_url":"https://api.github.com/users/scottmas/events{/privacy}","received_events_url":"https://api.github.com/users/scottmas/received_events","type":"User","site_admin":false},"created_at":"2018-08-22T20:01:24Z","updated_at":"2018-08-22T20:01:24Z","author_association":"NONE","body":"Thanks for answering my questions! This is great stuff. It all does sound pretty complicated, and the complete tutorial explaining how it all works together from start to end in an actual quasi-real-life app would be great. "}}
{"actor":{"display_login":"scottmas"}}